protected internal override void run()
        {
            Room room = base.getClient().getPlayer().getRoom();

            base.getClient().getPlayer().getRoom().setBombState(0);
            room.setRedKills(0);
            room.setBlueKills(0);
            room.setBlueWinRounds(room.getBlueWinRounds() + 1);
            bool flag = room.getBlueWinRounds() == room.getKillsByMask();

            if (flag)
            {
                foreach (Account current in base.getClient().getPlayer().getRoom().getAllPlayers())
                {
                    SLOT roomSlotByPlayer = room.getRoomSlotByPlayer(current);
                    roomSlotByPlayer.setKillMessage(0);
                    roomSlotByPlayer.setLastKillMessage(0);
                    roomSlotByPlayer.setOneTimeKills(0);
                    roomSlotByPlayer.setAllKills(0);
                    roomSlotByPlayer.setAllDeahts(0);
                    current.getClient().sendPacket(new PROTOCOL_BATTLE_ENDBATTLE_ACK(current));
                    room.setRedKills(0);
                    room.setRedDeaths(0);
                    room.setBlueKills(0);
                    room.setBlueDeaths(0);
                    room.setFigth(0);
                    room.setBlueWinRounds(0);
                    room.setRedWinRounds(0);
                }
            }
            else
            {
                foreach (Account current2 in base.getClient().getPlayer().getRoom().getAllPlayers())
                {
                    SLOT roomSlotByPlayer2 = room.getRoomSlotByPlayer(current2);
                    roomSlotByPlayer2.setKillMessage(0);
                    roomSlotByPlayer2.setLastKillMessage(0);
                    roomSlotByPlayer2.setOneTimeKills(0);
                    current2.getClient().sendPacket(new PROTOCOL_BATTLE_MISSION_BOMB_UNINSTALL_ACK(this.slot));
                    bool flag2 = room.room_type == 2;
                    if (flag2)
                    {
                        current2.getClient().sendPacket(new PROTOCOL_BATTLE_MISSION_ROUND_END_ACK(1, 3, base.getClient().getPlayer().getRoom()));
                    }
                }
                bool flag3 = room.room_type == 2;
                if (flag3)
                {
                    Thread.Sleep(10000);
                    foreach (Account current3 in base.getClient().getPlayer().getRoom().getAllPlayers())
                    {
                        current3.getClient().sendPacket(new PROTOCOL_BATTLE_MISSION_ROUND_PRE_START_ACK());
                        current3.getClient().sendPacket(new PROTOCOL_BATTLE_MISSION_ROUND_START_ACK(current3.getRoom()));
                    }
                }
            }
        }
Exemple #2
0
 public override void read()
 {
     try
     {
         Account player = _client._player;
         Room    room   = player == null ? null : player._room;
         if (room != null && room._leader == player._slotId && room._state == RoomState.Ready)
         {
             readD();
             room.name     = readS(23);
             room.mapId    = readH();
             room.stage4v4 = readC();
             byte stageType = readC();
             if (stageType != room.room_type)
             {
                 room.room_type = stageType;
                 int count = 0;
                 for (int i = 0; i < 16; i++)
                 {
                     SLOT slot = room._slots[i];
                     if ((int)slot.state == 8)
                     {
                         slot.state = SLOT_STATE.NORMAL;
                         count++;
                     }
                 }
                 if (count > 0)
                 {
                     room.updateSlotsInfo();
                 }
             }
             readC();
             readC();
             readC();
             room._ping       = readC();
             room.weaponsFlag = readC();
             room.random_map  = readC();
             room.special     = readC();
             readS(33);
             room.killtime = readC();
             readC();
             readC();
             readC();
             room.limit      = readC();
             room.seeConf    = readC();
             room.autobalans = readH();
             room.aiCount    = readC();
             room.aiLevel    = readC();
             room.updateRoomInfo();
         }
     }
     catch (Exception ex)
     {
         SaveLog.fatal(ex.ToString());
         Printf.b_danger("[ROOM_CHANGE_INFO_REC.read] Erro fatal!");
     }
 }
