Beispiel #1
0
        /// <summary>
        /// Host_Shutdown
        /// </summary>
        public override void Dispose( )
        {
            IsDisposing = true;

            _ShutdownDepth++;
            try
            {
                if (_ShutdownDepth > 1)
                {
                    return;
                }

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

                WriteConfiguration( );

                CDAudio.Shutdown( );
                Network.Shutdown( );
                Sound.Shutdown( );
                MainWindow.Input.Shutdown( );

                if (VcrWriter != null)
                {
                    Console.Print("Closing vcrfile.\n");
                    VcrWriter.Close( );
                    VcrWriter = null;
                }
                if (VcrReader != null)
                {
                    Console.Print("Closing vcrfile.\n");
                    VcrReader.Close( );
                    VcrReader = null;
                }

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

                Console.Shutdown( );

                base.Dispose( );
            }
            finally
            {
                _ShutdownDepth--;

                // Hack to close process property
                // Environment.Exit( 0 );
            }
        }
Beispiel #2
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--;
            }
        }