|
You last visited: Today at 14:01
Advertisement
[Side-Project] IG# / InfamousGeek Sharp
Discussion on [Side-Project] IG# / InfamousGeek Sharp within the CO2 Private Server forum part of the Conquer Online 2 category.
07/26/2010, 15:18
|
#1
|
elite*gold: 0
Join Date: Jul 2010
Posts: 37
Received Thanks: 8
|
[Side-Project] IG# / InfamousGeek Sharp
As you know me of my Basic Conquer Emulator project, this is a side-project which I thought of when going through the npc server. I decided it would be a fun experience to write a scripting language which is a modification of C#, therefore IG#. So far it only supports Console.WriteLine, but every unknown method or variable will be invoked to an event which you can eventually handle on your own. Also undefined variables must be registered before compiling the external code.
A little preview:
Code:
static void Main(string[] args)
{
IGReader Reader = new IGReader();
Reader.Load(@"C:\Users\Admin\Documents\Test.txt");
IGCompiler Compiler = Reader.ToIGCompiler();
Compiler.Register("dialog", 3, IGVariableType.Integer);//Defining variables
Compiler.Compile();//Compile the code
Console.WriteLine("[IGSharp] Executed file!");
Reader.Dispose();
Compiler.Dispose();
GC.Collect();
while (true)
Console.ReadLine();
}
Little example code I wrote;
Code:
if (1 == 2)
{
Console.WriteLine(Member 1 executed!);
}
if (1 == 1)
{
Console.WriteLine(Member 2 executed!);
}
if (2 == 2)
{
Console.WriteLine(Member 3 executed!);
}
if(%dialog == 3)
{
Console.WriteLine(Member 4 executed!);
}
Have a good day.
|
|
|
07/26/2010, 17:00
|
#2
|
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
|
Neat, using a .dll ?
|
|
|
07/26/2010, 17:06
|
#3
|
elite*gold: 0
Join Date: Jul 2010
Posts: 37
Received Thanks: 8
|
Quote:
Originally Posted by Eliminationn
Neat, using a .dll ?
|
Ofcourse. Most likely I'm stupid enough to share the source with you. Meh, if life was just that easy.
|
|
|
07/26/2010, 17:12
|
#4
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Doesnt look like your going to be able to modify npc scripts on the fly with this? Unless you recompile everytime an npc is accessed which makes me wonder what the performance would be like while using this.
|
|
|
07/26/2010, 17:15
|
#5
|
elite*gold: 0
Join Date: Jul 2010
Posts: 37
Received Thanks: 8
|
Quote:
Originally Posted by Korvacs
Doesnt look like your going to be able to modify npc scripts on the fly with this? Unless you recompile everytime an npc is accessed which makes me wonder what the performance would be like while using this.
|
The speed actually is pretty fast, also the process when compiling is very light-weight. I didn't have problems when testing this with npcs, also checked with GC for the memory usage.
|
|
|
07/26/2010, 17:18
|
#6
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Quote:
Originally Posted by InfamousGeek
The speed actually is pretty fast, also the process when compiling is very light-weight. I didn't have problems when testing this with npcs, also checked with GC for the memory usage.
|
Not doubting it works, or even works well, just wondering how well it compares to other script based methods.
|
|
|
07/26/2010, 17:19
|
#7
|
elite*gold: 0
Join Date: Jul 2010
Posts: 37
Received Thanks: 8
|
Quote:
Originally Posted by Korvacs
Not doubting it works, or even works well, just wondering how well it compares to other script based methods.
|
I might compare it to LUA or do you perhaps know another quick scripting language? So that I can compare it with mine.
|
|
|
07/26/2010, 17:44
|
#8
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Quote:
Originally Posted by InfamousGeek
I might compare it to LUA or do you perhaps know another quick scripting language? So that I can compare it with mine.
|
LUA would probably give the best overall benchmark i think, personally i was thinking about something like xml based npcs, with sections containing functions which require a compiler, but i havent really decided yet, that way the scripts can be updated on the fly, and the performance hit from using a compiler would be minimal since the function is only compiled when its required.
|
|
|
07/26/2010, 20:48
|
#9
|
elite*gold: 0
Join Date: Jul 2010
Posts: 37
Received Thanks: 8
|
Quote:
Originally Posted by Korvacs
LUA would probably give the best overall benchmark i think, personally i was thinking about something like xml based npcs, with sections containing functions which require a compiler, but i havent really decided yet, that way the scripts can be updated on the fly, and the performance hit from using a compiler would be minimal since the function is only compiled when its required.
|
Its kinda harsh using xml section for npc scripting, even though that is my personal opinion.
|
|
|
07/28/2010, 18:26
|
#10
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 506
|
I'm speechless.
|
|
|
 |
Similar Threads
|
Server side ann client Side things.
08/29/2011 - Battle of the Immortals - 10 Replies
Just for more we know guys.. this way none will lose his time.
Wtaht we know now is:
Speed: Cleint Side.
Map Coord: Client side.
Damage : Server Side.
|
Client side or server side?
01/24/2010 - CO2 Private Server - 1 Replies
I have a problem .. in karlos source 5165 with my clinet getted from webpage ..
Wen a player is in PK arena and other enter to loto they seeams to be on same map .. they try to hit each other but they don't dmg .. i was looking on source and it seams all is ok because .. lady luck get u in the Loto map and ArenaGurdian take u to other map ..
I think the client is massed up .. were can i find other client for 5165 .. my client is downloaded from this forum on section clinet relase
|
Hackable: Client side vs Server side
05/01/2008 - Dekaron - 7 Replies
I'v been reading a bit and I was already familiar with winhex and the likes, so I was able to start messing around in the Dekaron process rather easily. What I'm wondering is, what exactly can be modified, and what use it could be.
For example, we know that character experience is server side, so modifying it would have no real purpose, but for some reason, it'll let you equip weapons of higher level if you meet the other requirements, which could also be modified should they need be. So all...
|
Character name restrictions are client side, not server side
04/24/2008 - Conquer Online 2 - 1 Replies
"Sorry non-alpha numberic....."
That error message you get when you type in special characters in your character name, is client sided. It does no server check. Im not a coder or anything, so I'm not sure how to fix that.
But since it is client sided, it would be a lot easier to repair this problem.
|
server side/client side
12/19/2005 - Conquer Online 2 - 6 Replies
hey guys, could someone make a list for me that has all the server side items and then another that has the client side items? thx in advance 8)
|
All times are GMT +1. The time now is 14:01.
|
|