示例#1
0
 private void UpdateLobby()
 {
     if (!CoopLobby.IsInLobby)
     {
         this.OnBack();
         return;
     }
     if (CoopLobby.Instance == null || CoopLobby.Instance.Info == null || CoopLobby.Instance.Info.Destroyed)
     {
         this.SetErrorText(UiTranslationDatabase.TranslateKey("LOBBY_DESTROYED", "Lobby Destroyed", this._allCapsTexts));
         this.OnBack();
         CoopLobby.LeaveActive();
         return;
     }
     if (!CoopLobby.Instance.Info.IsOwner && CoopLobby.Instance.Info.ServerId.IsValid())
     {
         if (!BoltNetwork.isClient && !base.gameObject.GetComponent <CoopSteamClientStarter>())
         {
             base.gameObject.AddComponent <CoopSteamClientStarter>().gui = this;
             if (GameSetup.IsNewGame)
             {
                 PlaneCrashAudioState.Spawn();
             }
             this.SetLoadingText(UiTranslationDatabase.TranslateKey("STARTING_CLIENT___", "Starting Client...", this._allCapsTexts));
         }
     }
     else
     {
         bool  foundHost = false;
         ulong ownerId   = SteamMatchmaking.GetLobbyOwner(CoopLobby.Instance.Info.LobbyId).m_SteamID;
         this._lobbyScreen._playerCountLabel.text = StringEx.TryFormat(UiTranslationDatabase.TranslateKey("PLAYER_CURRENT_OVER_MAX", "PLAYERS: {0} / {1}", this._allCapsTexts), new object[]
         {
             CoopLobby.Instance.MemberCount,
             CoopLobby.Instance.Info.MemberLimit
         });
         this._lobbyScreen._playerListLabel.text = CoopLobby.Instance.AllMembers.Select(delegate(CSteamID x)
         {
             string text = SteamFriends.GetFriendPersonaName(x);
             bool flag   = x.m_SteamID == ownerId;
             if (flag)
             {
                 text     += " (Host)";
                 foundHost = true;
             }
             return(text);
         }).Aggregate((string a, string b) => a + "\n" + b);
         if (!foundHost)
         {
             this.OnBack();
         }
     }
 }
示例#2
0
 public void OnNewGame()
 {
     TitleScreen.StartGameSetup.Type = TitleScreen.GameSetup.InitTypes.New;
     if (TitleScreen.StartGameSetup.Mode == TitleScreen.GameSetup.PlayerModes.SinglePlayer)
     {
         this.BreadCrumbLevel2();
         PlaneCrashAudioState.Spawn();
         LoadSave.ShouldLoad = (TitleScreen.StartGameSetup.Type == TitleScreen.GameSetup.InitTypes.Continue);
         if (!this.MyLoader)
         {
             this.FixMissingLoaderRef();
         }
         this.MyLoader.SetActive(true);
     }
     else
     {
         this.BreadCrumbLevel3Mp();
         Application.LoadLevel(this.CoopScene);
     }
     this.MenuRoot.gameObject.SetActive(false);
 }
示例#3
0
 public void OnNewGame(DifficultyModes difficulty)
 {
     GameSetup.SetDifficulty(difficulty);
     GameSetup.SetInitType(InitTypes.New);
     if (GameSetup.IsSinglePlayer)
     {
         this.BreadCrumbLevel2();
         PlaneCrashAudioState.Spawn();
         LoadSave.ShouldLoad = (GameSetup.Init == InitTypes.Continue);
         if (!this.MyLoader)
         {
             this.FixMissingLoaderRef();
         }
         this.MyLoader.SetActive(true);
     }
     else
     {
         this.BreadCrumbLevel3Mp();
         this.InitMpScreenScenery();
         SceneManager.LoadScene(this.CoopScene, LoadSceneMode.Single);
     }
     this.MenuRoot.gameObject.SetActive(false);
 }