Hello There, I've a little problem that's driving me to crazy. but first let me explain it.
TL;DR
Auth & Game servers and also some shared libs like `Networking` and `Core`.
I'm relaying on Asynchronous I/O in Rust using [Only registered and activated users can see links. Click Here To Register...] which is very fast and easy.
so far so good i got the client to communicate with Auth server
and got the client also connected to the Game server
the problem is that once the client sends MsgAction Packet with ActionType = 74 (SendLocation), and the server responds with location
the Primary command (uint32) is the player map id and the subtypes
(uint16) player x and the other (uint16) is the player y
and i also sends the server timestamp @ offset 4
once the client got that packet it starts to send other action types which i didn't implement it yet, i just respond with the same packet.
then after some seconds the Client Crashes (closed unexpectedly ^1).
-----
Here is the interesting part, if i started the Spirited's servers (auth & game) logging in the game got the character opened, everything is OK.
Closing Spirited's server without closing the client, clicking ok on the disconnection msgbox and then starting my own auth and game servers
connecting to it from the same client, it opens well and i logged in successfully :pogchamp:
the problem occurs only in a freshly opened client, which makes me like WHAAAAT!! :notsureif: !
some point of view:
i think the client is caching something, maybe some keys or what ever.
Here is a Packet Dump from my servers
Auth Server
Game Server
I'm ready to provide any code that could help to reproduce this issue.
Thank you.
TL;DR
I started my project and implemented the basic stuff like Networking and encryption stuff, also the project structure is roughly looks like CometQuote:
For about year, i was learning and working with [Only registered and activated users can see links. Click Here To Register...] which i'm very very happy working with it day by day, with that has been said, i came a cross of idea of what about creating a CO Server in it to sharpen my skills in rust and in networking in general, so i searched for a basic source as a reference to me, i found
@Spirited 's [Only registered and activated users can see links. Click Here To Register...]Source
which IMO is very good start and well documented. also i got ConquerWiki also helped me a lot
Auth & Game servers and also some shared libs like `Networking` and `Core`.
I'm relaying on Asynchronous I/O in Rust using [Only registered and activated users can see links. Click Here To Register...] which is very fast and easy.
so far so good i got the client to communicate with Auth server
and got the client also connected to the Game server
the problem is that once the client sends MsgAction Packet with ActionType = 74 (SendLocation), and the server responds with location
the Primary command (uint32) is the player map id and the subtypes
(uint16) player x and the other (uint16) is the player y
and i also sends the server timestamp @ offset 4
once the client got that packet it starts to send other action types which i didn't implement it yet, i just respond with the same packet.
then after some seconds the Client Crashes (closed unexpectedly ^1).
-----
Here is the interesting part, if i started the Spirited's servers (auth & game) logging in the game got the character opened, everything is OK.
Closing Spirited's server without closing the client, clicking ok on the disconnection msgbox and then starting my own auth and game servers
connecting to it from the same client, it opens well and i logged in successfully :pogchamp:
the problem occurs only in a freshly opened client, which makes me like WHAAAAT!! :notsureif: !
some point of view:
i think the client is caching something, maybe some keys or what ever.
Here is a Packet Dump from my servers
Auth Server
Code:
Starting Auth Server
Server running on 0.0.0.0:9958
Client -> Server (MsgAccount) Length: 52 (0x34) bytes
0000: 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1...............
0010: 1c fd 41 c9 a1 69 aa b6 0d a6 08 4d f3 67 eb 73 ..A..i.....M.g.s
0020: 5a 65 75 73 00 00 00 00 00 00 00 00 00 00 00 00 Zeus............
MsgAccount { username: "1", password: "1", realm: "Zeus", rejection_code: 2 }
Server -> Client (MsgConnectEx) Length: 32 (0x20) bytes
0000: 41 42 0f 00 e5 44 47 46 31 39 32 2e 31 36 38 2e AB...DGF192.168.
0010: 31 2e 33 00 00 00 00 00 b8 16 00 00 1.3.........
Client -> Server (MsgConnect) Length: 28 (0x1c) bytes
0000: 41 42 0f 00 0a 00 00 00 72 65 73 2e 64 61 74 00 AB......res.dat.
0010: 00 00 00 00 00 00 00 00 ........
Code:
Starting Game Server
Server running on 0.0.0.0:5816
Client -> Server (MsgConnect) Length: 28 (0x1c) bytes
0000: 41 42 0f 00 e5 44 47 46 7b 00 45 6e 00 00 00 00 AB...DGF{.En....
0010: 00 00 00 00 0a 00 00 00 ........
MsgConnect { character_id: 1000001, authentication_code: 1179075813, build_version: 123, language: "En", file_contents: 10 }
Server -> Client (MsgTalk) Length: 52 (0x34) bytes
0000: ff ff ff 00 34 08 00 00 00 00 00 00 00 00 00 00 ....4...........
0010: 00 00 00 00 04 06 53 59 53 54 45 4d 08 41 4c 4c ......SYSTEM.ALL
0020: 55 53 45 52 53 00 09 41 4e 53 57 45 52 5f 4f 4b USERS..ANSWER_OK
Server -> Client (MsgUserInfo) Length: 79 (0x4f) bytes
0000: 41 42 0f 00 fb 2a 00 00 17 02 e8 03 00 00 00 00 AB...*..........
0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
0020: 00 00 00 00 00 00 00 00 00 00 04 00 06 00 0c 00 ................
0030: 00 00 00 00 3e 01 00 00 00 00 01 0a 00 00 01 02 ....>...........
0040: 05 53 68 61 64 79 04 4e 6f 6e 65 .Shady.None
Client -> Server (MsgAction) Length: 24 (0x18) bytes
0000: a0 2c 1d 04 41 42 0f 00 00 00 00 00 00 00 00 00 .,..AB..........
0010: 00 00 4a 00 ..J.
MsgAction { client_timestamp: 69020843, character_id: 1000001, param0: 1001, param1: 430, param2: 380, param3: 0, action_type: 74 }
Server -> Client (MsgAction) Length: 24 (0x18) bytes
0000: ab 2c 1d 04 41 42 0f 00 e9 03 00 00 ae 01 7c 01 .,..AB........|.
0010: 00 00 4a 00 ..J.
Client -> Server (MsgAction) Length: 24 (0x18) bytes
0000: 02 2e 1d 04 41 42 0f 00 00 00 00 00 00 00 00 00 ....AB..........
0010: 00 00 72 00 ..r.
Missing Action Type Unknown(114)
MsgAction { client_timestamp: 69021186, character_id: 1000001, param0: 0, param1: 0, param2: 0, param3: 0, action_type: 114 }
Client -> Server (MsgAction) Length: 24 (0x18) bytes
0000: 02 2e 1d 04 41 42 0f 00 00 00 00 00 00 00 00 00 ....AB..........
0010: 00 00 4b 00 ..K.
Missing Action Type SetInventory
MsgAction { client_timestamp: 69021186, character_id: 1000001, param0: 0, param1: 0, param2: 0, param3: 0, action_type: 75 }
Server -> Client (MsgTalk) Length: 75 (0x4b) bytes
0000: ff ff ff 00 d0 07 00 00 41 42 0f 00 00 00 00 00 ........AB......
0010: 00 00 00 00 04 06 53 59 53 54 45 4d 08 41 4c 4c ......SYSTEM.ALL
0020: 55 53 45 52 53 00 20 4d 69 73 73 69 6e 67 20 41 USERS. Missing A
0030: 63 74 69 6f 6e 20 54 79 70 65 20 55 6e 6b 6e 6f ction Type Unkno
0040: 77 6e 28 31 31 34 29 wn(114)
Server -> Client (MsgAction) Length: 24 (0x18) bytes
0000: 02 2e 1d 04 41 42 0f 00 00 00 00 00 00 00 00 00 ....AB..........
0010: 00 00 72 00 ..r.
Server -> Client (MsgTalk) Length: 75 (0x4b) bytes
0000: ff ff ff 00 d0 07 00 00 41 42 0f 00 00 00 00 00 ........AB......
0010: 00 00 00 00 04 06 53 59 53 54 45 4d 08 41 4c 4c ......SYSTEM.ALL
0020: 55 53 45 52 53 00 20 4d 69 73 73 69 6e 67 20 41 USERS. Missing A
0030: 63 74 69 6f 6e 20 54 79 70 65 20 53 65 74 49 6e ction Type SetIn
0040: 76 65 6e 74 6f 72 79 ventory
Server -> Client (MsgAction) Length: 24 (0x18) bytes
0000: 02 2e 1d 04 41 42 0f 00 00 00 00 00 00 00 00 00 ....AB..........
0010: 00 00 4b 00 ..K.
Client -> Server (MsgAction) Length: 24 (0x18) bytes
0000: 60 2e 1d 04 41 42 0f 00 00 00 00 00 00 00 00 00 `...AB..........
0010: 00 00 4c 00 ..L.
Missing Action Type SetAssociates
MsgAction { client_timestamp: 69021280, character_id: 1000001, param0: 0, param1: 0, param2: 0, param3: 0, action_type: 76 }
Server -> Client (MsgTalk) Length: 76 (0x4c) bytes
0000: ff ff ff 00 d0 07 00 00 41 42 0f 00 00 00 00 00 ........AB......
0010: 00 00 00 00 04 06 53 59 53 54 45 4d 08 41 4c 4c ......SYSTEM.ALL
0020: 55 53 45 52 53 00 21 4d 69 73 73 69 6e 67 20 41 USERS.!Missing A
0030: 63 74 69 6f 6e 20 54 79 70 65 20 53 65 74 41 73 ction Type SetAs
0040: 73 6f 63 69 61 74 65 73 sociates
Server -> Client (MsgAction) Length: 24 (0x18) bytes
0000: 60 2e 1d 04 41 42 0f 00 00 00 00 00 00 00 00 00 `...AB..........
0010: 00 00 4c 00 ..L.
Thank you.
Quote:
^1: After attaching a debugger to the game client, i found that it got access memory violation error, then it aborts.
Quote:
Note about the packet dump: the dumped packet dose not include the header in it, the header is showed in the text above the dump,
and of course the full packet is sent to the client.