Exemple #3
0
        protected internal override void write()
        {
            SLOT slot = this.player.getRoom().getSlots()[this.player.getPlayerId()];

            this.writeH(this._chat.chat_type);
            this.writeD(slot.getPlayer().getSlot());
            this.writeD(this._chat.chat.Length);
            this.writeS(this._chat.chat);
        }
Exemple #4
0
 public override void write()
 {
     this.writeH((short)3355);
     this.writeC((byte)this.kills.killingType);
     this.writeC(this.kills.killsCount);
     this.writeC(this.kills.killerIdx);
     this.writeD(this.kills.weapon);
     this.writeT(this.kills.x);
     this.writeT(this.kills.y);
     this.writeT(this.kills.z);
     this.writeC(this.kills.flag);
     for (int index = 0; index < this.kills.frags.Count; ++index)
     {
         Frag frag = this.kills.frags[index];
         this.writeC(frag.victimWeaponClass);
         this.writeC(frag.hitspotInfo);
         this.writeH((short)frag.killFlag);
         this.writeC(frag.flag);
         this.writeT(frag.x);
         this.writeT(frag.y);
         this.writeT(frag.z);
     }
     this.writeH((short)this.room._redKills);
     this.writeH((short)this.room._redDeaths);
     this.writeH((short)this.room._blueKills);
     this.writeH((short)this.room._blueDeaths);
     for (int index = 0; index < 16; ++index)
     {
         SLOT slot = this.room._slots[index];
         this.writeH((short)slot.allKills);
         this.writeH((short)slot.allDeaths);
     }
     if (this.killer.killsOnLife == 2)
     {
         this.writeC((byte)1);
     }
     else if (this.killer.killsOnLife == 3)
     {
         this.writeC((byte)2);
     }
     else if (this.killer.killsOnLife > 3)
     {
         this.writeC((byte)3);
     }
     else
     {
         this.writeC((byte)0);
     }
     this.writeH((ushort)this.kills.Score);
     if (this.room.room_type != (byte)7)
     {
         return;
     }
     this.writeH((ushort)this.room.red_dino);
     this.writeH((ushort)this.room.blue_dino);
 }
Exemple #5
0
        public PROTOCOL_ROOM_CHANGE_TEAM_ACK(Player sender,Room room,int cmd,int slotcount,int newTeam)
        {
            this.sender    = sender;
            this.room      = room;
            this.cmd       = cmd;
            this.slotcount = slotcount;
            this.newTeam   = newTeam;

            this.leaderSlot = room.getRoomSlotByPlayer(room.getLeader());
        }
Exemple #6
0
 /// <summary>
 /// Checa se os slots são válidos para trocarem mensagens na sala.
 /// </summary>
 /// <param name="sender">Remetente</param>
 /// <param name="receiver">Destinatário</param>
 /// <returns></returns>
 private bool SlotValidMessage(SLOT sender,SLOT receiver)
 {
     return(((int)sender.state == 7 || (int)sender.state == 8) && ((int)receiver.state == 7 || (int)receiver.state == 8) ||
            ((int)sender.state >= 9 && (int)receiver.state >= 9) && (receiver.specGM ||
                                                                     sender.specGM ||
                                                                     sender._deathState.HasFlag(DeadEnum.useChat) ||
                                                                     sender._deathState.HasFlag(DeadEnum.isDead) && receiver._deathState.HasFlag(DeadEnum.isDead) ||
                                                                     sender.espectador && receiver.espectador ||
                                                                     sender._deathState.HasFlag(DeadEnum.isAlive) && receiver._deathState.HasFlag(DeadEnum.isAlive) && (sender.espectador && receiver.espectador || !sender.espectador && !receiver.espectador)));
 }
