예제 #1
0
파일: Program.cs 프로젝트: uvbs/DoR
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);

            Log.Texte("", "-------------------- Lobby Server ---------------------", ConsoleColor.Blue);



            Log.Texte("", "---Dawn of Reckoning project since 2008-2019 BY LEO228---", ConsoleColor.Red);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <LobbyConfigs>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Client = new RpcClient("LobbyServer", Config.RpcInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.RpcInfo.RpcServerIp, Config.RpcInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            if (!TCPManager.Listen <TCPServer>(Config.ClientPort, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("LobbyServer");

            ConsoleMgr.Start();
        }
예제 #2
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);


            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <LobbyConfigs>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Client = new RpcClient("LobbyServer", Config.RpcInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.RpcInfo.RpcServerIp, Config.RpcInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            if (!TCPManager.Listen <TCPServer>(Config.ClientPort, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("LobbyServer");

            ConsoleMgr.Start();
        }
예제 #3
0
        static void Main(string[] args)
        {
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);
            Log.Texte("", ",---.o", ConsoleColor.Cyan);
            Log.Texte("", "`---..,---.,---.,---.,---.", ConsoleColor.Cyan);
            Log.Texte("", "    |||---'|   ||   |,---|", ConsoleColor.Cyan);
            Log.Texte("", "`---'``---'`   '`   '`---^ Core", ConsoleColor.Cyan);
            Log.Texte("", "http://siennacore.com", ConsoleColor.Blue);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);


            // Loading log level from file
            if (!Log.InitLog("Configs/Characters.log", "Characters"))
            {
                WaitAndExit();
            }

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <CharacterConfig>();

            // Starting Remoting Server
            if (!RpcServer.InitRpcServer("CharacterServer", Config.RpcKey, Config.RpcPort))
            {
                WaitAndExit();
            }

            // Creating Remote objects
            new AccountMgr();
            AccountMgr.AccountDB = DBManager.Start(Config.AccountsDB.Total(), ConnectionType.DATABASE_MYSQL, "Accounts");
            if (AccountMgr.AccountDB == null)
            {
                WaitAndExit();
            }

            new CharacterMgr();
            CharacterMgr.CharacterDB = DBManager.Start(Config.CharactersDB.Total(), ConnectionType.DATABASE_MYSQL, "Characters");
            if (CharacterMgr.CharacterDB == null)
            {
                WaitAndExit();
            }

            new CacheMgr();
            CacheMgr.CharacterDB = DBManager.Start(Config.CharactersDB.Total(), ConnectionType.DATABASE_MYSQL, "Characters");
            if (CacheMgr.CharacterDB == null)
            {
                WaitAndExit();
            }

            CharacterMgr.Instance.LoadRealms();
            CharacterMgr.Instance.LoadCreation_Names();

            // Listening Client
            if (!TCPManager.Listen <RiftServer>(Config.CharacterServerPort, "CharacterServer"))
            {
                WaitAndExit();
            }

            ConsoleMgr.Start();
        }
예제 #4
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);
            Console.CancelKeyPress += new ConsoleCancelEventHandler(OnClose);


            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <WorldConfigs>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "WorldServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            CharMgr.Database = DBManager.Start(Config.CharacterDatabase.Total(), ConnectionType.DATABASE_MYSQL, "Characters");
            if (CharMgr.Database == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            WorldMgr.Database = DBManager.Start(Config.WorldDatabase.Total(), ConnectionType.DATABASE_MYSQL, "World");
            if (WorldMgr.Database == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            AbilityMgr.Database = WorldMgr.Database;

            Client = new RpcClient("WorldServer-" + Config.RealmId, Config.AccountCacherInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.AccountCacherInfo.RpcServerIp, Config.AccountCacherInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }


            Rm = Program.AcctMgr.GetRealm(Config.RealmId);

            if (Rm == null)
            {
                Log.Error("WorldServer", "Realm (" + Config.RealmId + ") not found");
                return;
            }

            LoaderMgr.Start();

            if (!TCPManager.Listen <TCPServer>(Rm.Port, "World"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("World");

            AcctMgr.UpdateRealm(Client.Info, Rm.RealmId);

            ConsoleMgr.Start();
        }
예제 #5
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("", "| (\\ (      | |   | (         | |   | (      | |   | || |   | |", ConsoleColor.Cyan);
            Log.Texte("", "| ) \\ \\_____) (___| )         | |   | (____/\\| )   ( || (___) |", ConsoleColor.Cyan);
            Log.Texte("", "|/   \\__/\\_______/|/          )_(   (_______/|/     \\|(_______)", ConsoleColor.Cyan);
            Log.Texte("", "www.Strawberry-Pr0jcts.com", ConsoleColor.DarkCyan);
            Log.Texte("", "---------------------------------------------------------------", ConsoleColor.DarkBlue);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <CharacterConfig>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "Character"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            AccountMgr.AccountDB = DBManager.Start(Config.AccountDB.Total(), ConnectionType.DATABASE_MYSQL, "Accounts");
            if (AccountMgr.AccountDB == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            // Starting Remote Server
            Server = new RpcServer(Config.RpcClientStartingPort, 1);
            if (!Server.Start(Config.RpcIP, Config.RpcPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            // Starting Accounts Manager
            AcctMgr = Server.GetLocalObject <AccountMgr>();
            if (AcctMgr == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            AcctMgr.LoadRealms();

            // Listening Client
            if (!TCPManager.Listen <RiftServer>(Config.CharacterServerPort, "CharacterServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            ConsoleMgr.Start();
        }
예제 #6
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();
        }
예제 #7
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("", "/_/    \\_\\_|    |_____/ Rift", ConsoleColor.Cyan);
            Log.Texte("", "http://AllPrivateServer.com", ConsoleColor.DarkCyan);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <CharacterConfig>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "Character"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            AccountMgr.AccountDB = DBManager.Start(Config.AccountDB.Total(), ConnectionType.DATABASE_MYSQL, "Accounts");
            if (AccountMgr.AccountDB == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            // Starting Remote Server
            Server = new RpcServer(Config.RpcClientStartingPort, 1);
            if (!Server.Start(Config.RpcIP, Config.RpcPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            // Starting Accounts Manager
            AcctMgr = Server.GetLocalObject <AccountMgr>();
            if (AcctMgr == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            AcctMgr.LoadRealms();

            // Listening Client
            if (!TCPManager.Listen <RiftServer>(Config.CharacterServerPort, "CharacterServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            ConsoleMgr.Start();
        }
예제 #8
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("", "/_/    \\_\\_|    |_____/ Rift", ConsoleColor.Cyan);
            Log.Texte("", "http://AllPrivateServer.com", ConsoleColor.DarkCyan);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <MapConfig>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "Map"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }


            FileStream Str = File.Open("player.cache", FileMode.Open);

            BuildPlayer = new byte[Str.Length];
            Str.Read(BuildPlayer, 0, BuildPlayer.Length);

            // Starting Remote Client
            Client = new RpcClient("Map-" + Config.ServerInfo.MapAdress, Config.ClientInfo.RpcLocalIp, 2);
            if (!Client.Start(Config.ClientInfo.RpcServerIp, Config.ClientInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            // Listening Client
            if (!TCPManager.Listen <GameRiftServer>(Config.ServerInfo.MapPort, "CharacterServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            MapMgr.Client          = Client;
            MapMgr.MapInfo         = Config.ServerInfo;
            MapMgr.MapInfo.RpcInfo = Client.Info;
            Rm = Client.GetServerObject <CharactersMgr>().GetRealm();

            Log.Success("Realm", "Connected to : " + Rm.Name);

            World.RegisterMaps(Config.ServerInfo, Client.Info);

            ConsoleMgr.Start();
        }
예제 #9
0
파일: Program.cs 프로젝트: wardev1/WarEmu-1
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);

            Log.Texte("", "------------------- Launcher Server -------------------", ConsoleColor.DarkRed);
            Log.Texte("", " █     █░ ▄▄▄       ██▀███  ▓█████  ███▄ ▄███▓ █    ██ ", ConsoleColor.Red);
            Log.Texte("", "▓█░ █ ░█░▒████▄    ▓██ ▒ ██▒▓█   ▀ ▓██▒▀█▀ ██▒ ██  ▓██▒", ConsoleColor.Red);
            Log.Texte("", "▒█░ █ ░█ ▒██  ▀█▄  ▓██ ░▄█ ▒▒███   ▓██    ▓██░▓██  ▒██░", ConsoleColor.Red);
            Log.Texte("", "░█░ █ ░█ ░██▄▄▄▄██ ▒██▀▀█▄  ▒▓█  ▄ ▒██    ▒██ ▓▓█  ░██░", ConsoleColor.Red);
            Log.Texte("", "░░██▒██▓  ▓█   ▓██▒░██▓ ▒██▒░▒████▒▒██▒   ░██▒▒▒█████▓ ", ConsoleColor.Red);
            Log.Texte("", "░ ▓░▒ ▒   ▒▒   ▓▒█░░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░   ░  ░░▒▓▒ ▒ ▒ ", ConsoleColor.Red);
            Log.Texte("", "  ▒ ░ ░    ▒   ▒▒ ░  ░▒ ░ ▒░ ░ ░  ░░  ░      ░░░▒░ ░ ░ ", ConsoleColor.Red);
            Log.Texte("", "  ░   ░    ░   ▒     ░░   ░    ░   ░      ░    ░░░ ░ ░ ", ConsoleColor.Red);
            Log.Texte("", "    ░          ░  ░   ░        ░  ░       ░      ░    ", ConsoleColor.Red);
            Log.Texte("", "-------------------http://WarEmu.com-------------------", ConsoleColor.DarkRed);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <LauncherConfig>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "LauncherServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Client = new RpcClient("LauncherServer", Config.RpcInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.RpcInfo.RpcServerIp, Config.RpcInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Info = new FileInfo("Configs/mythloginserviceconfig.xml");
            if (!Info.Exists)
            {
                Log.Error("Configs/mythloginserviceconfig.xml", "Config file missing !");
                ConsoleMgr.WaitAndExit(5000);
            }

            StrInfo = Info.OpenText().ReadToEnd();

            if (!TCPManager.Listen <TCPServer>(Config.LauncherServerPort, "LauncherServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("LauncherServer");

            ConsoleMgr.Start();
        }
예제 #10
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);

            Log.Info("", "------------------- Launcher Server -------------------", ConsoleColor.DarkRed);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <LauncherConfig>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "LauncherServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            ServerState previousState = Config.ServerState;

            Config.ServerState = ServerState.PATCH;

            LoaderMgr.Start();
            Client = new RpcClient("LauncherServer", Config.RpcInfo.RpcLocalIp, 1);

            Config.ServerState = previousState;

            if (!Client.Start(Config.RpcInfo.RpcServerIp, Config.RpcInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Info = new FileInfo("Configs/mythloginserviceconfig.xml");
            if (!Info.Exists)
            {
                Log.Error("Configs/mythloginserviceconfig.xml", "Config file missing !");
                ConsoleMgr.WaitAndExit(5000);
            }

            StrInfo = Info.OpenText().ReadToEnd();

            if (!TCPManager.Listen <TCPServer>(Config.LauncherServerPort, "LauncherServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("LauncherServer");

            ConsoleMgr.Start();
        }
예제 #11
0
        static void Main(string[] args)
        {
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);
            Log.Texte("", ",---.o", ConsoleColor.Cyan);
            Log.Texte("", "`---..,---.,---.,---.,---.", ConsoleColor.Cyan);
            Log.Texte("", "    |||---'|   ||   |,---|", ConsoleColor.Cyan);
            Log.Texte("", "`---'``---'`   '`   '`---^ Core", ConsoleColor.Cyan);
            Log.Texte("", "http://siennacore.com", ConsoleColor.Blue);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

            // Loading log level from file
            if (!Log.InitLog("Configs/World.log", "World"))
            {
                WaitAndExit();
            }

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <WorldConfig>();

            // Starting Remoting Server
            if (!RpcClient.InitRpcClient("WorldServer", Config.RpcKey, Config.RpcIp, Config.RpcPort))
            {
                WaitAndExit();
            }

            // Creating Remote objects
            AccountMgr.Instance   = new AccountMgr();
            CharacterMgr.Instance = new CharacterMgr();
            CacheMgr.Instance     = new CacheMgr();

            // Listening Client
            if (!TCPManager.Listen <RiftServer>(Config.WorldServerPort, "WorldServer"))
            {
                WaitAndExit();
            }

            Realm Rm = CharacterMgr.Instance.RegisterRealm(Config.RealmId, Config.WorldServerIP, Config.WorldServerPort, RpcClient.GetRpcClientId("WorldServer"));

            if (Rm == null)
            {
                Log.Error("WorldServer", "Invalid Realm : " + Config.RealmId);
                WaitAndExit();
            }

            ConsoleMgr.Start();
        }
예제 #12
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);

            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("", "/_/    \\_\\_|    |_____/ Warhammer", ConsoleColor.Cyan);
            Log.Texte("", "http://AllPrivateServer.com", ConsoleColor.DarkCyan);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig<LauncherConfig>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "LauncherServer"))
                ConsoleMgr.WaitAndExit(2000);

            Client = new RpcClient("LauncherServer", Config.RpcInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.RpcInfo.RpcServerIp, Config.RpcInfo.RpcServerPort))
                ConsoleMgr.WaitAndExit(2000);

            Info = new FileInfo("Configs/mythloginserviceconfig.xml");
            if (!Info.Exists)
            {
                Log.Error("Configs/mythloginserviceconfig.xml", "Config file missing !");
                ConsoleMgr.WaitAndExit(5000);
            }

            StrInfo = Info.OpenText().ReadToEnd();

            if (!TCPManager.Listen<TCPServer>(Config.LauncherServerPort, "LauncherServer"))
                ConsoleMgr.WaitAndExit(2000);

            Server = TCPManager.GetTcp<TCPServer>("LauncherServer");

            ConsoleMgr.Start();
        }
예제 #13
0
파일: Program.cs 프로젝트: wardev1/WarEmu-1
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);

            Log.Texte("", "-------------------- Lobby Server ---------------------", ConsoleColor.DarkRed);
            Log.Texte("", " █     █░ ▄▄▄       ██▀███  ▓█████  ███▄ ▄███▓ █    ██ ", ConsoleColor.Red);
            Log.Texte("", "▓█░ █ ░█░▒████▄    ▓██ ▒ ██▒▓█   ▀ ▓██▒▀█▀ ██▒ ██  ▓██▒", ConsoleColor.Red);
            Log.Texte("", "▒█░ █ ░█ ▒██  ▀█▄  ▓██ ░▄█ ▒▒███   ▓██    ▓██░▓██  ▒██░", ConsoleColor.Red);
            Log.Texte("", "░█░ █ ░█ ░██▄▄▄▄██ ▒██▀▀█▄  ▒▓█  ▄ ▒██    ▒██ ▓▓█  ░██░", ConsoleColor.Red);
            Log.Texte("", "░░██▒██▓  ▓█   ▓██▒░██▓ ▒██▒░▒████▒▒██▒   ░██▒▒▒█████▓ ", ConsoleColor.Red);
            Log.Texte("", "░ ▓░▒ ▒   ▒▒   ▓▒█░░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░   ░  ░░▒▓▒ ▒ ▒ ", ConsoleColor.Red);
            Log.Texte("", "  ▒ ░ ░    ▒   ▒▒ ░  ░▒ ░ ▒░ ░ ░  ░░  ░      ░░░▒░ ░ ░ ", ConsoleColor.Red);
            Log.Texte("", "  ░   ░    ░   ▒     ░░   ░    ░   ░      ░    ░░░ ░ ░ ", ConsoleColor.Red);
            Log.Texte("", "    ░          ░  ░   ░        ░  ░       ░      ░    ", ConsoleColor.Red);
            Log.Texte("", "-------------------http://WarEmu.com-------------------", ConsoleColor.DarkRed);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <LobbyConfigs>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Client = new RpcClient("LobbyServer", Config.RpcInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.RpcInfo.RpcServerIp, Config.RpcInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            if (!TCPManager.Listen <TCPServer>(Config.ClientPort, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("LobbyServer");

            ConsoleMgr.Start();
        }
예제 #14
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);

            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("", "/_/    \\_\\_|    |_____/ Warhammer", ConsoleColor.Cyan);
            Log.Texte("", "http://AllPrivateServer.com", ConsoleColor.DarkCyan);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <LobbyConfigs>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Client = new RpcClient("LobbyServer", Config.RpcInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.RpcInfo.RpcServerIp, Config.RpcInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            if (!TCPManager.Listen <TCPServer>(Config.ClientPort, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("LobbyServer");

            ConsoleMgr.Start();
        }
예제 #15
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);

            Log.Texte("", "-------------------- Lobby Server ---------------------", ConsoleColor.DarkRed);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <LobbyConfigs>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Client = new RpcClient("LobbyServer", Config.RpcInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.RpcInfo.RpcServerIp, Config.RpcInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            if (!TCPManager.Listen <TCPServer>(Config.ClientPort, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("LobbyServer");



            Log.Debug($"LobbyServer", $"RpcClient on Local Ip {Config.RpcInfo.RpcLocalIp}");
            Log.Debug($"LobbyServer", $"RpcClient Connect (Start) to {Config.RpcInfo.RpcServerIp}:{ Config.RpcInfo.RpcServerPort}");
            Log.Debug($"LobbyServer", $"TcpServer on Port {Config.ClientPort}");

            ConsoleMgr.Start();
        }
예제 #16
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-Lobby", ConsoleColor.Cyan);
            Log.Texte("", "http://AllPrivateServer.com", ConsoleColor.DarkCyan);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

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

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

            if (!Log.InitLog(Config.LogLevel, "LobbyServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            FileServerClient = new RpcClient("LobbyServer-File", Config.FileServerRpc.RpcLocalIp, 1);
            if (!FileServerClient.Start(Config.FileServerRpc.RpcServerIp, Config.FileServerRpc.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

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

            if (!TCPManager.Listen <TcpServer>(Config.ClientServerPort, "Lobby"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

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

            DBAccount Acct = CharMgr.GetAccount(1);

            string[] sVersion = Config.ClientVersion.Split('.');
            Build = Config.ClientBuild;

            Version = new byte[sVersion.Length];

            for (int i = 0; i < Version.Length; ++i)
            {
                Version[i] = byte.Parse(sVersion[i]);
            }

            Log.Info("LobbyServer", "Version = " + Version[0] + "." + Version[1] + "." + Version[2] + " : Build = " + Build);


            Log.Success("LobbyServer", "Server loaded.");

            ConsoleMgr.Start();
        }
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);
            Console.CancelKeyPress += new ConsoleCancelEventHandler(OnClose);

            Log.Texte("", "-------------------- World Server ---------------------", ConsoleColor.DarkRed);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <WorldConfigs>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "WorldServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

#if DEBUG
            API.Server api = null;
            if (Config.EnableAPI)
            {
                try
                {
                    api = new API.Server(Config.APIAddress, Config.APIPort, 100);
                }
                catch (Exception e)
                {
                    Log.Error("API", "Unable to start API server: " + e.Message);
                }
            }
#endif

            CharMgr.Database = DBManager.Start(Config.CharacterDatabase.Total(), Config.CharacterDatabase.ConnectionType, "Characters", Config.CharacterDatabase.Database);
            if (CharMgr.Database == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }
            else if (!Config.PreloadAllCharacters)
            {
                CharMgr.Database.RegisterAction(CharMgr.LoadPendingCharacters);
            }

            _timer = new Timer(AuctionHouse.CheckAuctionExpiry, null, new TimeSpan(0, 12, 0, 0), new TimeSpan(0, 24, 0, 0));

            WorldMgr.Database = DBManager.Start(Config.WorldDatabase.Total(), Config.CharacterDatabase.ConnectionType, "World", Config.WorldDatabase.Database);
            if (WorldMgr.Database == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            WorldMgr.StartingPairing = WorldMgr.Database.ExecuteQueryInt("SELECT FLOOR(RAND() * 3) + 1");


            WorldMgr.UpperTierBattlefrontManager = new UpperTierBattlefrontManager();
            WorldMgr.UpperTierBattlefrontManager.SetInitialPairActive();
            Log.Texte("Creating Upper Tier Battlefront Manager", WorldMgr.UpperTierBattlefrontManager.GetActivePairing().PairingName, ConsoleColor.Cyan);

            WorldMgr.LowerTierBattlefrontManager = new LowerTierBattlefrontManager();
            WorldMgr.LowerTierBattlefrontManager.SetInitialPairActive();
            Log.Texte("Creating Lower Tier Battlefront Manager", WorldMgr.LowerTierBattlefrontManager.GetActivePairing().PairingName, ConsoleColor.Cyan);


            Log.Texte("StartingPairing: ", WorldMgr.StartingPairing.ToString(), ConsoleColor.Cyan);

            Client = new RpcClient("WorldServer-" + Config.RealmId, Config.AccountCacherInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.AccountCacherInfo.RpcServerIp, Config.AccountCacherInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Rm = AcctMgr.GetRealm(Config.RealmId);

            if (Rm == null)
            {
                Log.Error("WorldServer", "Realm (" + Config.RealmId + ") not found");
                return;
            }

            LoaderMgr.Start();

            if (!TCPManager.Listen <TCPServer>(Rm.Port, "World"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("World");

            AcctMgr.UpdateRealm(Client.Info, Rm.RealmId);
            AcctMgr.UpdateRealmCharacters(Rm.RealmId, (uint)CharMgr.Database.GetObjectCount <Character>("Realm=1"), (uint)CharMgr.Database.GetObjectCount <Character>("Realm=2"));

            ConsoleMgr.Start();
        }
예제 #18
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);
            Console.CancelKeyPress += new ConsoleCancelEventHandler(OnClose);

            Log.Info("", "-------------------- World Server ---------------------", ConsoleColor.DarkRed);

            // Default the server to DEV mode.
            if (args.Length == 0)
            {
                WorldMgr.ServerMode = "DEV";
            }
            else
            {
                if (args.Length == 1)
                {
                    if (args[0] == "DEV")
                    {
                        WorldMgr.ServerMode = "DEV";
                    }
                    if (args[0] == "PRD")
                    {
                        WorldMgr.ServerMode = "PRD";
                    }
                }
                else
                {
                    WorldMgr.ServerMode = "DEV";
                }
            }

            Log.Info("", "SERVER running in " + WorldMgr.ServerMode + " mode", ConsoleColor.Cyan);


            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <WorldConfigs>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "WorldServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

#if DEBUG
            API.Server api = null;
            if (Config.EnableAPI)
            {
                try
                {
                    api = new API.Server(Config.APIAddress, Config.APIPort, 100);
                }
                catch (Exception e)
                {
                    Log.Error("API", "Unable to start API server: " + e.Message);
                }
            }
#endif

            CharMgr.Database = DBManager.Start(Config.CharacterDatabase.Total(), Config.CharacterDatabase.ConnectionType, "Characters", Config.CharacterDatabase.Database);
            if (CharMgr.Database == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }
            else if (!Config.PreloadAllCharacters)
            {
                CharMgr.Database.RegisterAction(CharMgr.LoadPendingCharacters);
            }

            _timer = new Timer(AuctionHouse.CheckAuctionExpiry, null, new TimeSpan(0, 12, 0, 0), new TimeSpan(0, 24, 0, 0));

            WorldMgr.Database = DBManager.Start(Config.WorldDatabase.Total(), Config.CharacterDatabase.ConnectionType, "World", Config.WorldDatabase.Database);
            if (WorldMgr.Database == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            WorldMgr.StartingPairing = WorldMgr.Database.ExecuteQueryInt("SELECT FLOOR(RAND() * 3) + 1");

            // Ensure directory structure is correct
            if (!Directory.Exists("Zones"))
            {
                Log.Error("Directory Check", "Zones directory does not exist");
                ConsoleMgr.WaitAndExit(2000);
            }
            if (!Directory.Exists("Scripts"))
            {
                Log.Error("Directory Check", "Scripts directory does not exist");
                ConsoleMgr.WaitAndExit(2000);
            }
            if (!Directory.Exists("World"))
            {
                Log.Error("Directory Check", "World directory does not exist");
                ConsoleMgr.WaitAndExit(2000);
            }
            if (!Directory.Exists("Abilities"))
            {
                Log.Error("Directory Check", "Abilities directory does not exist");
                ConsoleMgr.WaitAndExit(2000);
            }



            Client = new RpcClient("WorldServer-" + Config.RealmId, Config.AccountCacherInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.AccountCacherInfo.RpcServerIp, Config.AccountCacherInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Rm = AcctMgr.GetRealm(Config.RealmId);

            if (Rm == null)
            {
                Log.Error("WorldServer", "Realm (" + Config.RealmId + ") not found");
                return;
            }

            LoaderMgr.Start();
            // Clean up rvr_metrics
            Log.Info("Battlefront Manager", "Clearing rvr_metrics", ConsoleColor.Cyan);
            WorldMgr.Database.ExecuteNonQuery("DELETE FROM rvr_metrics WHERE TIMESTAMP NOT BETWEEN DATE_SUB(UTC_TIMESTAMP(), INTERVAL 60 DAY) AND UTC_TIMESTAMP()");

            Log.Info("Battlefront Manager", "Creating Upper Tier Campaign Manager", ConsoleColor.Cyan);
            if (RVRProgressionService._RVRProgressions.Count == 0)
            {
                Log.Error("RVR Progression", "NO RVR Progressions in DB");
                return;
            }
            WorldMgr.UpperTierCampaignManager = new UpperTierCampaignManager(RVRProgressionService._RVRProgressions.Where(x => x.Tier == 4).ToList(), WorldMgr._Regions);
            Log.Info("Battlefront Manager", "Creating Lower Tier Campaign Manager", ConsoleColor.Cyan);
            WorldMgr.LowerTierCampaignManager = new LowerTierCampaignManager(RVRProgressionService._RVRProgressions.Where(x => x.Tier == 1).ToList(), WorldMgr._Regions);
            Log.Info("Battlefront Manager", "Getting Progression based upon rvr_progression.LastOpenedZone", ConsoleColor.Cyan);
            WorldMgr.UpperTierCampaignManager.GetActiveBattleFrontFromProgression();
            WorldMgr.LowerTierCampaignManager.GetActiveBattleFrontFromProgression();
            Log.Info("Battlefront Manager", "Attaching Campaigns to Regions", ConsoleColor.Cyan);
            // Attach Battlefronts to regions
            WorldMgr.AttachCampaignsToRegions();

            Log.Info("Battlefront Manager", "Locking Battlefronts", ConsoleColor.Cyan);
            WorldMgr.UpperTierCampaignManager.LockBattleFrontsAllRegions(4);
            WorldMgr.LowerTierCampaignManager.LockBattleFrontsAllRegions(1);

            Log.Info("Battlefront Manager", "Opening Active battlefronts", ConsoleColor.Cyan);
            WorldMgr.UpperTierCampaignManager.OpenActiveBattlefront();
            WorldMgr.LowerTierCampaignManager.OpenActiveBattlefront();

            WorldMgr.UpdateRegionCaptureStatus(WorldMgr.LowerTierCampaignManager, WorldMgr.UpperTierCampaignManager);

            if (!TCPManager.Listen <TCPServer>(Rm.Port, "World"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("World");

            AcctMgr.UpdateRealm(Client.Info, Rm.RealmId);
            AcctMgr.UpdateRealmCharacters(Rm.RealmId, (uint)CharMgr.Database.GetObjectCount <Character>("Realm=1"), (uint)CharMgr.Database.GetObjectCount <Character>("Realm=2"));

            ConsoleMgr.Start();
        }
예제 #19
0
파일: Program.cs 프로젝트: harpernz/RiftEMU
        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("", "| (\ (      | |   | (         | |   | (      | |   | || |   | |", ConsoleColor.Cyan);
            Log.Texte("", "| ) \ \_____) (___| )         | |   | (____/\| )   ( || (___) |", ConsoleColor.Cyan);
            Log.Texte("", "|/   \__/\_______/|/          )_(   (_______/|/     \|(_______)", ConsoleColor.Cyan);
            Log.Texte("", "www.Strawberry-Pr0jcts.com", ConsoleColor.DarkCyan);
            Log.Texte("", "---------------------------------------------------------------", ConsoleColor.DarkBlue);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <MapConfig>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "Map"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }


            FileStream Str = File.Open("player.cache", FileMode.Open);

            BuildPlayer = new byte[Str.Length];
            Str.Read(BuildPlayer, 0, BuildPlayer.Length);

            /*// Listening Client
             * if (!TCPManager.Listen<RiftServer>(Config.ServerInfo.MapPort, "CharacterServer"))
             *  ConsoleMgr.WaitAndExit(2000);
             *
             * PacketInStream Entity = new PacketInStream(BuildPlayer,BuildPlayer.Length);
             * WorldEntityUpdate Update = PacketProcessor.ReadPacket(ref Entity) as WorldEntityUpdate;
             * Log.Info("Entity", "GUID = " + Update.GUID + " List Lengh = " + Update.Field1.Count);
             * Console.ReadKey();
             * Environment.Exit(0);*/

            // Starting Remote Client
            Client = new RpcClient("Map-" + Config.ServerInfo.MapAdress, Config.ClientInfo.RpcLocalIp, 2);
            if (!Client.Start(Config.ClientInfo.RpcServerIp, Config.ClientInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            // Listening Client
            if (!TCPManager.Listen <RiftServer>(Config.ServerInfo.MapPort, "CharacterServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            MapMgr.Client          = Client;
            MapMgr.MapInfo         = Config.ServerInfo;
            MapMgr.MapInfo.RpcInfo = Client.Info;
            Rm = Client.GetServerObject <CharactersMgr>().GetRealm();

            Log.Success("Realm", "Connected to : " + Rm.Name);

            World.RegisterMaps(Config.ServerInfo, Client.Info);

            ConsoleMgr.Start();
        }
예제 #20
0
        static void Main(string[] args)
        {
            Log.Texte("", "[CTRL + C] To shutdown the server.", ConsoleColor.Cyan);
            Log.Texte("", "-------------------------------", ConsoleColor.Cyan);
            Log.Texte("", ",---.o", ConsoleColor.Cyan);
            Log.Texte("", "`---..,---.,---.,---.,---.", ConsoleColor.Cyan);
            Log.Texte("", "    |||---'|   ||   |,---|", ConsoleColor.Cyan);
            Log.Texte("", "`---'``---'`   '`   '`---^ Core", ConsoleColor.Cyan);
            Log.Texte("", "http://twitter.com/ChameleonGeek", ConsoleColor.Cyan);
            Log.Texte("", "-------------------------------", ConsoleColor.Cyan);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <CharacterConfig>();

            // Loading log level from file
            if (!Log.InitLog("Configs/Characters.log", Config.LogInfo.LogsDir, Config.LogInfo.LogFile))
            {
                WaitAndExit(Config.ShutDownTimer);
            }

            // Starting Remoting Server
            if (!RpcServer.InitRpcServer("CharacterServer", Config.RpcKey, Config.RpcPort))
            {
                WaitAndExit(Config.ShutDownTimer);
            }

            // Creating Remote objects
            new AccountMgr();
            AccountMgr.AccountDB = DBManager.Start(Config.AccountsDB.Total(), ConnectionType.DATABASE_MYSQL, "Accounts");
            if (AccountMgr.AccountDB == null)
            {
                WaitAndExit(Config.ShutDownTimer);
            }

            new CharacterMgr();
            CharacterMgr.CharacterDB = DBManager.Start(Config.CharactersDB.Total(), ConnectionType.DATABASE_MYSQL, "Characters");
            if (CharacterMgr.CharacterDB == null)
            {
                WaitAndExit(Config.ShutDownTimer);
            }

            new CacheMgr();
            CacheMgr.CharacterDB = DBManager.Start(Config.CharactersDB.Total(), ConnectionType.DATABASE_MYSQL, "Characters");
            if (CacheMgr.CharacterDB == null)
            {
                WaitAndExit(Config.ShutDownTimer);
            }

            CharacterMgr.Instance.LoadRealms();
            CharacterMgr.Instance.LoadCreation_Names();

            // Listening Client
            if (!TCPManager.Listen <RiftServer>(Config.CharacterServerPort, "CharacterServer"))
            {
                WaitAndExit(Config.ShutDownTimer);
            }

            System.Console.CancelKeyPress += new ConsoleCancelEventHandler(ShutdownEvent);


            ConsoleMgr.Start();
        }
예제 #21
0
파일: Program.cs 프로젝트: wardev1/WarEmu-1
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);
            Console.CancelKeyPress += new ConsoleCancelEventHandler(OnClose);

            Log.Texte("", "-------------------- World Server ---------------------", ConsoleColor.DarkRed);
            Log.Texte("", " █     █░ ▄▄▄       ██▀███  ▓█████  ███▄ ▄███▓ █    ██ ", ConsoleColor.Red);
            Log.Texte("", "▓█░ █ ░█░▒████▄    ▓██ ▒ ██▒▓█   ▀ ▓██▒▀█▀ ██▒ ██  ▓██▒", ConsoleColor.Red);
            Log.Texte("", "▒█░ █ ░█ ▒██  ▀█▄  ▓██ ░▄█ ▒▒███   ▓██    ▓██░▓██  ▒██░", ConsoleColor.Red);
            Log.Texte("", "░█░ █ ░█ ░██▄▄▄▄██ ▒██▀▀█▄  ▒▓█  ▄ ▒██    ▒██ ▓▓█  ░██░", ConsoleColor.Red);
            Log.Texte("", "░░██▒██▓  ▓█   ▓██▒░██▓ ▒██▒░▒████▒▒██▒   ░██▒▒▒█████▓ ", ConsoleColor.Red);
            Log.Texte("", "░ ▓░▒ ▒   ▒▒   ▓▒█░░ ▒▓ ░▒▓░░░ ▒░ ░░ ▒░   ░  ░░▒▓▒ ▒ ▒ ", ConsoleColor.Red);
            Log.Texte("", "  ▒ ░ ░    ▒   ▒▒ ░  ░▒ ░ ▒░ ░ ░  ░░  ░      ░░░▒░ ░ ░ ", ConsoleColor.Red);
            Log.Texte("", "  ░   ░    ░   ▒     ░░   ░    ░   ░      ░    ░░░ ░ ░ ", ConsoleColor.Red);
            Log.Texte("", "    ░          ░  ░   ░        ░  ░       ░      ░    ", ConsoleColor.Red);
            Log.Texte("", "-------------------http://WarEmu.com-------------------", ConsoleColor.DarkRed);

            // Loading all configs files
            ConfigMgr.LoadConfigs();
            Config = ConfigMgr.GetConfig <WorldConfigs>();

            // Loading log level from file
            if (!Log.InitLog(Config.LogLevel, "WorldServer"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            CharMgr.Database = DBManager.Start(Config.CharacterDatabase.Total(), ConnectionType.DATABASE_MYSQL, "Characters");
            if (CharMgr.Database == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            WorldMgr.Database = DBManager.Start(Config.WorldDatabase.Total(), ConnectionType.DATABASE_MYSQL, "World");
            if (WorldMgr.Database == null)
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            AbilityMgr.Database = WorldMgr.Database;

            Client = new RpcClient("WorldServer-" + Config.RealmId, Config.AccountCacherInfo.RpcLocalIp, 1);
            if (!Client.Start(Config.AccountCacherInfo.RpcServerIp, Config.AccountCacherInfo.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }


            Rm = Program.AcctMgr.GetRealm(Config.RealmId);

            if (Rm == null)
            {
                Log.Error("WorldServer", "Realm (" + Config.RealmId + ") not found");
                return;
            }

            LoaderMgr.Start();

            if (!TCPManager.Listen <TCPServer>(Rm.Port, "World"))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Server = TCPManager.GetTcp <TCPServer>("World");

            AcctMgr.UpdateRealm(Client.Info, Rm.RealmId);
            AcctMgr.UpdateRealmCharacters(Rm.RealmId, (uint)CharMgr.Database.GetObjectCount <Character>("Realm=1"), (uint)CharMgr.Database.GetObjectCount <Character>("Realm=2"));

            ConsoleMgr.Start();
        }