Beispiel #1
0
    private IEnumerator DelayedInviteReceived(CoopLobbyInfo lobby)
    {
        lobby.RequestData();
        while (!lobby.Destroyed && (string.IsNullOrEmpty(lobby.Name) || string.IsNullOrEmpty(lobby.Guid) || this._inviteReceivedScreen._screen.activeSelf))
        {
            lobby.UpdateData();
            yield return(null);
        }
        if (lobby.Destroyed)
        {
            this._inviteReceivedScreen._screen.SetActive(false);
            yield break;
        }
        yield return(YieldPresets.WaitPointFiveSeconds);

        lobby.UpdateData();
        Debug.Log(string.Concat(new string[]
        {
            "Received MP invite for lobby name='",
            lobby.Name,
            "', guid='",
            lobby.Guid,
            "'"
        }));
        this._currentInvitelobby = lobby;
        this._inviteReceivedScreen._continueSaveButton.isEnabled = SaveSlotUtils.GetPreviouslyPlayedServers().Contains(lobby.Guid);
        this._inviteReceivedScreen._gameName.text = lobby.Name;
        this.OpenScreen(CoopSteamNGUI.Screens.InviteReceivedScreen);
        yield break;
    }
Beispiel #2
0
 public void OpenScreen(CoopSteamNGUI.Screens screen)
 {
     this.ClearLoadingAndError();
     this._prevScreen = this._currentScreen;
     this._modalScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.ModalScreen && !ForestVR.Enabled);
     this._inviteReceivedScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.InviteReceivedScreen);
     this._lobbySetupScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.LobbySetup);
     this._lobbyScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.Lobby);
     this._gameBrowserScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.GameBrowser);
     if (this._gameBrowserScreenDS._screen)
     {
         this._gameBrowserScreenDS._screen.SetActive(screen == CoopSteamNGUI.Screens.GameBrowserDS);
     }
     this._gameBrowserScreen._sources.SetActive(screen == CoopSteamNGUI.Screens.GameBrowser || screen == CoopSteamNGUI.Screens.GameBrowserDS);
     if (this._joinDsScreen._screen)
     {
         this._joinDsScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.JoinDS);
     }
     if (this._joinP2PScreen._screen)
     {
         this._joinP2PScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.JoinP2P);
     }
     this._currentScreen = screen;
     if (screen == CoopSteamNGUI.Screens.GameBrowser || screen == CoopSteamNGUI.Screens.GameBrowserDS)
     {
         this._previouslyPlayedServers = SaveSlotUtils.GetPreviouslyPlayedServers();
     }
 }
Beispiel #3
0
 private void OpenScreen(CoopSteamNGUI.Screens screen)
 {
     this.ClearLoadingAndError();
     this._prevScreen = this._currentScreen;
     this._modalScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.ModalScreen);
     this._inviteReceivedScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.InviteReceivedScreen);
     this._lobbySetupScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.LobbySetup);
     this._lobbyScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.Lobby);
     this._gameBrowserScreen._screen.SetActive(screen == CoopSteamNGUI.Screens.GameBrowser);
     this._currentScreen = screen;
     if (screen == CoopSteamNGUI.Screens.GameBrowser)
     {
         this._previouslyPlayedServers = SaveSlotUtils.GetPreviouslyPlayedServers();
     }
 }
        private IEnumerator DelayedServerInviteReceived(uint ip, ushort port)
        {
            this.QueryingIp = ip;
            ISteamMatchmakingPingResponse response = new ISteamMatchmakingPingResponse(new ISteamMatchmakingPingResponse.ServerResponded(this.ServerResponded), new ISteamMatchmakingPingResponse.ServerFailedToRespond(this.ServerFailedToRespond1));
            HServerQuery query = SteamMatchmakingServers.PingServer(ip, port, response);

            while (SteamClientDSConfig.Server == null)
            {
                if (string.IsNullOrEmpty(this.invitedToIP))
                {
                    yield break;
                }
                yield return(null);
            }
            yield return(YieldPresets.WaitPointFiveSeconds);

            Debug.Log("Received DS invite for server name='" + SteamClientDSConfig.Server.GetServerName() + "'");
            this._inviteReceivedScreen._continueSaveButton.isEnabled = SaveSlotUtils.GetPreviouslyPlayedServers().Contains(SteamClientDSConfig.Guid);
            this._inviteReceivedScreen._gameName.text = SteamClientDSConfig.Server.GetServerName();
            this._inviteReceivedScreen._screen.SetActive(true);
            this._menu.SetActive(false);
            UICamera.hoveredObject = null;
            yield break;
        }