コード例 #1
0
        /// <summary>
        /// Host_Shutdown
        /// </summary>
        public static void Shutdown()
        {
            _ShutdownDepth++;
            try
            {
                if (_ShutdownDepth > 1)
                {
                    return;
                }

                // keep Con_Printf from trying to update the screen
                Scr.IsDisabledForLoading = true;

                WriteConfiguration();

                CDAudio.Shutdown();
                Net.Shutdown();
                Sound.Shutdown();
                Input.Shutdown();

                if (_VcrWriter != null)
                {
                    Con.Print("Closing vcrfile.\n");
                    _VcrWriter.Close();
                    _VcrWriter = null;
                }
                if (_VcrReader != null)
                {
                    Con.Print("Closing vcrfile.\n");
                    _VcrReader.Close();
                    _VcrReader = null;
                }

                if (Client.cls.state != cactive_t.ca_dedicated)
                {
                    Vid.Shutdown();
                }

                Con.Shutdown();
            }
            finally
            {
                _ShutdownDepth--;
            }
        }