public override void run() { Account player = _client._player; if (player == null || player._match == null) { return; } try { int channelId = serverInfo - ((serverInfo / 10) * 10); Channel ch = ChannelsXML.getChannel(channelId); if (ch != null) { Match match = ch.getMatch(id); if (match != null) { _client.SendPacket(new CLAN_WAR_MATCH_TEAM_INFO_PAK(0, match.clan)); } else { _client.SendPacket(new CLAN_WAR_MATCH_TEAM_INFO_PAK(0x80000000)); } } else { _client.SendPacket(new CLAN_WAR_MATCH_TEAM_INFO_PAK(0x80000000)); } } catch (Exception ex) { SaveLog.fatal(ex.ToString()); Printf.b_danger("[CLAN_WAR_MATCH_TEAM_INFO_REC.run] Erro fatal!"); } }
public override void run() { Account player = this._client._player; if (player == null || player.channelId >= 0) { return; } Channel channel = ChannelsXML.getChannel(this.channelId); if (channel != null) { if (this.ChannelRequirementCheck(player, channel)) { this._client.SendPacket((SendPacket) new BASE_CHANNEL_ENTER_PAK(2147484162U)); } else if (channel._players.Count >= ConfigGS.maxChannelPlayers) { this._client.SendPacket((SendPacket) new BASE_CHANNEL_ENTER_PAK(2147484161U)); } else { player.channelId = this.channelId; this._client.SendPacket((SendPacket) new BASE_CHANNEL_ENTER_PAK(player.channelId, channel._announce)); player._status.updateChannel((byte)player.channelId); player.updateCacheInfo(); } } else { this._client.SendPacket((SendPacket) new BASE_CHANNEL_ENTER_PAK(2147483648U)); } }
public bool RemovePlayer(Account p) { Channel channel = ChannelsXML.getChannel(this.channelId); if (channel == null) { return(false); } this.BaseRemovePlayer(p); if (this.getCountPlayers() == 0) { channel.RemoveMatch(this._matchId); } else { if (p.matchSlot == this._leader) { this.setNewLeader(-1, -1); } using (CLAN_WAR_REGIST_MERCENARY_PAK registMercenaryPak = new CLAN_WAR_REGIST_MERCENARY_PAK(this)) this.SendPacketToPlayers((SendPacket)registMercenaryPak); } p.matchSlot = -1; p._match = (Match)null; return(true); }
public static void Load(ReceiveGPacket p) { int id1 = (int)p.readH(); int id2 = (int)p.readH(); byte num1 = p.readC(); byte num2 = p.readC(); byte num3 = p.readC(); int num4 = (int)p.readH(); if (p.getBuffer().Length > 11) { Logger.warning("[Invalid MARKER: " + BitConverter.ToString(p.getBuffer()) + "]"); } Channel channel = ChannelsXML.getChannel(id2); if (channel == null) { return; } Room room = channel.getRoom(id1); if (room == null || room._state != RoomState.Battle) { return; } Account playerBySlot = room.getPlayerBySlot((int)num1); if (playerBySlot == null) { return; } string message = ""; if (num2 == (byte)10) { message = Translation.GetLabel("LifeRestored", (object)num4); } else { switch (num3) { case 0: message = Translation.GetLabel("HitMarker1", (object)num4); break; case 1: message = Translation.GetLabel("HitMarker2", (object)num4); break; case 2: message = Translation.GetLabel("HitMarker3"); break; case 3: message = Translation.GetLabel("HitMarker4"); break; } } playerBySlot.SendPacket((SendPacket) new LOBBY_CHATTING_PAK(Translation.GetLabel("HitMarkerName"), playerBySlot.getSessionId(), 0, true, message)); }
public bool RemovePlayer(Account p) { Channel ch = ChannelsXML.getChannel(channelId); if (ch == null) { return(false); } BaseRemovePlayer(p); if (getCountPlayers() == 0) { ch.RemoveMatch(_matchId); } else { if (p.matchSlot == _leader) { setNewLeader(-1, -1); } using (CLAN_WAR_REGIST_MERCENARY_PAK packet = new CLAN_WAR_REGIST_MERCENARY_PAK(this)) SendPacketToPlayers(packet); } p.matchSlot = -1; p._match = null; return(true); }
public override void run() { try { Account player = this._client._player; if (player == null) { return; } Match match1 = player._match; Match match2 = ChannelsXML.getChannel(this.serverInfo - this.serverInfo / 10 * 10).getMatch(this.id); if (match1 != null && match2 != null && player.matchSlot == match1._leader) { if (this.type == 1) { if (match1.formação != match2.formação) { this.erro = 2147487890U; } else if (match2.getCountPlayers() != match1.formação || match1.getCountPlayers() != match1.formação) { this.erro = 2147487889U; } else if (match2._state == MatchState.Play || match1._state == MatchState.Play) { this.erro = 2147487888U; } else { match1._state = MatchState.Play; Account leader = match2.getLeader(); if (leader != null && leader._match != null) { leader.SendPacket((SendPacket) new CLAN_WAR_ENEMY_INFO_PAK(match1)); leader.SendPacket((SendPacket) new CLAN_WAR_CREATED_ROOM_PAK(match1)); match2._slots[leader.matchSlot].state = SlotMatchState.Ready; } match2._state = MatchState.Play; } } else { Account leader = match2.getLeader(); if (leader != null && leader._match != null) { leader.SendPacket((SendPacket) new CLAN_WAR_RECUSED_BATTLE_PAK(2147487891U)); } } } else { this.erro = 2147487892U; } this._client.SendPacket((SendPacket) new CLAN_WAR_ACCEPTED_BATTLE_PAK(this.erro)); } catch (Exception ex) { Logger.info("CLAN_WAR_ACCEPT_BATTLE_REC: " + ex.ToString()); } }
public static void Load(ReceiveGPacket p) { int roomId = p.readH(); int channelId = p.readH(); byte killerIdx = p.readC(); byte deathtype = p.readC(); byte hitEnum = p.readC(); int damage = p.readH(); if (p.getBuffer().Length > 11) { Printf.warning("Invalid hitMaker"); SaveLog.warning("[Invalid MARKER: " + BitConverter.ToString(p.getBuffer()) + "]"); return; // teste } Channel ch = ChannelsXML.getChannel(channelId); if (ch == null) { return; } Room room = ch.getRoom(roomId); if (room != null && room._state == RoomState.Battle) { Account player = room.getPlayerBySlot(killerIdx); if (player != null) { string warn = ""; if (deathtype == 10) { warn = Translation.GetLabel("LifeRestored", damage); } else if (hitEnum == 0) { warn = Translation.GetLabel("HitMarker1", damage); } else if (hitEnum == 1) { warn = Translation.GetLabel("HitMarker2", damage); } else if (hitEnum == 2) { warn = Translation.GetLabel("HitMarker3"); } else if (hitEnum == 3) { warn = Translation.GetLabel("HitMarker4"); } player.SendPacket(new LOBBY_CHATTING_PAK(Translation.GetLabel("HitMarkerName"), player.getSessionId(), 0, true, warn)); } } }
public static string SetAllChannelsNotice(string str) { string text = str.Substring(6); if (!ChannelsXML.updateNotice(text)) { return(Translation.GetLabel("ChangeChsAnnounceFail")); } Logger.warning(Translation.GetLabel("ChangeChsAnnounceWarn", (object)text)); return(Translation.GetLabel("ChangeChsAnnounceSucc")); }
public static void Load(ReceiveGPacket p) { int roomId = p.readH(); int channelId = p.readH(); int type = p.readC(); int slotIdx = p.readC(); int areaId = 0; float x = 0, y = 0, z = 0; if (type == 0) { areaId = p.readC(); x = p.readT(); y = p.readT(); z = p.readT(); if (p.getBuffer().Length > 21) { SaveLog.warning("[Invalid BOMB0: " + BitConverter.ToString(p.getBuffer()) + "]"); } } else if (type == 1) { if (p.getBuffer().Length > 8) { SaveLog.warning("[Invalid BOMB1: " + BitConverter.ToString(p.getBuffer()) + "]"); } } Channel ch = ChannelsXML.getChannel(channelId); if (ch == null) { return; } Room room = ch.getRoom(roomId); if (room != null && room.round.Timer == null && room._state == RoomState.Battle) { SLOT slot = room.getSlot(slotIdx); if (slot == null || slot.state != SLOT_STATE.BATTLE) { return; } if (type == 0) { InstallBomb(room,slot,areaId,x,y,z); } else if (type == 1) { UninstallBomb(room,slot); } } }
public override void run() { Account p = _client._player; if (p == null || p.channelId >= 0) { return; } Channel ch = ChannelsXML.getChannel(channelId); if (ch != null) { if (ChannelRequirementCheck(p, ch)) { _client.SendPacket(new BASE_CHANNEL_ENTER_PAK(0x80000202)); } else if (ch._players.Count >= ConfigGS.maxChannelPlayers) { _client.SendPacket(new BASE_CHANNEL_ENTER_PAK(0x80000201)); } else { p.channelId = channelId; _client.SendPacket(new BASE_CHANNEL_ENTER_PAK(p.channelId, ch._announce)); p._status.updateChannel((byte)p.channelId); p.updateCacheInfo(); } } else { _client.SendPacket(new BASE_CHANNEL_ENTER_PAK(0x80000000)); } /* * 0x80000201 STBL_IDX_EP_SERVER_USER_FULL_C * 0x80000202 - De acordo com o ChannelType * 0x80000203 STBL_IDX_EP_SERVER_NOT_SATISFY_MTS * 0x80000204 STR_UI_GOTO_GWARNET_CHANNEL_ERROR * 0x80000205 STR_UI_GOTO_AZERBAIJAN_CHANNEL_ERROR * 0x80000206 STR_POPUP_MOBILE_CERTIFICATION_ERROR * 0x80000207 STR_UI_GOTO_TURKISH_CHANNEL_ERROR * 0x80000208 STR_UI_GOTO_MENA_CHANNEL_ERROR */ }
public override void run() { try { Account player = this._client._player; if (this.type >= 2 || player == null || (player._match != null || player._room != null)) { this._client.SendPacket((SendPacket) new CLAN_WAR_JOIN_TEAM_PAK(2147483648U, (Match)null)); } else { Channel channel = ChannelsXML.getChannel(this.type == 0 ? this.serverInfo - this.serverInfo / 10 * 10 : player.channelId); if (channel != null) { if (player.clanId == 0) { this._client.SendPacket((SendPacket) new CLAN_WAR_JOIN_TEAM_PAK(2147487835U, (Match)null)); } else { Match mt = this.type == 1 ? channel.getMatch(this.matchId, player.clanId) : channel.getMatch(this.matchId); if (mt != null) { this.JoinPlayer(player, mt); } else { this._client.SendPacket((SendPacket) new CLAN_WAR_JOIN_TEAM_PAK(2147483648U, (Match)null)); } } } else { this._client.SendPacket((SendPacket) new CLAN_WAR_JOIN_TEAM_PAK(2147483648U, (Match)null)); } } } catch (Exception ex) { Logger.info(ex.ToString()); } }
public override void run() { try { Account p = _client._player; if (type >= 2 || p == null || p._match != null || p._room != null) { _client.SendPacket(new CLAN_WAR_JOIN_TEAM_PAK(0x80000000)); return; } int channelId = serverInfo - ((serverInfo / 10) * 10); Channel ch = ChannelsXML.getChannel(type == 0 ? channelId : p.channelId); if (ch != null) { if (p.clanId == 0) { _client.SendPacket(new CLAN_WAR_JOIN_TEAM_PAK(0x8000105B)); } else { Match mt = type == 1 ? ch.getMatch(matchId, p.clanId) : ch.getMatch(matchId); if (mt != null) { JoinPlayer(p, mt); } else { _client.SendPacket(new CLAN_WAR_JOIN_TEAM_PAK(0x80000000)); } } } else { _client.SendPacket(new CLAN_WAR_JOIN_TEAM_PAK(0x80000000)); } } catch (Exception ex) { SaveLog.fatal(ex.ToString()); Printf.b_danger("[CLAN_WAR_JOIN_TEAM_REC.run] Erro fatal!"); } }
public static void Load(ReceiveGPacket p) { int id1 = (int)p.readH(); int id2 = (int)p.readH(); int slotIdx = (int)p.readC(); int num = (int)p.readC(); Channel channel = ChannelsXML.getChannel(id2); if (channel == null) { return; } Room room = channel.getRoom(id1); if (room != null && room.round.Timer == null && (room._state == RoomState.Battle && room.room_type == (byte)7)) { SLOT slot = room.getSlot(slotIdx); if (slot != null && slot.state == SLOT_STATE.BATTLE) { ++slot.passSequence; if (slot._team == 0) { room.red_dino += 5; } else { room.blue_dino += 5; } Net_Room_Pass_Portal.CompleteMission(room,slot); using (BATTLE_MISSION_ESCAPE_PAK missionEscapePak = new BATTLE_MISSION_ESCAPE_PAK(room,slot)) { using (BATTLE_DINO_PLACAR_PAK battleDinoPlacarPak = new BATTLE_DINO_PLACAR_PAK(room)) room.SendPacketToPlayers((SendPacket)missionEscapePak,(SendPacket)battleDinoPlacarPak,SLOT_STATE.BATTLE,0); } } } if (p.getBuffer().Length <= 8) { return; } Logger.warning("[Invalid PORTAL: " + BitConverter.ToString(p.getBuffer()) + "]"); }
public static void Load(ReceiveGPacket p) { int roomId = p.readH(); int channelId = p.readH(); int slotId = p.readC(); //player int portalId = p.readC(); //portal Channel ch = ChannelsXML.getChannel(channelId); if (ch == null) { return; } Room room = ch.getRoom(roomId); if (room != null && room.round.Timer == null && room._state == RoomState.Battle && room.room_type == 7) { SLOT slot = room.getSlot(slotId); if (slot != null && slot.state == SLOT_STATE.BATTLE) { ++slot.passSequence; if (slot._team == 0) { room.red_dino += 5; } else { room.blue_dino += 5; } CompleteMission(room,slot); using (BATTLE_MISSION_ESCAPE_PAK packet = new BATTLE_MISSION_ESCAPE_PAK(room,slot)) using (BATTLE_DINO_PLACAR_PAK packet2 = new BATTLE_DINO_PLACAR_PAK(room)) room.SendPacketToPlayers(packet,packet2,SLOT_STATE.BATTLE,0); } } if (p.getBuffer().Length > 8) { SaveLog.warning("[Invalid PORTAL] Slot:" + slotId + " " + BitConverter.ToString(p.getBuffer()) + "]"); Printf.warning("Invalid Portal Slot:" + slotId); } }
public override void run() { try { Account p = _client._player; if (p != null && p._match != null && p.matchSlot == p._match._leader && p._match._state == MatchState.Ready) { int channelId = serverInfo - ((serverInfo / 10) * 10); Match mt = ChannelsXML.getChannel(channelId).getMatch(id); if (mt != null) { Account lider = mt.getLeader(); if (lider != null && lider._connection != null && lider._isOnline) { lider.SendPacket(new CLAN_WAR_MATCH_REQUEST_BATTLE_PAK(p._match, p)); } else { erro = 0x80000000; } } else { erro = 0x80000000; } } else { erro = 0x80000000; } _client.SendPacket(new CLAN_WAR_MATCH_PROPOSE_PAK(erro)); } catch (Exception ex) { SaveLog.fatal(ex.ToString()); Printf.b_danger("[CLAN_WAR_PROPOSE_REC.run] Erro fatal!"); } }
public override void run() { Account player = this._client._player; if (player == null) { return; } if (player._match == null) { return; } try { Channel channel = ChannelsXML.getChannel(this.serverInfo - this.serverInfo / 10 * 10); if (channel != null) { Match match = channel.getMatch(this.id); if (match != null) { this._client.SendPacket((SendPacket) new CLAN_WAR_MATCH_TEAM_INFO_PAK(0U, match.clan)); } else { this._client.SendPacket((SendPacket) new CLAN_WAR_MATCH_TEAM_INFO_PAK(2147483648U)); } } else { this._client.SendPacket((SendPacket) new CLAN_WAR_MATCH_TEAM_INFO_PAK(2147483648U)); } } catch (Exception ex) { Logger.info(ex.ToString()); } }
public override void run() { try { Account player = this._client._player; if (player != null && player._match != null && (player.matchSlot == player._match._leader && player._match._state == MatchState.Ready)) { Match match = ChannelsXML.getChannel(this.serverInfo - this.serverInfo / 10 * 10).getMatch(this.id); if (match != null) { Account leader = match.getLeader(); if (leader != null && leader._connection != null && leader._isOnline) { leader.SendPacket((SendPacket) new CLAN_WAR_MATCH_REQUEST_BATTLE_PAK(player._match, player)); } else { this.erro = 2147483648U; } } else { this.erro = 2147483648U; } } else { this.erro = 2147483648U; } this._client.SendPacket((SendPacket) new CLAN_WAR_MATCH_PROPOSE_PAK(this.erro)); } catch (Exception ex) { Logger.info("CLAN_WAR_PROPOSE_REC: " + ex.ToString()); } }
public static string SetChannelNotice(string str) { int length = str.IndexOf(" "); if (length == -1) { return(Translation.GetLabel("ChangeChAnnounceFail")); } int num = int.Parse(str.Substring(7, length)); if (num < 1) { return(Translation.GetLabel("ChangeChAnnounceFail2")); } int channelId = num - 1; string text = str.Substring(length + 1); if (!ChannelsXML.updateNotice(ConfigGS.serverId, channelId, text)) { return(Translation.GetLabel("ChangeChAnnounceFail")); } Logger.warning(Translation.GetLabel("ChangeChAnnounceWarn", (object)(channelId + 1), (object)(ConfigGS.serverId + 1), (object)text)); return(Translation.GetLabel("ChangeChAnnounceSucc")); }
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(); }
public static void Main(string[] args) { Printf.blue("[Licença de uso]", false); Printf.blue("[+] Esta é uma versão compilada para Project Bloodi!!!", false); Printf.blue("[+] https://github.com/luisfeliperm", false); Printf.info("\n\n\n Iniciando servidor...", false); Thread.Sleep(5000); Console.Clear(); TimeStarted = DateTime.Now; SaveLog.aplication = "game"; Console.Title = "PointBlank - Game"; header(true); // Validações System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly(); FileVersionInfo fileVersion = FileVersionInfo.GetVersionInfo(assembly.Location); if (!Compatible.Check(fileVersion.FileVersion, "game") || !ServerLicense.check() || !ServerPasswd.Compare(args)) { Console.ReadKey(); return; } SaveLog.checkDirectorys(); ConfigGS.Load(); WelcomeXML.Load(); BasicInventoryXML.Load(); ServerConfig.Load(); ServersXML.Load(); ChannelsXML.Load(ConfigGS.serverId); EventLoader.LoadAll(); RankUp.load(); TitlesXML.Load(); TitleAwardsXML.Load(); ClanManager.Load(); NickFilter.Load(); MissionCardXML.LoadBasicCards(1); BattleServerJSON.Load(); RankXML.Load(); RankXML.LoadAwards(); ClanRankXML.Load(); MissionAwards.Load(); MissionsXML.Load(); Translation.Load(); ShopManager.Load(1); ClassicModeManager.LoadList(); RandomBoxXML.LoadBoxes(); CupomEffectManager.LoadCupomFlags(); Game_SyncNet.Start(); bool started = GameManager.Start(); if (started) { cpuMonitor.updateRAM(); } header(false); while (true) { Console.ForegroundColor = ConsoleColor.Red; Console.Write("[SHELL]# "); Console.ForegroundColor = ConsoleColor.White; String input = Console.ReadLine(); if (string.IsNullOrEmpty(input)) { continue; } Comandos.checkCmd(input); } //Process.GetCurrentProcess().WaitForExit(); }
public static void Load(ReceiveGPacket p) { int id1 = (int)p.readH(); int id2 = (int)p.readH(); byte num1 = p.readC(); ushort num2 = p.readUH(); ushort num3 = p.readUH(); int num4 = (int)p.readC(); ushort num5 = p.readUH(); if (p.getBuffer().Length > 14) { Logger.warning("[Invalid SABOTAGE: " + BitConverter.ToString(p.getBuffer()) + "]"); } Channel channel = ChannelsXML.getChannel(id2); if (channel == null) { return; } Room room = channel.getRoom(id1); SLOT slot; if (room == null || room.round.Timer != null || (room._state != RoomState.Battle || room.swapRound) || !room.getSlot((int)num1,out slot)) { return; } room.Bar1 = (int)num2; room.Bar2 = (int)num3; RoomType roomType = (RoomType)room.room_type; int num6 = 0; switch (num4) { case 1: slot.damageBar1 += num5; num6 += (int)slot.damageBar1 / 600; break; case 2: slot.damageBar2 += num5; num6 += (int)slot.damageBar2 / 600; break; } slot.earnedXP = num6; switch (roomType) { case RoomType.Destroy: using (BATTLE_MISSION_GENERATOR_INFO_PAK generatorInfoPak = new BATTLE_MISSION_GENERATOR_INFO_PAK(room)) room.SendPacketToPlayers((SendPacket)generatorInfoPak,SLOT_STATE.BATTLE,0); if (room.Bar1 == 0) { Net_Room_Sabotage_Sync.EndRound(room,(byte)1); break; } if (room.Bar2 != 0) { break; } Net_Room_Sabotage_Sync.EndRound(room,(byte)0); break; case RoomType.Defense: using (BATTLE_MISSION_DEFENCE_INFO_PAK missionDefenceInfoPak = new BATTLE_MISSION_DEFENCE_INFO_PAK(room)) room.SendPacketToPlayers((SendPacket)missionDefenceInfoPak,SLOT_STATE.BATTLE,0); if (room.Bar1 != 0 || room.Bar2 != 0) { break; } Net_Room_Sabotage_Sync.EndRound(room,(byte)0); break; } }
public bool getChannel(out Channel channel) { channel = ChannelsXML.getChannel(channelId); return(channel != null); }
public Channel getChannel() { return(ChannelsXML.getChannel(channelId)); }
public static void Load(ReceiveGPacket p) { int roomId = p.readH(); int channelId = p.readH(); byte killerIdx = p.readC(); ushort redObjective = p.readUH(); ushort blueObjective = p.readUH(); int barNumber = p.readC(); ushort damage = p.readUH(); if (p.getBuffer().Length > 14) { Printf.warning("[Invalid SABOTAGE] KillerId " + killerIdx + " Packet: " + BitConverter.ToString(p.getBuffer()) + "]"); } Channel ch = ChannelsXML.getChannel(channelId); if (ch == null) { return; } Room room = ch.getRoom(roomId); SLOT killer; if (room != null && room.round.Timer == null && room._state == RoomState.Battle && !room.swapRound && room.getSlot(killerIdx,out killer)) { room.Bar1 = redObjective; room.Bar2 = blueObjective; RoomType type = (RoomType)room.room_type; int times = 0; if (barNumber == 1) { killer.damageBar1 += damage; times += killer.damageBar1 / 600; } else if (barNumber == 2) { killer.damageBar2 += damage; times += killer.damageBar2 / 600; } killer.earnedXP = times; if (type == RoomType.Destroy) { using (BATTLE_MISSION_GENERATOR_INFO_PAK packet = new BATTLE_MISSION_GENERATOR_INFO_PAK(room)) room.SendPacketToPlayers(packet,SLOT_STATE.BATTLE,0); if (room.Bar1 == 0) { EndRound(room,1); } else if (room.Bar2 == 0) { EndRound(room,0); } } else if (type == RoomType.Defense) { using (BATTLE_MISSION_DEFENCE_INFO_PAK packet = new BATTLE_MISSION_DEFENCE_INFO_PAK(room)) room.SendPacketToPlayers(packet,SLOT_STATE.BATTLE,0); if (room.Bar1 == 0 && room.Bar2 == 0) { EndRound(room,0); } } } }
public override void run() { try { Account player = _client._player; if (player == null) { return; } Match mt = player._match; int channelId = serverInfo - ((serverInfo / 10) * 10); Match mt2 = ChannelsXML.getChannel(channelId).getMatch(id); if (mt != null && mt2 != null && player.matchSlot == mt._leader) { if (type == 1) { if (mt.formação != mt2.formação) { erro = 2147487890; } else if (mt2.getCountPlayers() != mt.formação || mt.getCountPlayers() != mt.formação) { erro = 2147487889; } else if (mt2._state == MatchState.Play || mt._state == MatchState.Play) { erro = 2147487888; } else { mt._state = MatchState.Play; Account pM = mt2.getLeader(); if (pM != null && pM._match != null) { pM.SendPacket(new CLAN_WAR_ENEMY_INFO_PAK(mt)); pM.SendPacket(new CLAN_WAR_CREATED_ROOM_PAK(mt)); mt2._slots[pM.matchSlot].state = SlotMatchState.Ready; } mt2._state = MatchState.Play; } } else { Account pM = mt2.getLeader(); if (pM != null && pM._match != null) { pM.SendPacket(new CLAN_WAR_RECUSED_BATTLE_PAK(0x80001093)); } } } else { erro = 0x80001094; } _client.SendPacket(new CLAN_WAR_ACCEPTED_BATTLE_PAK(erro)); } catch (Exception ex) { SaveLog.fatal(ex.ToString()); Printf.b_danger("[CLAN_WAR_ACCEPT_BATTLE_REC.run] Erro fatal!"); } }
public static void Load(ReceiveGPacket p) { int id1 = (int)p.readH(); int id2 = (int)p.readH(); byte num1 = p.readC(); byte num2 = p.readC(); int num3 = p.readD(); float num4 = p.readT(); float num5 = p.readT(); float num6 = p.readT(); byte num7 = p.readC(); int num8 = (int)num7 * 15; if (p.getBuffer().Length > 25 + num8) { Logger.warning("[Invalid DEATH: " + BitConverter.ToString(p.getBuffer()) + "]"); } Channel channel = ChannelsXML.getChannel(id2); if (channel == null) { return; } Room room = channel.getRoom(id1); if (room == null || room.round.Timer != null || room._state != RoomState.Battle) { return; } SLOT slot1 = room.getSlot((int)num1); if (slot1 == null || slot1.state != SLOT_STATE.BATTLE) { return; } FragInfos kills = new FragInfos() { killerIdx = num1, killingType = CharaKillType.DEFAULT, weapon = num3, x = num4, y = num5, z = num6, flag = num2 }; bool isSuicide = false; for (int index = 0; index < (int)num7; ++index) { byte num9 = p.readC(); byte hitspotInfo = p.readC(); float num10 = p.readT(); float num11 = p.readT(); float num12 = p.readT(); int num13 = (int)p.readC(); int slotIdx = (int)hitspotInfo & 15; SLOT slot2 = room.getSlot(slotIdx); if (slot2 != null && slot2.state == SLOT_STATE.BATTLE) { Frag frag = new Frag(hitspotInfo) { flag = (byte)num13, victimWeaponClass = num9, x = num10, y = num11, z = num12 }; if ((int)kills.killerIdx == slotIdx) { isSuicide = true; } kills.frags.Add(frag); } } kills.killsCount = (byte)kills.frags.Count; Game_SyncNet.genDeath(room,slot1,kills,isSuicide); }
public static void Load(ReceiveGPacket p) { int roomId = p.readH(); int channelId = p.readH(); byte killerId = p.readC(); byte dieObjectId = p.readC(); int weaponId = p.readD(); float killerX = p.readT(); float killerY = p.readT(); float killerZ = p.readT(); byte killsCount = p.readC(); int estimado = (killsCount * 15); if (p.getBuffer().Length > (25 + estimado)) { SaveLog.warning("[Invalid DEATH] Lenght > " + (25 + estimado) + " KillerId " + killerId + " Packet:" + BitConverter.ToString(p.getBuffer()) + "]"); Printf.warning("Invalid death Killer Id " + killerId); } Channel ch = ChannelsXML.getChannel(channelId); if (ch == null) { return; } Room room = ch.getRoom(roomId); if (room != null && room.round.Timer == null && room._state == RoomState.Battle) { SLOT killer = room.getSlot(killerId); if (killer != null && killer.state == SLOT_STATE.BATTLE) { FragInfos info = new FragInfos { killerIdx = killerId, killingType = 0, //1 - piercing | 2 - mass weapon = weaponId, x = killerX, y = killerY, z = killerZ, flag = dieObjectId }; bool isSuicide = false; for (int i = 0; i < killsCount; i++) { byte weaponClass = p.readC(); byte deathInfo = p.readC(); float vicX = p.readT(); float vicY = p.readT(); float vicZ = p.readT(); int vicFlag = p.readC(); int victimId = deathInfo & 15; SLOT victim = room.getSlot(victimId); if (victim != null && victim.state == SLOT_STATE.BATTLE) { Frag frag = new Frag(deathInfo) { flag = (byte)vicFlag,victimWeaponClass = weaponClass,x = vicX,y = vicY,z = vicZ }; if (info.killerIdx == victimId) { isSuicide = true; } info.frags.Add(frag); } } info.killsCount = (byte)info.frags.Count; Game_SyncNet.genDeath(room,killer,info,isSuicide); } } }
public static void Load(ReceiveGPacket p) { int id1 = (int)p.readH(); int id2 = (int)p.readH(); int num = (int)p.readC(); int slotIdx = (int)p.readC(); int areaId = 0; float x = 0.0f; float y = 0.0f; float z = 0.0f; switch (num) { case 0: areaId = (int)p.readC(); x = p.readT(); y = p.readT(); z = p.readT(); if (p.getBuffer().Length > 21) { Logger.warning("[Invalid BOMB0: " + BitConverter.ToString(p.getBuffer()) + "]"); break; } break; case 1: if (p.getBuffer().Length > 8) { Logger.warning("[Invalid BOMB1: " + BitConverter.ToString(p.getBuffer()) + "]"); break; } break; } Channel channel = ChannelsXML.getChannel(id2); if (channel == null) { return; } Room room = channel.getRoom(id1); if (room == null || room.round.Timer != null || room._state != RoomState.Battle) { return; } SLOT slot = room.getSlot(slotIdx); if (slot == null || slot.state != SLOT_STATE.BATTLE) { return; } if (num == 0) { Net_Room_C4.InstallBomb(room,slot,areaId,x,y,z); } else { if (num != 1) { return; } Net_Room_C4.UninstallBomb(room,slot); } }