Skip to content
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

Open
valkyrienyanko opened this issue Jun 28, 2022 · 0 comments
Open

Listing New Players that Join a Lobby #125

valkyrienyanko opened this issue Jun 28, 2022 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@valkyrienyanko
Copy link
Collaborator

valkyrienyanko commented Jun 28, 2022

Issue

Players that join are not listed in the player list top left. The code has simply not been done yet.

Steps to Reproduce

  1. Export the game
  2. Run 2 instances of the game
  3. Host a game
  4. Join the game via direct connect with the other client
  5. Notice nothing is changed top left where all players are listed (current player listed is a placeholder)

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.

@valkyrienyanko valkyrienyanko added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Jun 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant