예제 #1
0
        internal void PrepareForStart()
        {
            Debug.Assert(Sync.IsServer);

            GameState = MyState.WaitingForClients;
            m_startBattlePreparationOnClients = MySession.Static.ElapsedPlayTime;

            var onlineMode = GetOnlineModeFromCurrentLobbyType();
            if (onlineMode != MyOnlineModeEnum.OFFLINE)
            {
                m_waitingScreen = new MyGuiScreenScenarioWaitForPlayers();
                MyGuiSandbox.AddScreen(m_waitingScreen);

                ServerPreparationStartTime = DateTime.UtcNow;
                MyMultiplayer.Static.ScenarioStartTime = ServerPreparationStartTime;
                MySyncScenario.PrepareScenarioFromLobby(ServerPreparationStartTime.Ticks);
            }
            else
            {
                StartScenario();
            }
        }
예제 #2
0
 private void StartScenario()
 {
     if (Sync.IsServer)
     {
         ServerStartGameTime = DateTime.UtcNow;
     }
     if (m_waitingScreen != null)
     {
         MyGuiSandbox.RemoveScreen(m_waitingScreen);
         m_waitingScreen = null;
     }
     GameState = MyState.Running;
     m_startBattleTime = MySession.Static.ElapsedPlayTime;
     if (MySession.Static.LocalHumanPlayer == null || MySession.Static.LocalHumanPlayer.Character == null)
         MyPlayerCollection.RequestLocalRespawn();
 }
예제 #3
0
        void MySyncScenario_ClientWorldLoaded()
        {
            MySyncScenario.ClientWorldLoaded -= MySyncScenario_ClientWorldLoaded;

            m_waitingScreen = new MyGuiScreenScenarioWaitForPlayers();
            MyGuiSandbox.AddScreen(m_waitingScreen);
        }