Exemple #7
0
 private void insertItem(int id,SLOT slot)
 {
     lock (slot.armas_usadas)
     {
         if (!slot.armas_usadas.Contains(id))
         {
             slot.armas_usadas.Add(id);
         }
     }
 }
 //This is the worst case scenario. If everything goes wrond this piece of gear would be called.
 public Gear()
 {
     level     = 1;
     starLevel = 1;
     mySlot    = SLOT.HEAD;
     rarity    = RARITY.GRAY;
     modifiers = new SVP[6] {
         new SVP(StatBooster.HPFLAT,1),null,null,null,null,null
     };
 }
Exemple #9
0
        public void SetBestKills(SLOT slot)
        {
            if (slot.allKills <= Kills.RecordValue)
            {
                return;
            }

            Kills.PlayerId    = slot._playerId;
            Kills.RecordValue = slot.allKills;
        }
Exemple #10
0
        public void SetBestHeadshot(SLOT slot)
        {
            if (slot.headshots <= Headshot.RecordValue)
            {
                return;
            }

            Headshot.PlayerId    = slot._playerId;
            Headshot.RecordValue = slot.headshots;
        }
Exemple #11
0
        public void SetBestExp(SLOT slot)
        {
            if (slot.exp <= Exp.RecordValue)
            {
                return;
            }

            Exp.PlayerId    = slot._playerId;
            Exp.RecordValue = slot.exp;
        }
 public override void write()
 {
     writeH(3355);
     writeC((byte)kills.killingType);
     writeC(kills.killsCount);
     writeC(kills.killerIdx);
     writeD(kills.weapon);
     writeT(kills.x);
     writeT(kills.y);
     writeT(kills.z);
     writeC(kills.flag);
     for (int i = 0; i < kills.frags.Count; i++)
     {
         Frag frag = kills.frags[i];
         writeC(frag.victimWeaponClass);
         writeC(frag.hitspotInfo);
         writeH((short)frag.killFlag);
         writeC(frag.flag);
         writeT(frag.x);
         writeT(frag.y);
         writeT(frag.z);
     }
     writeH((short)room._redKills);
     writeH((short)room._redDeaths);
     writeH((short)room._blueKills);
     writeH((short)room._blueDeaths);
     for (int i = 0; i < 16; i++)
     {
         SLOT slot = room._slots[i];
         writeH((short)slot.allKills);
         writeH((short)slot.allDeaths);
     }
     if (killer.killsOnLife == 2)
     {
         writeC(1);
     }
     else if (killer.killsOnLife == 3)
     {
         writeC(2);
     }
     else if (killer.killsOnLife > 3)
     {
         writeC(3);
     }
     else
     {
         writeC(0);
     }
     writeH((ushort)kills.Score);
     if ((RoomType)room.room_type == RoomType.Boss)
     {
         writeH((ushort)room.red_dino);
         writeH((ushort)room.blue_dino);
     }
 }
 public override void run()
 {
     try
     {
         Account p = _client._player;
         if (p == null)
         {
             return;
         }
         Channel ch;
         if (p != null && p.player_name.Length > 0 && p._room == null &&
             p._match == null && p.getChannel(out ch))
         {
             lock (ch._rooms)
             {
                 for (int ridx = 0; ridx < ch._rooms.Count; ridx++)
                 {
                     Room room = ch._rooms[ridx];
                     if (room.room_type == 10)
                     {
                         continue;
                     }
                     if (room.password.Length == 0 && room.limit == 0 && room.special != 5 &&
                         (!room.kickedPlayers.Contains(p.player_id) || p.HaveGMLevel()))
                     {
                         for (int sidx = 0; sidx < 16; sidx++)
                         {
                             SLOT slot = room._slots[sidx];
                             if (slot._playerId == 0 && (int)slot.state == 0)
                             {
                                 salas.Add(room);
                                 break;
                             }
                         }
                     }
                 }
             }
         }
         if (salas.Count == 0)
         {
             _client.SendPacket(new LOBBY_QUICKJOIN_ROOM_PAK());
         }
         else
         {
             getRandomRoom(p);
         }
         salas = null;
     }
     catch (Exception ex)
     {
         SaveLog.fatal(ex.ToString());
         Printf.b_danger("[ROOM_JOIN_QUICK_REC.run] Erro fatal!");
     }
 }
