Beispiel #1
0
        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();
        }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        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_CB")
            {
                version = GameVersion.RTW_CB;
                Log.Info("Version", "Supported game version: 0.6.0.509927 (RTW closed beta)");
            }
            else if (sVersion == "RTW_DVD")
            {
                version = GameVersion.RTW_DVD;
                Log.Info("Version", "Supported game version: 1.1.0.534979 (RTW DVD release)");
            }
            else 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.766569 (latest G1 patch)");
            }
            else if (sVersion == "G1_ENGUPD")
            {
                version = GameVersion.G1_ENGUPD;
                Log.Info("Version", "Supported game version: 2.0.0.750394 (G1 engine update)");
            }
            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();
        }