static void Main(string[] args) { Log.Info("WorldServer", "Starting..."); if (!EasyServer.InitLog("World", "Configs/Logs.conf") || !EasyServer.InitConfig("Configs/World.xml", "World") || !EasyServer.InitConfig("Configs/Database.xml", "Database")) { return; } Port = EasyServer.GetConfValue <int>("World", "WorldServer", "Port"); IP1 = EasyServer.GetConfValue <byte>("World", "WorldServer", "IP1"); IP2 = EasyServer.GetConfValue <byte>("World", "WorldServer", "IP2"); IP3 = EasyServer.GetConfValue <byte>("World", "WorldServer", "IP3"); IP4 = EasyServer.GetConfValue <byte>("World", "WorldServer", "IP4"); if (!EasyServer.Listen <TcpServer>(Port, "WorldInfo")) { return; } Databases.InitDB(); Databases.Load(false); FileMgr = new FileManager(); Password = EasyServer.GetConfValue <string>("World", "LobbyCommunication", "Password"); WorldName = EasyServer.GetConfValue <string>("World", "WorldInfo", "Name"); ID = EasyServer.GetConfValue <byte>("World", "WorldInfo", "Id"); Lobby = new Client(EasyServer.GetConfValue <string>("World", "LobbyCommunication", "Ip"), EasyServer.GetConfValue <int>("World", "LobbyCommunication", "Port")); districtsListener = new Listener(EasyServer.GetConfValue <string>("World", "DistrictListener", "Ip"), EasyServer.GetConfValue <int>("World", "DistrictListener", "Port")); clients.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); }