Ok , wheen i try ro login in client i recive: unknow packet header: 167
My question is , that header 167 dont exist in client and in server.
Soo why this error?
It's possible to be an problem in typedef struct of packets?
You haven't posted any code, just a bunch of definitions, so who knows what's going on.
The one thing you can do is ensure the right messages are being sent on the wire. You have the record definitions, so you must know what the serialised layout will look like.
Use a network sniffer to record the communication between the server and client.
Confirm the correct message is being sent from the client to the server. If it isn't, debug the client code to find out why.
Confirm the correct reply message is being sent from the server to the client. If it isn't debug the server code to find out why.
If all is well so far, debug the client code that handles the reply.
You need to isolate the traffic you are interested in. So to begin with, you need to know the network interface on the computer running Wireshark, the IP addresses to the server and client.
So make sure you're tracing the correct network interface.
Then set up a filter. Let's say the server is 108.160.162.104 and the client is 192.0.78.22. A Wireshark filter that isolates this traffic is:
You can then further filter by the relevant ports if known.
You'll need to learn a little on Wireshark filters and you'll eventually come up with a filter that isolates the traffic you're interested in. Only then can you start getting useful information from all that noise.