.....
.....
Last edited by Infamous; 11-02-18 at 10:44 PM.
Not bad dude glad to see there is actually not a n00b in this forum. Impressive ^^
.....
Last edited by Infamous; 11-02-18 at 10:44 PM.
What are packets? Where do I add them?
.....
Last edited by Infamous; 11-02-18 at 10:43 PM.
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
.....
Last edited by Infamous; 11-02-18 at 10:42 PM.
.....
Last edited by Infamous; 11-02-18 at 10:42 PM.
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.
.....
Last edited by Infamous; 11-02-18 at 10:41 PM.
Nice, can be usefull :D
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 by Shiro Chan; 02-04-08 at 03:59 AM. Reason: I misspelt chance and change
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
can u post the mobs packet? tks
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
..........you could just go by the date on the post?
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.
/fail dont even try anymore
its a good try xD
You could save some space and... i dunno, remove the Packet[*] = 0x00;
00 in hex is still 0 >.<