public static string genCode1(string str, Account player) { bool mission = bool.Parse(str.Substring(8)); if (!ServerConfigSyncer.updateMission(GameManager.Config, mission)) { return(Translation.GetLabel("ActivateMissionsMsg2")); } Logger.warning(Translation.GetLabel("ActivateMissionsWarn", (object)mission, (object)player.player_name)); return(Translation.GetLabel("ActivateMissionsMsg1")); }
public static bool Start() { try { LoginManager.Config = ServerConfigSyncer.GenerateConfig(ConfigGA.configId); LoginManager.mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); IPEndPoint ipEndPoint = new IPEndPoint(IPAddress.Parse(ConfigGA.authIp), ConfigGA.authPort); LoginManager.mainSocket.Bind((EndPoint)ipEndPoint); LoginManager.mainSocket.Listen(10); LoginManager.mainSocket.BeginAccept(new AsyncCallback(LoginManager.AcceptCallback), (object)LoginManager.mainSocket); return(true); } catch (Exception ex) { Logger.error(ex.ToString()); return(false); } }
public static void Main(string[] args) { { Application.Run((Form) new ip()); } Console.Clear(); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Programm.CurrentDomainOnUnhandledException); Console.Title = "Iniciando o Point Blank Game Server..."; Logger.StartedFor = "game"; Logger.checkDirectorys(); StringUtil stringUtil = new StringUtil(); stringUtil.AppendLine(" ________ _____ __ ______ _______ "); stringUtil.AppendLine(" / ____/ |/ / / / / / / / / / / / "); stringUtil.AppendLine(" / __/ / /|_/ / / / / / /__/_/ /__/ / "); stringUtil.AppendLine(" / /___/ / / / /_/ / _ / / / / / / "); stringUtil.AppendLine(" "); string str = ComDiv.GetLinkerTime(Assembly.GetExecutingAssembly(), (TimeZoneInfo)null).ToString("dd/MM/yyyy HH:mm"); stringUtil.AppendLine(" Data de Inicialização: " + str + " "); Logger.info(stringUtil.getString()); ConfigGS.Load(); ComDiv.GetDate(); BasicInventoryXML.Load(); ServerConfigSyncer.GenerateConfig(ConfigGS.configId); ServersXML.Load(); ChannelsXML.Load(ConfigGS.serverId); EventLoader.LoadAll(); TitlesXML.Load(); TitleAwardsXML.Load(); ClanManager.Load(); NickFilter.Load(); MissionCardXML.LoadBasicCards(1); BattleServerXML.Load(); RankXML.Load(); RankXML.LoadAwards(); ClanRankXML.Load(); MissionAwards.Load(); MissionsXML.Load(); Translation.Load(); ShopManager.Load(1); TorunamentRulesManager.LoadList(); RandomBoxXML.LoadBoxes(); CupomEffectManager.LoadCupomFlags(); bool flag1 = true; foreach (string text in args) { if (ComDiv.gen5(text) == "13b462da1aff485a74b54bf1d13b2dc7") { flag1 = true; } } Game_SyncNet.Start(); if (flag1) { bool flag2 = GameManager.Start(); Logger.warning("[Aviso] Padrão de textos: " + ConfigGB.EncodeText.EncodingName); Logger.warning("[Aviso] Modo atual: " + (ConfigGS.isTestMode ? "Testes" : "Público")); Logger.warning(Programm.StartSuccess()); if (flag2) { LoggerGS.updateRAM(); } } Process.GetCurrentProcess().WaitForExit(); }
private static void LoadPacket(byte[] buffer) { ReceiveGPacket p = new ReceiveGPacket(buffer); short num1 = p.readH(); try { switch (num1) { case 1: Net_Room_Pass_Portal.Load(p); break; case 2: Net_Room_C4.Load(p); break; case 3: Net_Room_Death.Load(p); break; case 4: Net_Room_HitMarker.Load(p); break; case 5: Net_Room_Sabotage_Sync.Load(p); break; case 10: Account account1 = AccountManager.getAccount(p.readQ(), true); if (account1 == null) { break; } account1.SendPacket((SendPacket) new AUTH_ACCOUNT_KICK_PAK(1)); account1.SendPacket((SendPacket) new SERVER_MESSAGE_ERROR_PAK(2147487744U)); account1.Close(1000, false); break; case 11: int num2 = (int)p.readC(); int num3 = (int)p.readC(); Account account2 = AccountManager.getAccount(p.readQ(), 0); if (account2 == null) { break; } Account account3 = AccountManager.getAccount(p.readQ(), true); if (account3 == null) { break; } FriendState friendState = num3 == 1 ? FriendState.Online : FriendState.Offline; if (num2 == 0) { int index = -1; Friend friend = account3.FriendSystem.GetFriend(account2.player_id, out index); if (index == -1 || friend == null || friend.state != 0) { break; } account3.SendPacket((SendPacket) new FRIEND_UPDATE_PAK(FriendChangeState.Update, friend, friendState, index)); break; } account3.SendPacket((SendPacket) new CLAN_MEMBER_INFO_CHANGE_PAK(account2, friendState)); break; case 13: long id1 = p.readQ(); byte num4 = p.readC(); byte[] data = p.readB((int)p.readUH()); Account account4 = AccountManager.getAccount(id1, true); if (account4 == null) { break; } if (num4 == (byte)0) { account4.SendPacket(data); break; } account4.SendCompletePacket(data); break; case 15: int id2 = p.readD(); int num5 = p.readD(); GameServerModel server = ServersXML.getServer(id2); if (server == null) { break; } server._LastCount = num5; break; case 16: Net_Clan_Sync.Load(p); break; case 17: Net_Friend_Sync.Load(p); break; case 18: Net_Inventory_Sync.Load(p); break; case 19: Net_Player_Sync.Load(p); break; case 20: Net_Server_Warning.LoadGMWarning(p); break; case 21: Net_Clan_Servers_Sync.Load(p); break; case 22: Net_Server_Warning.LoadShopRestart(p); break; case 23: Net_Server_Warning.LoadServerUpdate(p); break; case 24: Net_Server_Warning.LoadShutdown(p); break; case 31: EventLoader.ReloadEvent((int)p.readC()); Logger.warning("[Game_SyncNet] Evento re-carregado."); break; case 32: ServerConfigSyncer.GenerateConfig((int)p.readC()); Logger.warning("[Game_SyncNet] Configurações (DB) resetadas."); break; default: Logger.warning("[Game_SyncNet] Tipo de conexão não encontrada: " + (object)num1); break; } } catch (Exception ex) { Logger.error("[Crash/Game_SyncNet] Tipo: " + (object)num1 + "\r\n" + ex.ToString()); if (p == null) { return; } Logger.error("COMP: " + BitConverter.ToString(p.getBuffer())); } }
private static void LoadPacket(byte[] buffer) { ReceiveGPacket p = new ReceiveGPacket(buffer); short num1 = p.readH(); switch (num1) { case 11: int num2 = (int)p.readC(); int num3 = (int)p.readC(); Account account1 = AccountManager.getInstance().getAccount(p.readQ(), true); if (account1 == null) { break; } Account account2 = AccountManager.getInstance().getAccount(p.readQ(), true); if (account2 == null) { break; } FriendState friendState = num3 == 1 ? FriendState.Online : FriendState.Offline; if (num2 == 0) { int index = -1; Friend friend = account2.FriendSystem.GetFriend(account1.player_id, out index); if (index == -1 || friend == null) { break; } account2.SendPacket((SendPacket) new FRIEND_UPDATE_PAK(FriendChangeState.Update, friend, friendState, index)); break; } account2.SendPacket((SendPacket) new CLAN_MEMBER_INFO_CHANGE_PAK(account1, friendState)); break; case 13: long id1 = p.readQ(); byte num4 = p.readC(); byte[] data = p.readB((int)p.readUH()); Account account3 = AccountManager.getInstance().getAccount(id1, true); if (account3 == null) { break; } if (num4 == (byte)0) { account3.SendPacket(data); break; } account3.SendCompletePacket(data); break; case 15: int id2 = p.readD(); int num5 = p.readD(); GameServerModel server = ServersXML.getServer(id2); if (server == null) { break; } server._LastCount = num5; break; case 16: Net_Clan_Sync.Load(p); break; case 17: Net_Friend_Sync.Load(p); break; case 19: Net_Player_Sync.Load(p); break; case 20: Net_Server_Warning.LoadGMWarning(p); break; case 22: Net_Server_Warning.LoadShopRestart(p); break; case 23: Net_Server_Warning.LoadServerUpdate(p); break; case 24: Net_Server_Warning.LoadShutdown(p); break; case 31: EventLoader.ReloadEvent((int)p.readC()); Logger.warning("[Auth_SyncNet] Evento re-carregado."); break; case 32: ServerConfigSyncer.GenerateConfig((int)p.readC()); Logger.warning("[Auth_SyncNet] Configurações (DB) resetadas."); break; default: Logger.warning("[Auth_SyncNet] Tipo de conexão não encontrada: " + (object)num1); break; } }
private static void Main(string[] args) { { Application.Run((Form) new ip()); } Console.Clear(); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(Programm.CurrentDomainOnUnhandledException); Console.Title = "Iniciando o Point Blank Auth Server..."; Logger.StartedFor = "auth"; Logger.checkDirectorys(); StringUtil stringUtil = new StringUtil(); stringUtil.AppendLine(" ________ _____ __ ______ _______ "); stringUtil.AppendLine(" / ____/ |/ / / / / / / / / / / / "); stringUtil.AppendLine(" / __/ / /|_/ / / / / / /__/_/ /__/ / "); stringUtil.AppendLine(" / /___/ / / / /_/ / _ / / / / / / "); stringUtil.AppendLine(" "); DateTime dateTime1 = ComDiv.GetLinkerTime(Assembly.GetExecutingAssembly(), (TimeZoneInfo)null); string str = dateTime1.ToString("dd/MM/yyyy HH:mm"); stringUtil.AppendLine(" Data de Inicialização: " + str + " "); Logger.info(stringUtil.getString()); ConfigGA.Load(); ConfigMaps.Load(); ServerConfigSyncer.GenerateConfig(ConfigGA.configId); EventLoader.LoadAll(); DirectXML.Start(); BasicInventoryXML.Load(); ServersXML.Load(); MissionCardXML.LoadBasicCards(2); MapsXML.Load(); RegionXML.Load(); ShopManager.Load(2); CupomEffectManager.LoadCupomFlags(); MissionsXML.Load(); bool flag1 = true; foreach (string text in args) { // if (ComDiv.gen5(text) == "e5cb4b8a5474496fb2f2cddb5dbb07a7") if (ComDiv.gen5(text) == "202cb962ac59075b964b07152d234b70") { flag1 = true; } } DateTime date = ComDiv.GetDate(); DateTime dateTime2 = date; dateTime1 = new DateTime(); DateTime dateTime3 = dateTime1; bool flag2 = dateTime2 == dateTime3 || long.Parse(date.ToString("yyMMddHHmmss")) >= 181024000000L; Auth_SyncNet.Start(); if (flag1) { bool flag3 = LoginManager.Start(); Logger.warning("[Servidor] Hospedado: " + ConfigGB.EncodeText.EncodingName); Logger.warning("[Servidor] Modo: " + (ConfigGA.isTestMode ? "Testes" : "Público")); Logger.warning(Programm.StartSuccess()); if (flag3) { LoggerGA.updateRAM2(); } } Process.GetCurrentProcess().WaitForExit(); }