Hey guys, fairly new to the TP forums, but I'm a long time OT member and have been apart of TDS for over 3 years, and I've been poking around with programming a client so I thought I would give back since I couldn't find this information anywhere.
In my adventures, I've found and will list the exact packet breakdown for each type as I get them. I know the main game packets have a sticky somewhere, but I have yet to have anyone show exactly all the pieces of the LOGIN packets. So here you go.
Structure is listed by # of bytes, and a description of those bytes
Tibia 8.7 Login Packet (Sent from Client, first packet sent)
Code:
2 Packet Size
4 Adler Check sum
-- Creating Adler Check sum starts here
1 (Listed as 0x1 in some places, OTServ discards it) Packet Type
2 Operating System (0x2 is windows)
2 Client Version
4 Data File Version/Check sum
4 Spr File Version/Check sum
4 Pic File Version/Check sum
-- RSA Encryption Starts Here
1 0x0 (Empty Byte)
16 XTEA Key (4 unsigned ints)
2 Length of Username
x Username
2 Length of Password
x Password
47 Hardware Information (Can be all 0x0 for OTServ from what I know)
Tibia 8.7 Character List Packet (First Response from Server if Login Packet succeeds)
Code:
2 Packet Length (not including self)
4 Adler Checksum
--XTEA Encryption Starts here
2 XTEA Encryption Length
1 0x14 - Command - MOTD
2 Length of MOTD
x MOTD Num, ends with '\n'
x MOTD String (Length is motd Length - Length of motd NUM)
1 0x64 - Command - Character List
1 Num of chars
-- This Section repeats for each Character
2 Length of char name
x Char name
2 Length of world name
x World Name
4 IP of server that character is on
2 Port of server that character is on
-- End repeat of chars
2 # of premium days on account
0-7 Filler bytes by XTEA Algorithm, "XTEA Encryption Length" does not count these packets