Esempio n. 1
0
    public void LeaveHostLobby()
    {
        if (!isNetworkActive)
        {
            Debug.LogWarning("Non-Host Back");
            menuStates.Back();
            return;
        }

        Debug.LogWarning("Attemp Match Destroy");
        NetworkServer.DisconnectAll();

        if (matchMaker != null)
        {
            matchMaker.DestroyMatch(matchInfo.networkId, matchInfo.domain, OnDestroyMatch);
        }

        matchOpen      = false;
        this.matchInfo = null;

        StopCoroutine("PingServer");

        menuStates.LeaveGame();
        lobbyManager.Clear();
        StopMatchMaker();
        StopHost();
    }