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);
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(1000);
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();
}