コード例 #1
0
        public static void Main(string[] args)
        {
            List<string> commandLine = new List<string>(Environment.GetCommandLineArgs());
            commandLine.RemoveAt(0); // Remove program name

            SSCore.Initialize(commandLine, true);

            Server server = null;
            try
            {
                server = new Server();
                server.Start();

                server.MainLoop();
            }
            catch (Exception e)
            {
                Debug.Log(LogLevel.Fatal, "A runtime exception was caught and was unhandled.");
                Debug.LogException(e);
            }
            finally
            {
                server.Dispose();
            }

            SSCore.Shutdown();
        }
コード例 #2
0
        // Initializes all of the server services
        public Server()
        {
            Debug.BeginBlock("ServerConstructor");
            _theServer = this;

            IsActive = false;

            _lastConsoleUpdate = DateTime.Now;

            // TODO: Eventually load this from a settings file
            TickRate = 20.0f;
            ServerRate = 1000.0f / TickRate;

            // Log timing warning
            if (!HighResTimer.IsHighResolution)
                Debug.LogWarning("Your system does not support high resolution timing. The server may run at a lower TPS than anticipated.");

            Debug.EndBlock();
        }
コード例 #3
0
        private void dispose(bool disposing)
        {
            if (_theServer == null)
                return; // Already disposed

            // TODO: Disposal stuff

            _theServer = null;
        }