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(); }
public bool AddRealm(Realm Rm) { lock (_Realms) { if (_Realms.ContainsKey(Rm.RealmId)) return false; Log.Info("AddRealm", "New Realm : " + Rm.Name); _Realms.Add(Rm.RealmId, Rm); } return true; }
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(); }
public bool RegisterRealm(Realm Rm,RpcClientInfo Info) { Log.Debug("AccountMgr", "Realm Registering : " + Rm.Name); if (Rm == null) return false; Rm.GenerateName(); Realm Already = GetRealm(Rm.RealmId); if (Already == null) { Already = AccountDB.SelectObject<Realm>("RealmId=" + Rm.RealmId); if (Already == null) AccountDB.AddObject(Rm); } if (Already != null) { Rm.ObjectId = Already.ObjectId; Realms.Remove(Already); } Rm.RpcInfo = Info; Rm.Dirty = true; AccountDB.SaveObject(Rm); Realms.Add(Rm); if (Info != null) { Log.Success("AccountMgr", "Realm Online : " + Rm.Name); } else Log.Success("AccountMgr", "Realm loaded : " + Rm.Name); return true; }
public bool AddRealm(Realm Rm) { lock (_Realms) { if (_Realms.ContainsKey(Rm.RealmId)) return false; Log.Info("AddRealm", "Ajout du royaume : " + Rm.Name); _Realms.Add(Rm.RealmId, Rm); _CharRealms.Add(Rm.RealmId, new RealmCharacters(Rm.RealmId)); } return true; }
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(); }
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(); }