LeagueSandbox / GameServer

League Sandbox's Game Server
GNU Affero General Public License v3.0
1.07k stars 432 forks source link

ClientID is referred as PlayerID in some packets #1009

Open danil179 opened 4 years ago

danil179 commented 4 years ago

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

KonH commented 4 years ago

@danil179 Can you please provide any docs referring to the expected format? It is not obvious where I can obtain it.

danil179 commented 4 years ago

@KonH You should find the packet fields in LeaguePackets project

KonH commented 4 years ago

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.

danil179 commented 4 years ago

@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).

KonH commented 4 years ago

Thanks for the clarification!