Exemplo n.º 1
0
    private void OnDisable()
    {
        Steamworks.SteamMatchmaking.OnLobbyCreated -= OnLobbyCreated;
        Steamworks.SteamMatchmaking.OnLobbyEntered -= OnLobbyEntered;

        myLobby.SetPrivate();
        myLobby.SetInvisible();
        myLobby.Leave();
    }
    private void OnApplicationQuit()
    {
        if (server != null)
        {
            server.Disconnect(true);
        }

        if (lobby.Id > 0)
        {
            lobby.Leave();
        }
    }
Exemplo n.º 3
0
    public void CancelGame(bool loadMenu = true)
    {
        BMSLog.Log("Cancelling game start and reloading main menu");
        UnsubscribeP2PClientEvents();
        UnsubscribeP2PServerEvents();
        lobby.Leave();
        lobby = default;
        if (haveNetworkManager)
        {
            BMSLog.Log("Calling networkManager.Disconnect()");
            networkManager.Disconnect();
            haveNetworkManager = false;
        }

        if (loadMenu)
        {
            LevelManager.LoadMainMenu();
        }
    }