Exemple #14
0
        public void SetBestParticipation(PlayerStats stats,SLOT slot)
        {
            ComDiv.updateDB("contas","clan_game_pt",++stats.ClanGames,"player_id",slot._playerId);
            if (stats.ClanGames <= Participation.RecordValue)
            {
                return;
            }

            Participation.PlayerId    = slot._playerId;
            Participation.RecordValue = stats.ClanGames;
        }
Exemple #15
0
 public override void RunImpl()
 {
     foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
     {
         SLOT slot = getClient().getPlayer().getRoom().getRoomSlotByPlayer(member);
         if ((int)slot.getState() > 8)
         {
             member.getClient().SendPacket(new PROTOCOL_BATTLE_RESPAWN_ACK(getClient().getPlayer().getRoom().getRoomSlotByPlayer(getClient().getPlayer()).getId(),first,second,third,fourth,fifth,id,red,blue,head,beret,dino));
         }
     }
 }
        private void SyncPlayerPings(Account p, Room room, SLOT slot,bool isBotMode)
        {
            /*
             * if (p.DebugPing && (DateTime.Now - p.LastPingDebug).TotalSeconds >= 5)
             * {
             *  p.LastPingDebug = DateTime.Now;
             *  p.SendPacket(new AUTH_RECV_WHISPER_PAK("Latency", Latency + "ms (" + Ping + " bar)", true));
             * }
             */


            if (isBotMode)
            {
                return;
            }
            slot.latency = Latency;
            slot.ping    = Ping;

            if (slot.latency >= ConfigGS.maxBattleLatency)
            {
                slot.failLatencyTimes++;
            }
            else
            {
                slot.failLatencyTimes = 0;
            }

            if (slot.failLatencyTimes < ConfigGS.maxRepeatLatency)
            {
                if ((double)(DateTime.Now - room.LastPingSync).TotalSeconds < 7)
                {
                    return;
                }
                if (Latency < 5000 && Ping > 1) // Ping Fake
                {
                    slot.ping = 5;              // 5 barras
                }
                byte[] pings = new byte[16];
                for (int i = 0; i < 16; i++)
                {
                    pings[i] = (byte)room._slots[i].ping;
                }
                using (BATTLE_SENDPING_PAK packet = new BATTLE_SENDPING_PAK(pings))
                    room.SendPacketToPlayers(packet,SLOT_STATE.BATTLE,0);
                room.LastPingSync = DateTime.Now;
            }
            else
            {
                SaveLog.info("Player desconectado devido a latencia");
                SaveLog.warning("Player '" + p.player_name + "' (Id: " + slot._playerId + ") desconectado devido a latencia (" + slot.latency + "/" + ConfigGS.maxBattleLatency + "ms)");
                _client.Close(500);
                return;
            }
        }
        public override void RunImpl()
        {
            Room room = getClient().getPlayer().getRoom();

            getClient().getPlayer().getRoom().setBombState(0);
            room.setRedKills(0);
            room.setBlueKills(0);
            room.setBlueWinRounds(room.getBlueWinRounds() + 1);
            if (room.getBlueWinRounds() == room.getKillsByMask())
            {
                foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                {
                    SLOT slot = room.getRoomSlotByPlayer(member);
                    slot.setKillMessage(0);
                    slot.setLastKillMessage(0);
                    slot.setOneTimeKills(0);
                    slot.setAllKills(0);
                    slot.setAllDeahts(0);
                    member.getClient().SendPacket(new PROTOCOL_BATTLE_END_ACK(member,room));
                    room.setRedKills(0);
                    room.setRedDeaths(0);
                    room.setBlueKills(0);
                    room.setBlueDeaths(0);
                    room.setFigth(0);
                    room.setBlueWinRounds(0);
                    room.setRedWinRounds(0);
                }
            }
            else
            {
                foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                {
                    SLOT playerSlot = room.getRoomSlotByPlayer(member);
                    playerSlot.setKillMessage(0);
                    playerSlot.setLastKillMessage(0);
                    playerSlot.setOneTimeKills(0);
                    member.getClient().SendPacket(new PROTOCOL_BATTLE_BOMB_UNTAB_ACK(slot));
                    if (room.getType() == 2)
                    {
                        member.getClient().SendPacket(new PROTOCOL_BATTLE_ROUND_END_ACK(1, 3, getClient().getPlayer().getRoom()));
                    }
                }
                if (room.getType() == 2)
                {
                    Thread.Sleep(10000);
                    foreach (Player member in getClient().getPlayer().getRoom().getPlayers().Values)
                    {
                        member.getClient().SendPacket(new opcode_3865_ACK());
                        member.getClient().SendPacket(new PROTOCOL_BATTLE_ROUND_START(member.getRoom()));
                    }
                }
            }
        }
 public override void write()
 {
     try
     {
         if (this.room == null)
         {
             return;
         }
         this.writeH((short)3861);
         if (this.room.getLeader() == null)
         {
             this.room.setNewLeader(-1, 0, this.room._leader, false);
         }
         if (this.room.getLeader() == null)
         {
             return;
         }
         this.writeD(this.room._leader);
         for (int index = 0; index < 16; ++index)
         {
             SLOT    slot         = this.room._slots[index];
             Account playerBySlot = this.room.getPlayerBySlot(slot);
             if (playerBySlot != null)
             {
                 Clan clan = ClanManager.getClan(playerBySlot.clanId);
                 this.writeC((byte)slot.state);
                 this.writeC((byte)playerBySlot.getRank());
                 this.writeD(clan._id);
                 this.writeD(playerBySlot.clanAccess);
                 this.writeC((byte)clan._rank);
                 this.writeD(clan._logo);
                 this.writeC((byte)playerBySlot.pc_cafe);
                 this.writeC((byte)playerBySlot.tourneyLevel);
                 this.writeD((uint)playerBySlot.effects);
                 this.writeS(clan._name,17);
                 this.writeD(0);
                 this.writeC((byte)31);
             }
             else
             {
                 this.writeC((byte)slot.state);
                 this.writeB(new byte[10]);
                 this.writeD(uint.MaxValue);
                 this.writeB(new byte[28]);
             }
         }
     }
     catch (Exception ex)
     {
         Logger.warning("[ROOM_GET_SLOTINFO_PAK] " + ex.ToString());
     }
 }
