Example #1
0
        /// <summary>
        /// Shut down the master server instance
        /// </summary>
        private void Shutdown()
        {
            // End listen thread and close the listen sockets
            EndListening();

            // Web server
            if (webServer != null)
            {
                webServer.Dispose();
                webServer = null;
            }

            // Shut down the server list
            if (serverList != null)
            {
                serverList.Shutdown();
                serverList = null;
            }

            // Ban manager
            if (banManager != null)
            {
                banManager.Dispose();
                banManager = null;
            }

            // MD5 database
            if (md5Manager != null)
            {
                md5Manager.Dispose();
                md5Manager = null;
            }

            // GeoIP resolver
            if (geoIP != null)
            {
                geoIP.Dispose();
                geoIP = null;
            }

            // Display update timer
            if (displayTimer != null)
            {
                displayTimer.Change(Timeout.Infinite, Timeout.Infinite);
                displayTimer.Dispose();
                displayTimer = null;
            }

            // Shut down the status display if we have one
            if (statusDisplay != null)
            {
                statusDisplay.Notify("EXIT");
                ModuleManager.ReleaseModule <IStatusDisplay>();
                statusDisplay = null;
            }

            // Shut down the command interface if we have one
            if (commandInterface != null)
            {
                commandInterface.OnChange -= new EventHandler(DisplayCommandInterface);
                ModuleManager.ReleaseModule <ICommandInterface>();
                commandInterface = null;
            }
        }