Esempio n. 1
0
        static void Main(string[] args)
        {
            Log.Info("CharacterCacher", "Lancement");

            Assembly.Load("Common");

            if (!EasyServer.InitLog("CharacterCacher", "Configs/CharacterCacher.log"))
                return;

            if (!EasyServer.InitConfig("Configs/CharacterCacher.xml", "CharacterCacher"))
                return;

            if (!EasyServer.InitMysqlDB("Configs/CharacterCacher.db", "Characters"))
                return;

            if (!EasyServer.InitRpcServer("CharacterCacher",
                EasyServer.GetConfValue<string>("CharacterCacher", "CharacterCacher", "Key"),
                EasyServer.GetConfValue<int>("CharacterCacher", "CharacterCacher", "Port")))
                return;

            CharMgr = new CharacterMgr();
            CharacterMgr.Database = EasyServer.GetDatabase("Characters");

            CharMgr.LoadRealms();
            
            EasyServer.StartConsole();
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);
            Log.Texte("", "          _____   _____ ", ConsoleColor.Cyan);
            Log.Texte("", "    /\\   |  __ \\ / ____|", ConsoleColor.Cyan);
            Log.Texte("", "   /  \\  | |__) | (___  ", ConsoleColor.Cyan);
            Log.Texte("", "  / /\\ \\ |  ___/ \\___ \\ ", ConsoleColor.Cyan);
            Log.Texte("", " / ____ \\| |     ____) |", ConsoleColor.Cyan);
            Log.Texte("", "/_/    \\_\\_|    |_____/ APB-World", ConsoleColor.Cyan);
            Log.Texte("", "http://AllPrivateServer.com", ConsoleColor.DarkCyan);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

            Assembly.Load("Common");

            Log.Info("WorldServer", "Starting ...");

            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig<WorldServerConfig>();

            if (!Log.InitLog(Config.LogLevel, "WorldServer"))
                ConsoleMgr.WaitAndExit(2000);

            FileServerClient = new RpcClient("WorldServer-File-"+Config.WorldID, Config.FileServerRpc.RpcLocalIp, 0);
            if (!FileServerClient.Start(Config.FileServerRpc.RpcServerIp, Config.FileServerRpc.RpcServerPort))
                ConsoleMgr.WaitAndExit(2000);

            CharacterServerClient = new RpcClient("WorldServer-Char-" + Config.WorldID, Config.CharacterServerRpc.RpcLocalIp, 0);
            if (!CharacterServerClient.Start(Config.CharacterServerRpc.RpcServerIp, Config.CharacterServerRpc.RpcServerPort))
                ConsoleMgr.WaitAndExit(2000);

            if (!TCPManager.Listen<TcpServer>(Config.WorldServerPort, "World"))
                ConsoleMgr.WaitAndExit(2000);

            CharMgr = CharacterServerClient.GetServerObject<CharacterMgr>();
            FileMgr = FileServerClient.GetServerObject<FileManager>();

            CharMgr.RegisterWorld(CharacterServerClient.Info.RpcID,
                                    Config.WorldID,
                                    Config.WorldName,
                                    Config.WorldServerPort,
                                    Config.WorldServerIp);

            ConsoleMgr.Start();
        }