private void DoUnloadSession() { if (!Sandbox.Engine.Platform.Game.IsDedicated) { MyScreenManager.CloseAllScreensExcept(null); MyGuiSandbox.Update(16); } if (MySession.Static != null) { MySession.Static.Unload(); MySession.Static = null; } { var musicCtl = _getMusicControllerStatic(); if (musicCtl != null) { _musicControllerUnload(musicCtl); _setMusicControllerStatic(null); MyAudio.Static.MusicAllowed = true; } } if (MyMultiplayer.Static != null) { MyMultiplayer.Static.Dispose(); } if (!Sandbox.Engine.Platform.Game.IsDedicated) { MyGuiSandbox.AddScreen(MyGuiSandbox.CreateScreen(MyPerGameSettings.GUI.MainMenu)); } }