Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lobby.Members sending a list of empty Friends on second call #27

Open
Pordrack opened this issue Feb 14, 2022 · 0 comments
Open

lobby.Members sending a list of empty Friends on second call #27

Pordrack opened this issue Feb 14, 2022 · 0 comments

Comments

@Pordrack
Copy link

Pordrack commented Feb 14, 2022

Hello, I use a NonDestructible object to store my lobby, the players in it etc.
When I change scene, I need to "reload" the visual elements in the UI, to do that quickly I decided to just empty my dictionnary and re-call my OnLobbyEnteredFunction with the current lobby as parameter.
It works on first loading, but on the second I just get a list of user with the ID "0" and an empty Username. But the lobby Id is still the same. Here's my code :

private void OnLobbyEntered(Lobby lobby)
 {
     Debug.Log(currentLobby.Id);
     currentLobby = lobby;

     foreach(Friend member in lobby.Members)
     {
         Debug.Log(lobby.Id);
         Debug.Log(member.Id);
         Debug.Log(member.Name);
         //I'm starting to add users
         AddUser(member, new SteamUser(member.Id, member.Name));
     }

     /*if (SteamClient.SteamId != lobby.Owner.Id)
     {
         textDumpster.text += "You joined " + lobby.Owner.Name + "'s lobby !\n'";
     }*/
 }

For test purpose, I removed everything that starts a GameServer and stuff, I just load another scene then reload the original scene (by returning to the orignal scene a duplicate of my GameObject is created, but quickly deleted, although the Facepunch component of this duplicate has the time to return an error about the Steam connection already being open, as Facepunch's awake method is called before my script one's).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant