On Server Load:
Make sure you're generating IVs (initializing the authenication cipher) on
server start up or before the client needs to use the cipher.
Connect Socket Event:
If you're sending packet 1059 from patch 5187 and up, remove it. The
connect socket event should only initialize the client / socket passport &
authentication cipher (which you can get from Impulse's source or from
CO2_CORE_DLL by CptSky).
Receive Socket Event:
The first packet you'll receive is packet 1051. Packet 1051 contains the
account id (offset 4, length 16), the password (offset 20, length 16), and
the server name (offset 36, length 16). If you're using packet 1086 or 1060,
you'll change it out with this one. It's of length 52.
The password is encrypted using this cipher (
). Sorry that it uses pointers. If you make a non-pointer version, feel free to
post it (the same goes with any other additions you might have to the guide).
Next, you'll need to send the authentication forward / response message. It's
id is the same as it's always been: 1055. The length is 32, Identity @
offset 4, forward token @ 8, ip address @ 12, length 16, and the port is @
offset 28. You don't need to add an extra 16 bytes for the ip address. The
game server rejects the account if it's wrong (NOT the account server), so
you might want to encrypt it or put it into a dictionary if your servers are
dependent on one another.
Game Server
On Server Load:
Make sure you're generating IVs (initializing the authenication cipher) on
server start up or before the client needs to use the cipher.
Connect Socket Event:
Same as usual except you won't be using Blowfish or Cast. The game client
uses the Account Server's cipher (NetDragon's Asymmetric Authentication
Cipher) as well. Initialize the cipher like you did in the account server.
Initialize the client and socket passport as usual.
On Authentication Receive:
You'll receive the first packet (packet 1052) from the client. It contains the
token (offset 8) and account identity (offset 4) that you sent in packet
1055. You'll use those to generate keys for the cipher. After generating keys,
you'll send the ANSWER_OK or NEW_ROLE message like you have been doing
for a long time (take note that the message packet was changed in 5017.
Look at "Tips" below). The character info packet is available on my new wiki
(which STILL isn't finished yet):

If you're having a hard time with packets, my wiki should help you get logged
in:
. I'll try finishing it this week if I have time.
On Data Receive:
So now that you sent the character info packet (1006), you'll start receiving
general actions. The general action packet can be found here:
. You'll start by getting subtype 137 (Retrieve Location). It's pretty easy. X = Character.X, Y
= Character.Y, and the primary action is the character's map id.
Then, you'll receive a few other subtypes: 138 (Retrieve Items), 139
(Retrieve Friends), 150 (Retrieve Spells), 151 (Retrieve Guild Info), 152
(Change / Set PK Mode), and 170 (Retrieve Surroundings). You'll have to
send this packet back to the client each time to successfully log in, and
that's it!
Tips
Jumping: Jumping is controlled by the general data packet (subtype
142). The character's X is the primary action. The character's Y is the
secondary action.
Chat: Client Messages have a new packet (including the message you
send for ANSWER_OK). For the structure, look here:
. TQServer Tag Not Used: You don't have to add an extra 8 bytes to
the end of a packet because the game server doesn't send "TQServer" in
Conquer 1.0. It's just a straight up packet with a packet length like in the
Account Server.
That's it for now. Good luck.
Sincerely,
Spirited Fang






