Ejemplo n.º 1
0
 public void OnClientNewGame(CoopLobbyInfo lobby)
 {
     if (CoopLobby.IsInLobby)
     {
         CoopLobby.LeaveActive();
     }
     TitleScreen.StartGameSetup.Type   = TitleScreen.GameSetup.InitTypes.New;
     TitleScreen.StartGameSetup.MpType = TitleScreen.GameSetup.MpTypes.Client;
     this.RefreshUI();
     if (this._currentScreen == CoopSteamNGUI.Screens.InviteReceivedScreen)
     {
         this._currentScreen = this._prevScreen;
         this.OpenScreen(CoopSteamNGUI.Screens.GameBrowser);
     }
     this.SetLoadingText(string.Format("Joining Lobby {0} ...", lobby.Name));
     lobby.UpdateData();
     CoopLobbyManager.Join(lobby, delegate
     {
         lobby.UpdateData();
         this.ClearLoadingAndError();
     }, delegate
     {
         this.ClearLoadingAndError();
         this.SetErrorText("Could not join Steam lobby.");
     });
 }
Ejemplo n.º 2
0
 public void OnClientNewGame(CoopLobbyInfo lobby)
 {
     if (CoopLobby.IsInLobby)
     {
         CoopLobby.LeaveActive();
     }
     GameSetup.SetInitType(InitTypes.New);
     GameSetup.SetMpType(MpTypes.Client);
     this.RefreshUI();
     if (this._currentScreen == CoopSteamNGUI.Screens.InviteReceivedScreen)
     {
         this._currentScreen = this._prevScreen;
         this.OpenScreen(CoopSteamNGUI.Screens.GameBrowser);
     }
     else if (this._currentScreen == CoopSteamNGUI.Screens.JoinP2P)
     {
         this._currentScreen = this._prevScreen;
         this.OpenScreen(CoopSteamNGUI.Screens.GameBrowser);
     }
     try
     {
         this.SetLoadingText(StringEx.TryFormat(UiTranslationDatabase.TranslateKey("JOINING_LOBBY_0____", "Joining Lobby {0}...", this._allCapsTexts), new object[]
         {
             lobby.Name
         }));
     }
     catch
     {
     }
     lobby.UpdateData();
     CoopLobbyManager.Join(lobby, delegate
     {
         lobby.UpdateData();
         this.ClearLoadingAndError();
     }, new Action <string>(this.OnFailedEnterLobby));
 }