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(); }
// 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(); }
private void dispose(bool disposing) { if (_theServer == null) return; // Already disposed // TODO: Disposal stuff _theServer = null; }