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.IsValid still true after calling Lobby.Leave() #252

Open
MagnusMakesGames opened this issue May 5, 2024 · 2 comments
Open

Lobby.IsValid still true after calling Lobby.Leave() #252

MagnusMakesGames opened this issue May 5, 2024 · 2 comments

Comments

@MagnusMakesGames
Copy link

Hello, I am having an issue with Lobby.Leave() in my game, when calling it, Lobby.IsValid is still true, and I can't join any other lobbies. Here is my Disconnect function:

public void Disconnect(bool returnToMenu = false)
{
Debug.Log("Disconnecting from lobby");

    if(NetworkManager.Singleton != null)
        NetworkManager.Singleton.Shutdown();

    if(currentLobby.HasValue)
    {
        currentLobby.Value.Leave();
        //currentLobby = null;
    }

    if(returnToMenu)
        SceneManager.LoadScene("MainMenu");
}

I have been trying to fix this issue for over a week now, if anyone knows of a solution please let me know!

@MagnusMakesGames
Copy link
Author

I found a workaround, Replacing the NetworkManager, Facepunch Transport and my lobby script with a new one when the player returns to the lobby after calling the disconnect function seems to fix the problem.

@MagnusMakesGames
Copy link
Author

Nevermind, after testing this with my friend, it seems to just crash my game when i try to join someone.

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