This repository has been archived by the owner on Sep 15, 2024. It is now read-only.
Listing New Players that Join a Lobby #125
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Issue
Players that join are not listed in the player list top left. The code has simply not been done yet.
Steps to Reproduce
Relevant Code
The code that is executed when client receives new player joined lobby packet.
https://github.com/GodotModules/GodotModulesCSharp/blob/345452216427d388d50fcfcb31925cc31f31c8fc/Scripts/Netcode/Packets/SPacketLobby.cs#L243-L249
Code that should be ran on new player join
https://github.com/GodotModules/GodotModulesCSharp/blob/345452216427d388d50fcfcb31925cc31f31c8fc/Scripts/Scenes/SceneLobby.cs#L38-L43
Using static would be highly convenient to use to access this method but seems like not the right approach and will likely cause problems down the road maybe. Before the scene scripts were accessed through SceneManager somehow. See the
main
branch to see how this was done. (You can actually see what it was like before in the commented out code above)Edit: 4e1f6b2 attempted to add "Bob" player on new player join but for some reason the code was not executed. I'm specifically talking about the following code below. Perhaps only the LobbyInfo packet is being sent and not the LobbyJoin packet.
https://github.com/GodotModules/GodotModulesCSharp/blob/4e1f6b20c99256a5ac2164b463412f64d87f942d/Scripts/Netcode/Packets/SPacketLobby.cs#L243-L246
Logging additional information about incoming packets would help solve this.
Note that some kind of Dictionary<peerId, playerListingInstance> will need to be added as well to keep track of the players to remove them later if one of them leaves the lobby.
The text was updated successfully, but these errors were encountered: