Conquer Packet Structures

I was going to do something exactly like this but in C++. Seeing this thread reminded me of it ;D

My idea was to make it into a DLL that can be loaded into any project and it would provide a way to organize the packets for you. DLL replace on a packet update and viola :D
 
to much of a pain to keep interveining between the DLL's and having to recompile for Delphi; It'd just keep em in a .pas (A source file) and C# a .cs Lol. I wouldn't bother using a DLL.
DLLs are not restricted to a language. You just have to import the class structure into your language and go from there. =) The functions handle all the processing within the DLL so all you do is pass the packet itself and it returns your struct all set out.
 
i know just pass a stdcall, But it's too much of a pain like I said to keep compiling two language(s), or to have two individual projects (one for the server, one for the dll) I'm just naturally lazy.

btw it's not smart to pass structs/classes through DLL's especially with a .NET language once the DLL disposes of the class and ur server keeps using the inital pointer u get a buncha errors rofl.

You don't keep compiling two languages. The DLL is only remade (which btw you don't even have the source so you wouldn't even worry about it) when the packet structures change which isn't often. And the DLL never disposes of the class. How would it unless you tell it to? Well, C# might be another story with it's retarded garbage collection but you don't generally use pointers in C# anyway.
 
Mhm, I can tell you'd write your DLL in C++; So you'd be fine but half Er.. well I wont insult them. But they'd write their DLL in a .NET Language, C# or VB or one of 'em thats "managed" memory and once it thinks your not using it anymore it'll dispose of it lmfao, then you try access it ur program gets errors.

That's why C# is **** for mmorpgs, I personally think only languages where you can control over when memory is allocated and disposed of are languages suitable for games.
It only gets rid of it when the block is finished so you'd be accessing it from another area which should never happen anyway.
 
Hmm i dont know about those things yet, but will i need them to write my server?
 
Hmm i dont know about those things yet, but will i need them to write my server?

I lol'd here.

If you cant do packets, there's a high chance your server will die.

Packets are how the client and server talk to each other. Since you've already got a server running, you should know about the co encryption. You dont need to worry about it since the server takes care of it for you already. However, you will need to know how the packets work and how they are structured. Most packets are fairly short. The Add Gem into Socket packet is a fairly short one. An example of a long packet is the msg board reply. I started to work on it but....
 
Last edited:
Yea i didnt just copy paste the cryptographer from co c# source, i had to invent something on my own cuz game maker doesnt support bytes. :S
 
Inf just a suggestion you should post which version client these work with... Because the packet structures have changed over time a couple of times for different things I beleive
 
i was looking for a mob packet or some help to do it for the CoFuture release.
i have adapted this below to that version but i cant get mob name or life bar and i get too errors in line 13 and 14.

public byte[] SpawnMob(int ID, int Mech, int mob_x, int mob_y, string Name, int HP, int LVL, int POS)
{
if (HP < 0)
HP = 0;
if (POS < 0)
POS = 0;
byte[] PacketData = new byte[67 + Name.Length];
PacketData[0] = (byte)(PacketData.Length & 0xff);
PacketData[1] = (byte)((PacketData.Length >> 8) & 0xff);
PacketData[2] = 0xf6;
PacketData[3] = 0x03;
PacketData[4] = (byte)(ID & 0xff);//id
PacketData[5] = (byte)((ID >> 8) & 0xff);//id
PacketData[6] = (byte)((ID >> 16) & 0xff);//id
PacketData[7] = (byte)((ID >> 24) & 0xff);//id
PacketData[0x8] = (byte)(Mech & 0xff);//Mech
PacketData[0x9] = (byte)((Mech >> 8) & 0xff);//Mech
PacketData[0xa] = (byte)((Mech >> 16) & 0xff);//Mech
PacketData[0xb] = (byte)((Mech >> 24) & 0xff);//Mech
PacketData[12] = 0x00;
PacketData[13] = 0x00;
PacketData[14] = 0x00;
PacketData[15] = 0x00;
PacketData[16] = 0x00;
PacketData[17] = 0x00;
PacketData[18] = 0x00;
PacketData[19] = 0x00;
PacketData[20] = 0x00;
PacketData[21] = 0x00;
PacketData[22] = 0x00;
PacketData[23] = 0x00;
PacketData[24] = 0x00;
PacketData[25] = 0x00;
PacketData[26] = 0x00;
PacketData[27] = 0x00;
PacketData[28] = 0x00;
PacketData[29] = 0x00;
PacketData[30] = 0x00;
PacketData[31] = 0x00;
PacketData[32] = 0x00;
PacketData[33] = 0x00;
PacketData[34] = 0x00;
PacketData[35] = 0x00;
PacketData[36] = 0x00;
PacketData[37] = 0x00;
PacketData[38] = 0x00;
PacketData[39] = 0x00;
PacketData[40] = 0x00;
PacketData[41] = 0x00;
PacketData[42] = 0x00;
PacketData[43] = 0x00;
PacketData[44] = 0x00;
PacketData[45] = 0x00;
PacketData[46] = 0x00;
PacketData[47] = 0x00;
PacketData[48] = (byte)(HP & 0xff); // Current HP
PacketData[49] = (byte)((HP >> 8) & 0xff);//
PacketData[50] = (byte)(LVL & 0xff); // Level
PacketData[51] = (byte)((LVL >> 8) & 0xff);//
PacketData[52] = (byte)(mob_x & 0xff); // x loc
PacketData[53] = (byte)((mob_x >> 8) & 0xff);//
PacketData[54] = (byte)(mob_y & 0xff); // y loc
PacketData[55] = (byte)((mob_y >> 8) & 0xff);//
PacketData[56] = 0x00;
PacketData[57] = 0x00;
PacketData[58] = (byte)(POS & 0xff); //Position
PacketData[59] = 0x00;
PacketData[60] = 0x00;
PacketData[61] = 0x00;
PacketData[62] = 0x00;
PacketData[63] = 0x00;
PacketData[64] = 0x00;
PacketData[65] = 0x01;
PacketData[66] = (byte)(Name.Length); //Length of the name
for (int x = 0; x < Name.Length; x++)
{
PacketData[67 + x] = Convert.ToByte(Name[x]);
}
return PacketData;
}

it spawns mobs or at least the mech.
 
Back