Hello guys,
For those of you who want to make their own cf server you have to know somethings...
First: The CF packets use this architecture:
Code:
0xF1 (size of message : 2 bytes) (header of msg : 2 bytes) 00 (data : size of message) 0xf2
example:
Code:
F1 B4 00 00 01 00 (180 bytes here) F2
so...
F1 - means begin packet
B4 00 is inverted size of the packet so in normal way it is 0x00B4 in decimal: 180... NOTE in these 180 bytes the F1, B4, 00, 00, 01, 00 and F2 bytes are not included so the whole packet has 187 bytes.
2nd and 3td bytes are the B4 00 - size
4th and 5th bytes are 00 01 - the header
6th is 00 - spacer
after that the 180 bytes came...
and the last byte is F2 - end of packet
Second: When you try to login the client send to server you id and pass so the server respond the client a specific packet... this packets holds information if you login is successful or not, your ingame name, and server names... probably other things too i think it can hold ban time but not sure...
Third: Here i will only discuss the place where the packet says if your login was a success or not. So:
in this packet the first byte after the spacer (means that this is the 7th byte from the packet) is holding the login state (success, unsuccess and so on)
so this is the things i got (in left you see value of that byte, in right you see the message the client is showing you):
Code:
0x00 - No message means login successful
0x01 - "Unknown Error Happened Exiting Game"
0x02 - "This account is logged in already. Would you like to log in again ?"
0x03 - "Connection Expired"
0x04 - "Wrong username or password"
0x05 - "failed to connect to server"
0x06 - normal login but after that it asks for new ingame name
0x07 - "You cannot access the test server"
0x08 - "This is not latest version of Cross Fire"
0x09 - time ban ("Your account is banned for X days, Y hours, Z hours")
0x0B - "Your account is permanent blocked"
0x0C - "The service is not available in your region"
Press thanks if you like or use... I logged each value munually. Have fun ! 