Open danil179 opened 4 years ago
@danil179 Can you please provide any docs referring to the expected format? It is not obvious where I can obtain it.
@KonH You should find the packet fields in LeaguePackets project
Oh, I see, thanks. It was a bit confusing. I made proposed changes, can you please review it? Also, that approach with separated entries with expected same layout looks fragile, do you considering other variants? I don't know about your specifics, of course.
@KonH
The workflow for response (server->client) should be variables -> LeaguePackets wrapper -> raw packet data
.
The workflow for request should be raw packet data ->LeaguePackets wrapper -> Core wrapper -> Lib request handler
.
See https://github.com/LeagueSandbox/GameServer/wiki/4.11-How-to-add-packets
Currently, not all packets were defined using LeaguePackets (which is the newer system) and so there is the PacketDefinitions
part (which is incorrect many times). There is a seperate issue to map all the packets to the newer system.
The reason for the double wrapping of variables is that LeaguePackets is used as a sort of a warehouse or definitions, and shouldn't being sent around the code (it is possible, but it will not be highly modular as it is now).
Thanks for the clarification!
For example here: https://github.com/LeagueSandbox/GameServer/blob/7699bce7bd41dfb1d9400d651b5cb8a5a149fd9d/PacketDefinitions420/PacketDefinitions/C2S/ChatMessage.cs
and here Position should be ClientID: https://github.com/LeagueSandbox/GameServer/blob/ef86b75fe55a386f28b620eedbd7c82ea162ca97/GameServerCore/Packets/PacketDefinitions/Requests/PingLoadInfoRequest.cs