Exemple #19
0
        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 void linkTo(SLOT linktarget)
 {
     if (linktarget != null)
     {
         needclear       = true; refPropChanged = true;
         this.linktarget = linktarget; index = -1;
     }
     else if (this.linktarget != null)
     {
         this.linktarget = null;
         index           = RunTimeDataType.unknown;
     }
 }
Exemple #21
0
 public override void run()
 {
     try
     {
         Account player = this._client._player;
         Room    room   = player == null ? (Room)null : player._room;
         if (room == null || room._state != RoomState.Battle || player._slotId == this.slotIdx)
         {
             return;
         }
         SLOT slot = room.getSlot(player._slotId);
         if (slot == null || slot.state != SLOT_STATE.BATTLE || room._slots[this.slotIdx].state != SLOT_STATE.BATTLE)
         {
             return;
         }
         int RedPlayers;
         int BluePlayers;
         room.getPlayingPlayers(true,out RedPlayers,out BluePlayers);
         if (player._rank < ConfigGS.minRankVote && !player.HaveGMLevel())
         {
             this.erro = 2147487972U;
         }
         else if (room.vote.Timer != null)
         {
             this.erro = 2147487968U;
         }
         else if (slot.NextVoteDate > DateTime.Now)
         {
             this.erro = 2147487969U;
         }
         this._client.SendPacket((SendPacket) new VOTEKICK_CHECK_PAK(this.erro));
         if (this.erro > 0U)
         {
             return;
         }
         slot.NextVoteDate = DateTime.Now.AddMinutes(1.0);
         room.votekick     = new VoteKick(slot._id, this.slotIdx)
         {
             motive = this.motive
         };
         this.ChargeVoteKickArray(room);
         using (VOTEKICK_START_PAK votekickStartPak = new VOTEKICK_START_PAK(room.votekick))
             room.SendPacketToPlayers((SendPacket)votekickStartPak, SLOT_STATE.BATTLE, 0, player._slotId, this.slotIdx);
         AllUtils.LogVotekickStart(room, player, slot);
         room.StartVote();
     }
     catch (Exception ex)
     {
         Logger.info("VOTEKICK_START_REC: " + ex.ToString());
     }
 }
 public override void run()
 {
     try
     {
         Account player = _client._player;
         if (player == null)
         {
             return;
         }
         Room room = player._room;
         if (room == null || room.round.Timer != null || room._state < RoomState.Battle)
         {
             return;
         }
         bool isBotMode = room.isBotMode();
         SLOT killer    = room.getSlot(kills.killerIdx);
         if (killer == null || !isBotMode && (killer.state < SLOT_STATE.BATTLE || killer._id != player._slotId))
         {
             return;
         }
         int score;
         Net_Room_Death.RegistryFragInfos(room,killer,out score,isBotMode,isSuicide,kills);
         if (isBotMode)
         {
             killer.Score += killer.killsOnLife + room.IngameAiLevel + score;
             if (killer.Score > 65535)
             {
                 _client.SendPacket(new AUTH_ACCOUNT_KICK_PAK(0));
                 killer.Score = 65535;
                 Printf.warning("O jogador " + player.player_name + " ultrapassou 65535 pontos no modo Bot");
                 SaveLog.LogAbuse("[Bot Mode] Score máximo atingido [Nick: " + player.player_name + "; Id: " + _client.player_id + "]");
             }
             kills.Score = killer.Score;
         }
         else
         {
             killer.Score += score;
             AllUtils.CompleteMission(room,player,killer,kills,MISSION_TYPE.NA,0);
             kills.Score = score;
         }
         using (BATTLE_DEATH_PAK packet = new BATTLE_DEATH_PAK(room,kills,killer,isBotMode))
             room.SendPacketToPlayers(packet,SLOT_STATE.BATTLE,0);
         Net_Room_Death.EndBattleByDeath(room,killer,isBotMode,isSuicide);
     }
     catch (Exception ex)
     {
         SaveLog.fatal(ex.ToString());
         Printf.b_danger("[BATTLE_DEATH_REC.run] Erro fatal!");
         _client.Close(0);
     }
 }
