Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Listing New Players that Join a Lobby #125

Open
@valkyrienyanko

Description

@valkyrienyanko

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions