rafi1212122 / SCHALE.GameServer

😭😭😭
154 stars 58 forks source link

What do the 12 bytes at the beginning of the data packet represent? #1

Closed nijinekoyo closed 1 month ago

nijinekoyo commented 1 month ago

I noticed that the GatewayController.cs#L39 code skipped 12 bytes when reading the data packet. The comment stated that it was CRC + Protocol type conversion + payload length, but I didn’t quite understand what these 12 bytes represented. , could you please tell me their specific functions and construction methods?

rafi1212122 commented 1 month ago
nijinekoyo commented 1 month ago

Well, because I'm trying to implement a third-party client, I want to know more detailed information about these 12 bytes.

  1. Whether the CRC calculates the content before encryption or the content after encryption. If not CRC32, what is the calculation method?
  2. How many bytes is the length of TypeConversion?
  3. Is PayloadLength calculated based on the content before or after encryption?

Thank you very much for your help

rafi1212122 commented 1 month ago
  1. Figure it out yourself by the client, i don't have much time to figure that out so i ignored it.
  2. All three of those are 4 bytes each, that's why it's 12.
  3. The encryption used is symmetrical iirc, but i don't remember if there's a compression method.
nijinekoyo commented 1 month ago

I see Thank you so much