Exemple #23
0
 public override void run()
 {
     try
     {
         Account p    = _client._player;
         Room    room = p == null ? null : p._room;
         if (room == null || room._state != RoomState.Battle || p._slotId == slotIdx)
         {
             return;
         }
         SLOT slot = room.getSlot(p._slotId);
         if (slot != null && slot.state == SLOT_STATE.BATTLE && room._slots[slotIdx].state == SLOT_STATE.BATTLE)
         {
             int redPlayers,bluePlayers;
             room.getPlayingPlayers(true,out redPlayers,out bluePlayers);
             //if (redPlayers < 3 && bluePlayers == 1 ||
             //bluePlayers < 3 && redPlayers == 1) erro = 0x800010E2;
             if (p._rank < ConfigGS.minRankVote && !p.HaveGMLevel())
             {
                 erro = 0x800010E4;
             }
             else if (room.vote.Timer != null)
             {
                 erro = 0x800010E0;
             }
             else if (slot.NextVoteDate > DateTime.Now)
             {
                 erro = 0x800010E1;
             }
             _client.SendPacket(new VOTEKICK_CHECK_PAK(erro));
             if (erro > 0)
             {
                 return;
             }
             slot.NextVoteDate = DateTime.Now.AddMinutes(1);
             room.votekick     = new VoteKick(slot._id,slotIdx)
             {
                 motive = motive
             };
             ChargeVoteKickArray(room);
             using (VOTEKICK_START_PAK packet = new VOTEKICK_START_PAK(room.votekick))
                 room.SendPacketToPlayers(packet,SLOT_STATE.BATTLE,0,p._slotId,slotIdx);
             room.StartVote();
         }
     }
     catch (Exception ex)
     {
         SaveLog.fatal(ex.ToString());
         Printf.b_danger("[VOTEKICK_START_REC.run] Erro fatal!");
     }
 }
