Beispiel #1
0
        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();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);

            Log.Texte("", "-------------------- Account Cacher  -------------------", ConsoleColor.DarkRed);

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

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

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

            Server = new RpcServer(Config.RpcInfo.RpcClientStartingPort, 1);
            if (!Server.Start(Config.RpcInfo.RpcIp, Config.RpcInfo.RpcPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            AcctMgr = Server.GetLocalObject <AccountMgr>();
            AcctMgr.LoadRealms();

            ConsoleMgr.Start();
        }
Beispiel #3
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();
        }
Beispiel #4
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-File", ConsoleColor.Cyan);
            Log.Texte("", "http://AllPrivateServer.com", ConsoleColor.DarkCyan);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

            Assembly.Load("Common");

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

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

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

            Server = new RpcServer(Config.RpcInfo.RpcClientStartingPort, 0);
            if (!Server.Start(Config.RpcInfo.RpcIp, Config.RpcInfo.RpcPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Log.Success("FileServer", "Server loaded.");
            ConsoleMgr.Start();
        }
Beispiel #5
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();
        }
Beispiel #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("", "| (\\ (      | |   | (         | |   | (      | |   | || |   | |", 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();
        }
Beispiel #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("", "/_/    \\_\\_|    |_____/ 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();
        }
Beispiel #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 <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();
        }
Beispiel #9
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();
        }
Beispiel #10
0
        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();
        }
Beispiel #11
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();
        }
Beispiel #12
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(onError);

            Log.Texte("", "-------------------- Account Cacher -------------------", 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 <AccountConfigs>();

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

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

            Server = new RpcServer(Config.RpcInfo.RpcClientStartingPort, 1);
            if (!Server.Start(Config.RpcInfo.RpcIp, Config.RpcInfo.RpcPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            AcctMgr = Server.GetLocalObject <AccountMgr>();
            AcctMgr.LoadRealms();

            ConsoleMgr.Start();
        }
Beispiel #13
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();
        }
Beispiel #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 <AccountConfigs>();

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

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

            Server = new RpcServer(Config.RpcInfo.RpcClientStartingPort, 1);
            if (!Server.Start(Config.RpcInfo.RpcIp, Config.RpcInfo.RpcPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            AcctMgr = Server.GetLocalObject <AccountMgr>();
            AcctMgr.LoadRealms();

            ConsoleMgr.Start();
        }
Beispiel #15
0
        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();
        }
Beispiel #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-Char", ConsoleColor.Cyan);
            Log.Texte("", "http://AllPrivateServer.com", ConsoleColor.DarkCyan);
            Log.Texte("", "-------------------------------", ConsoleColor.DarkBlue);

            Assembly.Load("Common");

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

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

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

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

            Server = new RpcServer(Config.RpcInfo.RpcClientStartingPort, 0);
            if (!Server.Start(Config.RpcInfo.RpcIp, Config.RpcInfo.RpcPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            Log.Success("CharacterServer", "Server loaded.");
            ConsoleMgr.Start();
        }
Beispiel #17
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();
        }
Beispiel #18
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();
        }
        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();
        }
Beispiel #20
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();
        }
Beispiel #21
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 <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();
        }
Beispiel #22
0
        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();
        }
Beispiel #23
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 <ExtractorConfig>();

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

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

            PacketProcessor.RegisterDefinitions();

            int Count = 0;

            foreach (string FileDir in Directory.EnumerateFiles(Config.CacheFolder))
            {
                Log.Success("Extractor", "Opening Cache : " + FileDir);

                FileStream Str = File.Open(FileDir, FileMode.Open);

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

                PacketInStream      Pack   = new PacketInStream(Buff, Buff.Length);
                ISerializablePacket Packet = PacketProcessor.ReadPacket(ref Pack);


                if (Packet != null && Packet is CacheUpdate)
                {
                    CacheUpdate Cache = Packet as CacheUpdate;

                    CacheTemplate Template = Cache.CacheDatas.Find(info => info.Opcode == (long)Opcodes.CacheTemplate) as CacheTemplate;
                    CacheData     Data     = Cache.CacheDatas.Find(info => info.Opcode == (long)Opcodes.CacheData) as CacheData;

                    if (Template != null)
                    {
                        Template.CacheID   = Cache.CacheID;
                        Template.CacheType = Cache.CacheType;
                        WorldDB.AddObject(Template);
                    }

                    if (Data != null)
                    {
                        Data.CacheID   = Cache.CacheID;
                        Data.CacheType = Cache.CacheType;
                        WorldDB.AddObject(Data);
                    }
                    ++Count;
                }

                Str.Dispose();
            }

            Log.Success("Extractor", "" + Count + " Caches extracted");

            ConsoleMgr.Start();
        }
Beispiel #24
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();
        }
Beispiel #25
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 <RealmConfig>();
            Config.RealmInfo.GenerateName();

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

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

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

            PacketProcessor.RegisterDefinitions();

            // Starting Remote Client
            Client = new RpcClient("Realm-" + Config.RealmInfo.RealmId, Config.RpcCharacter.RpcLocalIp, 1);
            if (!Client.Start(Config.RpcCharacter.RpcServerIp, Config.RpcCharacter.RpcServerPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }


            Server = new RpcServer(Config.RpcMapServer.RpcClientStartingPort, 2);
            if (!Server.Start(Config.RpcMapServer.RpcIp, Config.RpcMapServer.RpcPort))
            {
                ConsoleMgr.WaitAndExit(2000);
            }

            World      = Client.GetLocalObject <WorldMgr>();
            Accounts   = Client.GetServerObject <AccountMgr>();
            Characters = Client.GetLocalObject <CharactersMgr>();

            // 1 : Loading WorldMgr
            World.Load();

            // 2 : Loading CharactersMgr
            CharactersMgr.Client          = Client;
            CharactersMgr.MyRealm         = Config.RealmInfo;
            CharactersMgr.MyRealm.RpcInfo = Client.Info;
            Characters.Load();

            // 3 : Loading AccountsMgr
            Accounts.RegisterRealm(Config.RealmInfo, Client.Info);

            ConsoleMgr.Start();
        }