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(); } }
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(); }
void MySyncScenario_ClientWorldLoaded() { MySyncScenario.ClientWorldLoaded -= MySyncScenario_ClientWorldLoaded; m_waitingScreen = new MyGuiScreenScenarioWaitForPlayers(); MyGuiSandbox.AddScreen(m_waitingScreen); }