Esempio n. 1
0
 private void SetStatePlayingAsServer()
 {
     this._warmupComponent        = (MultiplayerWarmupComponent)null;
     this.CurrentMultiplayerState = MissionLobbyComponent.MultiplayerGameState.Playing;
     this._timerComponent.StartTimerAsServer((float)(MultiplayerOptions.OptionType.MapTimeLimit.GetIntValue() * 60));
     GameNetwork.BeginBroadcastModuleEvent();
     GameNetwork.WriteMessage((GameNetworkMessage) new MissionStateChange(this.CurrentMultiplayerState, this._timerComponent.GetCurrentTimerStartTime().NumberOfTicks));
     GameNetwork.EndBroadcastModuleEvent(GameNetwork.EventBroadcastFlags.None);
 }
Esempio n. 2
0
 public override void AfterStart()
 {
     this.Mission.MakeDeploymentPlan();
     this._missionScoreboardComponent = this.Mission.GetMissionBehaviour <MissionScoreboardComponent>();
     this._gameMode        = this.Mission.GetMissionBehaviour <MissionMultiplayerGameModeBase>();
     this._timerComponent  = this.Mission.GetMissionBehaviour <MultiplayerTimerComponent>();
     this._roundComponent  = this.Mission.GetMissionBehaviour <IRoundComponent>();
     this._warmupComponent = this.Mission.GetMissionBehaviour <MultiplayerWarmupComponent>();
 }
 public override void OnBehaviourInitialize()
 {
     base.OnBehaviourInitialize();
     this.MissionLobbyComponent  = this.Mission.GetMissionBehaviour <MissionLobbyComponent>();
     this.GameModeBaseClient     = this.Mission.GetMissionBehaviour <MissionMultiplayerGameModeBaseClient>();
     this.NotificationsComponent = this.Mission.GetMissionBehaviour <MultiplayerGameNotificationsComponent>();
     this.RoundController        = this.Mission.GetMissionBehaviour <MultiplayerRoundController>();
     this.WarmupComponent        = this.Mission.GetMissionBehaviour <MultiplayerWarmupComponent>();
     this.TimerComponent         = this.Mission.GetMissionBehaviour <MultiplayerTimerComponent>();
     this.SpawnComponent         = Mission.Current.GetMissionBehaviour <SpawnComponent>();
     this._lastPerkTickTime      = Mission.Current.Time;
 }
Esempio n. 4
0
 private void HandleServerEventMissionStateChange(MissionStateChange message)
 {
     this.CurrentMultiplayerState = message.CurrentState;
     if (this.CurrentMultiplayerState != MissionLobbyComponent.MultiplayerGameState.WaitingFirstPlayers)
     {
         if (this.CurrentMultiplayerState == MissionLobbyComponent.MultiplayerGameState.Playing && this._warmupComponent != null)
         {
             this.Mission.RemoveMissionBehaviour((MissionBehaviour)this._warmupComponent);
             this._warmupComponent = (MultiplayerWarmupComponent)null;
         }
         float duration = this.CurrentMultiplayerState == MissionLobbyComponent.MultiplayerGameState.Playing ? (float)(MultiplayerOptions.OptionType.MapTimeLimit.GetIntValue() * 60) : 5f;
         this._timerComponent.StartTimerAsClient(message.StateStartTimeInSeconds, duration);
     }
     if (this.CurrentMultiplayerState != MissionLobbyComponent.MultiplayerGameState.Ending)
     {
         return;
     }
     this.SetStateEndingAsClient();
 }