Hi
For the past 3(?) days I've been working on a crossfire emulator..
Up to now you can connect past login server, and connect to a Master Server (Alpha Server, Bravo Server, etc), but it has great potential to do much more. Let me go over the aspects of my server. Its coded in C# and the interface is quite easy to work with for those who would like to fork it later on. I'm using my own server structure that I'll explain in a second, because it seemed like it would be the most effecient one to use.
As you can see by the image, the Login Server binds to the main port, which then any master server can connect to the login server. to make sure of the use of multiple master servers, I implemented configuration files, so you can run multiple instances of a single .exe. The same goes for channels, which as you can see, connect the the master server (depending on how you configured your channel). The black market server (Not yet implemented) will be connected to the Login Server (Which also acts as a main server for all the other ones).
Other notes about the source
For database uses, I've decided to simply go with MySQL as it's easiest to use and I have the most experience with.
For networking, I've created my own library using that makes use of the .NET sockets, which are effecient enough for me. As for packet reader, and packet writing, I'm using a library I've used in a different project (a completely different game), but highly modified to be used for crossfire, as some packets are read, and sent differently (Like sending a string).
As some of you might know, crossfire uses .rez files to store most of their maps, and guns, but I havn't started a library for reading those files exactly yet, but I have a rough idea of what I'm going to do (Dump the .rez files into a binary file and read those from each channel server).
Packets
Packets are a tedious process for this project. Most emulators I've worked on use packet structures that are easy to use, but crossfire really differs on this one. To briefly explain what I mean by this I'll quickly run over a single packet used to show the Login Server
As you can see, that packet alone has rougly 6000 bytes. This is huge and in my opinion z8games (or subagames) did a terrible job with their networking. When you are sending a login error for example, you're sending this exact same packet, with a changed byte in the beginning of the packet. Now think about this, you're sending a 6000 byte packet just to send a simple error? Quite annoying.
Continueing on..
I will release my source later on once I get more progress done and have a better understanding of the packet structures. Any questions, feel free to PM me. Also, if you would like to analyse packets, feel free to PM me as well as it is a tedious process.
Yes, my IGN is blurred out because it is the same one that I use in the official crossfire.
I havn't fully decoded this packet yet, as you can see, the part where it shows the amount of players, I know where to edit it but I just havn't got to it yet.
For the past 3(?) days I've been working on a crossfire emulator..
Up to now you can connect past login server, and connect to a Master Server (Alpha Server, Bravo Server, etc), but it has great potential to do much more. Let me go over the aspects of my server. Its coded in C# and the interface is quite easy to work with for those who would like to fork it later on. I'm using my own server structure that I'll explain in a second, because it seemed like it would be the most effecient one to use.
As you can see by the image, the Login Server binds to the main port, which then any master server can connect to the login server. to make sure of the use of multiple master servers, I implemented configuration files, so you can run multiple instances of a single .exe. The same goes for channels, which as you can see, connect the the master server (depending on how you configured your channel). The black market server (Not yet implemented) will be connected to the Login Server (Which also acts as a main server for all the other ones).
Other notes about the source
For database uses, I've decided to simply go with MySQL as it's easiest to use and I have the most experience with.
For networking, I've created my own library using that makes use of the .NET sockets, which are effecient enough for me. As for packet reader, and packet writing, I'm using a library I've used in a different project (a completely different game), but highly modified to be used for crossfire, as some packets are read, and sent differently (Like sending a string).
As some of you might know, crossfire uses .rez files to store most of their maps, and guns, but I havn't started a library for reading those files exactly yet, but I have a rough idea of what I'm going to do (Dump the .rez files into a binary file and read those from each channel server).
Packets
Packets are a tedious process for this project. Most emulators I've worked on use packet structures that are easy to use, but crossfire really differs on this one. To briefly explain what I mean by this I'll quickly run over a single packet used to show the Login Server
Code:
[BYTE, 0xf1] //start of a new packet
[BYTE, header]
[BYTE, packet size]
[Buffer, 6000 bytes] //includes names of servers but 5000 of those bytes are 0
[BYTE, 0xf2] //end of packet
As you can see, that packet alone has rougly 6000 bytes. This is huge and in my opinion z8games (or subagames) did a terrible job with their networking. When you are sending a login error for example, you're sending this exact same packet, with a changed byte in the beginning of the packet. Now think about this, you're sending a 6000 byte packet just to send a simple error? Quite annoying.
Continueing on..
I will release my source later on once I get more progress done and have a better understanding of the packet structures. Any questions, feel free to PM me. Also, if you would like to analyse packets, feel free to PM me as well as it is a tedious process.
Yes, my IGN is blurred out because it is the same one that I use in the official crossfire.
I havn't fully decoded this packet yet, as you can see, the part where it shows the amount of players, I know where to edit it but I just havn't got to it yet.