You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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 :
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).
The text was updated successfully, but these errors were encountered: