Пример #1
0
        public override void run()
        {
            try
            {
                Account p = _client._player;
                if (p == null)
                {
                    return;
                }
                Room r = p._room;

                if (r != null && r._state == RoomState.Battle)
                {
                    SLOT slot = r.getSlot(p._slotId);
                    if (slot != null && slot.state == SLOT_STATE.BATTLE)
                    {
                        if (slot._deathState.HasFlag(DeadEnum.isDead) || slot._deathState.HasFlag(DeadEnum.useChat))
                        {
                            slot._deathState = DeadEnum.isAlive;
                        }
                        PlayerManager.CheckEquipedItems(equip,p._inventory._items,true);

                        string sala = r.name.ToLower();
                        if ((sala.Contains("@camp") || sala.Contains("@cnpb") || sala.Contains("@79") || sala.Contains("@lan")) && ConfigGS.EnableClassicRules)
                        {
                            ClassicModeCheck(sala,equip,p);
                        }

                        slot._equip = equip;
                        if ((WeaponsFlag & 8) > 0)
                        {
                            insertItem(equip._primary,slot);
                        }
                        if ((WeaponsFlag & 4) > 0)
                        {
                            insertItem(equip._secondary,slot);
                        }
                        if ((WeaponsFlag & 2) > 0)
                        {
                            insertItem(equip._melee,slot);
                        }
                        if ((WeaponsFlag & 1) > 0)
                        {
                            insertItem(equip._grenade,slot);
                        }
                        insertItem(equip._special,slot);
                        if (slot._team == 0)
                        {
                            insertItem(equip._red,slot);
                        }
                        else
                        {
                            insertItem(equip._blue,slot);
                        }
                        insertItem(equip._helmet,slot); insertItem(equip._beret,slot); insertItem(equip._dino,slot);
                        using (BATTLE_RESPAWN_PAK packet = new BATTLE_RESPAWN_PAK(r,slot))
                            r.SendPacketToPlayers(packet,SLOT_STATE.BATTLE,0);
                        if (slot.firstRespawn)
                        {
                            slot.firstRespawn = false;
                            Game_SyncNet.SendUDPPlayerSync(r,slot,p.effects,0);
                        }
                        else
                        {
                            Game_SyncNet.SendUDPPlayerSync(r,slot,p.effects,2);
                        }
                        if (r.weaponsFlag != WeaponsFlag)
                        {
                            SaveLog.warning("Room: " + r.weaponsFlag + "; Player: " + WeaponsFlag);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SaveLog.fatal(ex.ToString());
                Printf.b_danger("[BATTLE_RESPAWN_REC.run] Erro fatal!");
            }
        }
Пример #2
0
 public override void run()
 {
     try
     {
         Account player = this._client._player;
         if (player == null)
         {
             return;
         }
         Room room = player._room;
         if (room == null || room._state != RoomState.Battle)
         {
             return;
         }
         SLOT slot = room.getSlot(player._slotId);
         if (slot == null || slot.state != SLOT_STATE.BATTLE)
         {
             return;
         }
         if (slot._deathState.HasFlag((Enum)DeadEnum.isDead) || slot._deathState.HasFlag((Enum)DeadEnum.useChat))
         {
             slot._deathState = DeadEnum.isAlive;
         }
         PlayerManager.CheckEquipedItems(this.equip,player._inventory._items,true);
         this.TorunamentRulesCheck(room,this.equip);
         slot._equip = this.equip;
         if ((this.WeaponsFlag & 8) > 0)
         {
             this.insertItem(this.equip._primary,slot);
         }
         if ((this.WeaponsFlag & 4) > 0)
         {
             this.insertItem(this.equip._secondary,slot);
         }
         if ((this.WeaponsFlag & 2) > 0)
         {
             this.insertItem(this.equip._melee,slot);
         }
         if ((this.WeaponsFlag & 1) > 0)
         {
             this.insertItem(this.equip._grenade,slot);
         }
         this.insertItem(this.equip._special,slot);
         if (slot._team == 0)
         {
             this.insertItem(this.equip._red,slot);
         }
         else
         {
             this.insertItem(this.equip._blue,slot);
         }
         this.insertItem(this.equip._helmet,slot);
         this.insertItem(this.equip._beret,slot);
         this.insertItem(this.equip._dino,slot);
         using (BATTLE_RESPAWN_PAK battleRespawnPak = new BATTLE_RESPAWN_PAK(room,slot))
             room.SendPacketToPlayers((SendPacket)battleRespawnPak,SLOT_STATE.BATTLE,0);
         if (slot.firstRespawn)
         {
             slot.firstRespawn = false;
             Game_SyncNet.SendUDPPlayerSync(room,slot,player.effects,0);
         }
         else
         {
             Game_SyncNet.SendUDPPlayerSync(room,slot,player.effects,2);
         }
         if ((int)room.weaponsFlag == this.WeaponsFlag)
         {
             return;
         }
         Logger.warning("Room: " + (object)room.weaponsFlag + "; Player: " + (object)this.WeaponsFlag);
     }
     catch (Exception ex)
     {
         Logger.warning("[BATTLE_RESPAWN_REC] " + ex.ToString());
     }
 }