Exemple #24
0
        private static void WriteCharaInfo(SendGPacket pk,Room room,SLOT slot,CupomEffects effects)
        {
            int charaId = 0;

            if ((RoomType)room.room_type == RoomType.Boss || (RoomType)room.room_type == RoomType.Cross_Counter)
            {
                if (room.rodada == 1 && slot._team == 1 ||
                    room.rodada == 2 && slot._team == 0)
                {
                    charaId = room.rodada == 2 ? slot._equip._red : slot._equip._blue;
                }
                else if (room.TRex == slot._id)
                {
                    charaId = -1;
                }
                else
                {
                    charaId = slot._equip._dino;
                }
            }
            else
            {
                charaId = slot._team == 0 ? slot._equip._red : slot._equip._blue;
            }
            int HPBonus = 0;

            if (effects.HasFlag(CupomEffects.Ketupat))
            {
                HPBonus += 10;
            }
            if (effects.HasFlag(CupomEffects.HP5))
            {
                HPBonus += 5;
            }
            if (effects.HasFlag(CupomEffects.HP10))
            {
                HPBonus += 10;
            }
            if (charaId == -1)
            {
                pk.writeC(255);
                pk.writeH(65535);
            }
            else
            {
                pk.writeC((byte)ComDiv.getIdStatics(charaId,2));
                pk.writeH((short)ComDiv.getIdStatics(charaId,4));
            }
            pk.writeC((byte)HPBonus);
            pk.writeC(effects.HasFlag(CupomEffects.C4SpeedKit));
        }
 public override void write()
 {
     writeH(3363);
     writeH((ushort)_r._redKills);
     writeH((ushort)_r._redDeaths);
     writeH((ushort)_r._blueKills);
     writeH((ushort)_r._blueDeaths);
     for (int i = 0; i < 16; i++)
     {
         SLOT slot = _r._slots[i];
         writeH((ushort)slot.allKills);
         writeH((ushort)slot.allDeaths);
     }
 }
Exemple #26
0
 public override void write()
 {
     this.writeH((short)3363);
     this.writeH((ushort)this._r._redKills);
     this.writeH((ushort)this._r._redDeaths);
     this.writeH((ushort)this._r._blueKills);
     this.writeH((ushort)this._r._blueDeaths);
     for (int index = 0; index < 16; ++index)
     {
         SLOT slot = this._r._slots[index];
         this.writeH((ushort)slot.allKills);
         this.writeH((ushort)slot.allDeaths);
     }
 }
