static void Main(string[] args) { Log.Info("LobbyServer", "Starting..."); if (!EasyServer.InitLog("Lobby", "Configs/Logs.conf") || !EasyServer.InitConfig("Configs/Lobby.xml", "Lobby") || !EasyServer.InitConfig("Configs/Database.xml", "Database")) { return; } if (!EasyServer.Listen <TcpServer>(EasyServer.GetConfValue <int>("Lobby", "LoginServer", "Port"), "LoginServer")) { return; } worldListener = new World.Listener(EasyServer.GetConfValue <string>("Lobby", "WorldListener", "IP"), EasyServer.GetConfValue <int>("Lobby", "WorldListener", "Port")); Databases.InitDB(); Databases.Load(true); FileMgr = new FileManager(); string sVersion = EasyServer.GetConfValue <string>("Lobby", "LoginServer", "GameVersion"); if (sVersion == "RTW_LAST") { version = GameVersion.RTW_LAST; Log.Info("Version", "Supported game version: 1.4.1.555239 (last RTW patch)"); } else if (sVersion == "G1_LATEST") { version = GameVersion.G1_LATEST; Log.Info("Version", "Supported game version: 1.19.4.775065 (latest G1 patch)"); } else { version = GameVersion.INVALID; Log.Error("Version", "Invalid game version"); } try { HttpServer.MapHandlers(); HttpServer server = new HttpServer(); server.Start(); } catch { Log.Error("HTTP", "If you want to use HTTP stuff, start this server with Admin rights"); } Log.Succes("LobbyServer", "Server initialisation complete!"); clients.Clear(); worlds.Clear(); Timer aTimer = new Timer(10000); aTimer.Elapsed += OnTimedEvent; aTimer.AutoReset = true; aTimer.Enabled = true; Log.Enter(); Console.WriteLine("For available console commands, type /commands"); Log.Enter(); bool done = false; while (!done) { string command; command = Console.ReadLine(); ProccessCommand(command); } EasyServer.StartConsole(); }
private static void OnTimedEvent(object source, ElapsedEventArgs e) { Databases.Load(false); }