Exemple #27
0
        public override void executeAsync(RunTimeValueBase thisObj,SLOT[] argements,SLOT resultSlot,object callbacker,object stackframe,SourceToken token,RunTimeScope scope)
        {
            IBlockCallBack cb    = (IBlockCallBack)callbacker;
            StackFrame     frame = (StackFrame)stackframe;

            if (argements[0].getValue().rtType == RunTimeDataType.rt_null)
            {
                if (frame.player.infoOutput != null)
                {
                    frame.player.infoOutput.Info(string.Empty);
                }
                cb.call(cb.args);
                return;
            }

            rtArray array = (rtArray)(argements[0].getValue());

            if (array.innerArray.Count == 0)
            {
                if (frame.player.infoOutput != null)
                {
                    frame.player.infoOutput.Info(string.Empty);
                }
                cb.call(cb.args);
                return;
            }


            BlockCallBackBase sepcb = frame.player.blockCallBackPool.create();

            sepcb.scope   = scope;
            sepcb._intArg = 0;
            sepcb.setCallBacker(null);
            sepcb._intArg2 = 0;

            object[] sendargs = sepcb.cacheObjects;
            sendargs[0] = cb;
            sendargs[1] = array;
            sendargs[2] = frame;
            sendargs[3] = token;
            sendargs[4] = scope;
            sendargs[5] = " ";
            sendargs[6] = new StringBuilder();
            sendargs[7] = resultSlot;
            //sendargs[8] = new rtInt(0);
            sepcb.args = sendargs;

            _SeptoString_CB(sepcb,sendargs);
        }
 public static void EndBattleByDeath(Room room,SLOT killer,bool isBotMode,bool isSuicide)
 {
     if ((room.room_type == 1 || room.room_type == 8 || room.room_type == 13) && !isBotMode)
     {
         AllUtils.BattleEndKills(room,isBotMode);
     }
     else if (!killer.specGM && (room.room_type == 2 || room.room_type == 4)) //Destruição e Supressão
     {
         int redDeaths,blueDeaths,allRed,allBlue,winner = 0;
         room.getPlayingPlayers(true,out allRed,out allBlue,out redDeaths,out blueDeaths);
         if (redDeaths == allRed && killer._team == 0 && isSuicide && !room.C4_actived)
         {
             winner = 1;
             room.blue_rounds++;
             AllUtils.BattleEndRound(room,winner,true);
         }
         else if (blueDeaths == allBlue && killer._team == 1)
         {
             room.red_rounds++;
             AllUtils.BattleEndRound(room,winner,true);
         }
         else if (redDeaths == allRed && killer._team == 1)
         {
             if (!room.C4_actived)
             {
                 winner = 1;
                 room.blue_rounds++;
             }
             else if (isSuicide)
             {
                 room.red_rounds++;
             }
             AllUtils.BattleEndRound(room,winner,false);
         }
         else if (blueDeaths == allBlue && killer._team == 0)
         {
             if (!isSuicide || !room.C4_actived)
             {
                 room.red_rounds++;
             }
             else
             {
                 winner = 1;
                 room.blue_rounds++;
             }
             AllUtils.BattleEndRound(room,winner,true);
         }
     }
 }
        public override void run()
        {
            Account player = _client._player;
            Room    room   = player == null ? null : player._room;

            if (room != null && room.round.Timer == null && room._state == RoomState.Battle && room.C4_actived)
            {
                SLOT slot = room.getSlot(slotIdx);
                if (slot == null || slot.state != SLOT_STATE.BATTLE)
                {
                    return;
                }
                Net_Room_C4.UninstallBomb(room,slot);
            }
        }
Exemple #30
0
 public BATTLE_STARTBATTLE_PAK(SLOT slot,Account pR,List <int> dinos,bool isBotMode,bool type)
 {
     this.slot  = slot;
     room       = pR._room;
     this.type  = type ? 0 : 1;
     this.dinos = dinos;
     if (room != null)
     {
         isBattle = 1;
         if (!isBotMode)
         {
             AllUtils.CompleteMission(room,pR,slot,type ? MISSION_TYPE.STAGE_ENTER : MISSION_TYPE.STAGE_INTERCEPT,0);
         }
     }
 }