예제 #1
0
        private bool ClassicModeCheck(Account p, Room room)
        {
            if (!room.name.ToLower().Contains("@camp") && !room.name.ToLower().Contains("camp") && (!room.name.ToLower().Contains("@cnpb") && !room.name.ToLower().Contains("cnpb")) && (!room.name.ToLower().Contains("@79") && !room.name.ToLower().Contains("79") && (!room.name.ToLower().Contains("@Lan") && !room.name.ToLower().Contains("@lan"))))
            {
                return(false);
            }
            List <string>      list  = new List <string>();
            PlayerEquipedItems equip = p._equip;

            if (room.name.ToLower().Contains("@camp") || room.name.ToLower().Contains(" @camp") || (room.name.ToLower().Contains("@camp ") || room.name.ToLower().Contains("camp")))
            {
                for (int index = 0; index < TorunamentRulesManager.itemscamp.Count; ++index)
                {
                    int listid = TorunamentRulesManager.itemscamp[index];
                    if (!TorunamentRulesManager.IsBlocked(listid, equip._primary, ref list, Translation.GetLabel("ClassicCategory1")) && !TorunamentRulesManager.IsBlocked(listid, equip._secondary, ref list, Translation.GetLabel("ClassicCategory2")) && (!TorunamentRulesManager.IsBlocked(listid, equip._melee, ref list, Translation.GetLabel("ClassicCategory3")) && !TorunamentRulesManager.IsBlocked(listid, equip._grenade, ref list, Translation.GetLabel("ClassicCategory4"))) && (!TorunamentRulesManager.IsBlocked(listid, equip._special, ref list, Translation.GetLabel("ClassicCategory5")) && !TorunamentRulesManager.IsBlocked(listid, equip._red, ref list, Translation.GetLabel("ClassicCategory6")) && (!TorunamentRulesManager.IsBlocked(listid, equip._blue, ref list, Translation.GetLabel("ClassicCategory7")) && !TorunamentRulesManager.IsBlocked(listid, equip._helmet, ref list, Translation.GetLabel("ClassicCategory8")))) && !TorunamentRulesManager.IsBlocked(listid, equip._dino, ref list, Translation.GetLabel("ClassicCategory9")))
                    {
                        TorunamentRulesManager.IsBlocked(listid, equip._beret, ref list, Translation.GetLabel("ClassicCategory10"));
                    }
                }
            }
            if (room.name.ToLower().Contains("@cnpb") || room.name.ToLower().Contains("@cnpb ") || (room.name.ToLower().Contains(" @cnpb") || room.name.ToLower().Contains("cnpb")))
            {
                for (int index = 0; index < TorunamentRulesManager.itemscnpb.Count; ++index)
                {
                    int listid = TorunamentRulesManager.itemscnpb[index];
                    if (!TorunamentRulesManager.IsBlocked(listid, equip._primary, ref list, Translation.GetLabel("ClassicCategory1")) && !TorunamentRulesManager.IsBlocked(listid, equip._secondary, ref list, Translation.GetLabel("ClassicCategory2")) && (!TorunamentRulesManager.IsBlocked(listid, equip._melee, ref list, Translation.GetLabel("ClassicCategory3")) && !TorunamentRulesManager.IsBlocked(listid, equip._grenade, ref list, Translation.GetLabel("ClassicCategory4"))) && (!TorunamentRulesManager.IsBlocked(listid, equip._special, ref list, Translation.GetLabel("ClassicCategory5")) && !TorunamentRulesManager.IsBlocked(listid, equip._red, ref list, Translation.GetLabel("ClassicCategory6")) && (!TorunamentRulesManager.IsBlocked(listid, equip._blue, ref list, Translation.GetLabel("ClassicCategory7")) && !TorunamentRulesManager.IsBlocked(listid, equip._helmet, ref list, Translation.GetLabel("ClassicCategory8")))) && !TorunamentRulesManager.IsBlocked(listid, equip._dino, ref list, Translation.GetLabel("ClassicCategory9")))
                    {
                        TorunamentRulesManager.IsBlocked(listid, equip._beret, ref list, Translation.GetLabel("ClassicCategory10"));
                    }
                }
            }
            if (room.name.ToLower().Contains("@79") || room.name.ToLower().Contains("@79") || (room.name.ToLower().Contains(" @79") || room.name.ToLower().Contains("79")))
            {
                for (int index = 0; index < TorunamentRulesManager.items79.Count; ++index)
                {
                    int listid = TorunamentRulesManager.items79[index];
                    if (!TorunamentRulesManager.IsBlocked(listid, equip._primary, ref list, Translation.GetLabel("ClassicCategory1")) && !TorunamentRulesManager.IsBlocked(listid, equip._secondary, ref list, Translation.GetLabel("ClassicCategory2")) && (!TorunamentRulesManager.IsBlocked(listid, equip._melee, ref list, Translation.GetLabel("ClassicCategory3")) && !TorunamentRulesManager.IsBlocked(listid, equip._grenade, ref list, Translation.GetLabel("ClassicCategory4"))) && (!TorunamentRulesManager.IsBlocked(listid, equip._special, ref list, Translation.GetLabel("ClassicCategory5")) && !TorunamentRulesManager.IsBlocked(listid, equip._red, ref list, Translation.GetLabel("ClassicCategory6")) && (!TorunamentRulesManager.IsBlocked(listid, equip._blue, ref list, Translation.GetLabel("ClassicCategory7")) && !TorunamentRulesManager.IsBlocked(listid, equip._helmet, ref list, Translation.GetLabel("ClassicCategory8")))) && !TorunamentRulesManager.IsBlocked(listid, equip._dino, ref list, Translation.GetLabel("ClassicCategory9")))
                    {
                        TorunamentRulesManager.IsBlocked(listid, equip._beret, ref list, Translation.GetLabel("ClassicCategory10"));
                    }
                }
            }
            if (room.name.ToLower().Contains("@lan") || room.name.ToLower().Contains("@Lan"))
            {
                for (int index = 0; index < TorunamentRulesManager.itemslan.Count; ++index)
                {
                    int listid = TorunamentRulesManager.itemslan[index];
                    if (!TorunamentRulesManager.IsBlocked(listid, equip._primary, ref list, Translation.GetLabel("ClassicCategory1")) && !TorunamentRulesManager.IsBlocked(listid, equip._secondary, ref list, Translation.GetLabel("ClassicCategory2")) && (!TorunamentRulesManager.IsBlocked(listid, equip._melee, ref list, Translation.GetLabel("ClassicCategory3")) && !TorunamentRulesManager.IsBlocked(listid, equip._grenade, ref list, Translation.GetLabel("ClassicCategory4"))) && (!TorunamentRulesManager.IsBlocked(listid, equip._special, ref list, Translation.GetLabel("ClassicCategory5")) && !TorunamentRulesManager.IsBlocked(listid, equip._red, ref list, Translation.GetLabel("ClassicCategory6")) && (!TorunamentRulesManager.IsBlocked(listid, equip._blue, ref list, Translation.GetLabel("ClassicCategory7")) && !TorunamentRulesManager.IsBlocked(listid, equip._helmet, ref list, Translation.GetLabel("ClassicCategory8")))) && !TorunamentRulesManager.IsBlocked(listid, equip._dino, ref list, Translation.GetLabel("ClassicCategory9")))
                    {
                        TorunamentRulesManager.IsBlocked(listid, equip._beret, ref list, Translation.GetLabel("ClassicCategory10"));
                    }
                }
            }
            if (list.Count <= 0)
            {
                return(false);
            }
            p.SendPacket((SendPacket) new SERVER_MESSAGE_ANNOUNCE_PAK(Translation.GetLabel("ClassicModeWarn", (object)string.Join(", ", list.ToArray()))));
            return(true);
        }
예제 #2
0
 private bool CheckTournamentRules(Account player, string roomName)
 {
     if (TournamentRulesManager.CheckRoomRule(roomName))
     {
         PlayerEquipedItems equip  = player.equipments;
         List <string>      blocks = new List <string>();
         if (TournamentRulesManager.IsBlocked(roomName, equip.primary))
         {
             blocks.Add("Primária");
         }
         if (TournamentRulesManager.IsBlocked(roomName, equip.secondary))
         {
             blocks.Add("Secundária");
         }
         if (TournamentRulesManager.IsBlocked(roomName, equip.melee))
         {
             blocks.Add("Arma branca");
         }
         if (TournamentRulesManager.IsBlocked(roomName, equip.grenade))
         {
             blocks.Add("Granada");
         }
         if (TournamentRulesManager.IsBlocked(roomName, equip.special))
         {
             blocks.Add("Especial");
         }
         if (TournamentRulesManager.IsBlocked(roomName, equip.red))
         {
             blocks.Add("Pers. Vermelho");
         }
         if (TournamentRulesManager.IsBlocked(roomName, equip.blue))
         {
             blocks.Add("Pers. Azul");
         }
         int ItemClassType = Utilities.GetItemIdClass(equip.helmet);
         if (TournamentRulesManager.IsBlocked(roomName, equip.helmet) || ItemClassType == 110400 || ItemClassType == 110500)
         {
             blocks.Add("Capacete");
         }
         if (TournamentRulesManager.IsBlocked(roomName, equip.beret))
         {
             blocks.Add("Boina");
         }
         if (blocks.Count > 0)
         {
             string message = string.Format("Não é possível jogar devido a regra @CAMP.\nItens não aceitos:  {0}", string.Join(", ", blocks.ToArray()));
             player.SendPacket(new SERVER_MESSAGE_ANNOUNCE_PAK(message));
             return(true);
         }
     }
     return(false);
 }
 public override void run()
 {
     try
     {
         if (_client == null)
         {
             return;
         }
         Account p = _client._player;
         if (p == null)
         {
             return;
         }
         data = new PlayerEquipedItems();
         DBQuery query = new DBQuery();
         if ((type & 1) == 1)
         {
             LoadCharaData(p, query);
         }
         if ((type & 2) == 2)
         {
             LoadWeaponsData(p, query);
         }
         if (ComDiv.updateDB("contas", "player_id", p.player_id, query.GetTables(), query.GetValues()))
         {
             UpdateChara(p);
             UpdateWeapons(p);
         }
         query = null;
         Room room = p._room;
         if (room != null)
         {
             if (type > 0)
             {
                 AllUtils.updateSlotEquips(p, room);
             }
             room.changeSlotState(p._slotId, SLOT_STATE.NORMAL, true);
         }
         _client.SendPacket(new SHOP_LEAVE_PAK());
         if (erro > 0)
         {
             _client.SendPacket(new INVENTORY_EQUIPED_ITEMS_PAK(p, 3));
         }
     }
     catch (Exception ex)
     {
         SaveLog.fatal(ex.ToString());
         Printf.b_danger("[SHOP_LEAVE_REC.run] Erro fatal!");
     }
 }
예제 #4
0
 public void SimpleClear()
 {
     _config      = null;
     _titles      = null;
     _bonus       = null;
     _event       = null;
     _connection  = null;
     _inventory   = new PlayerInventory();
     FriendSystem = new FriendSystem();
     _clanPlayers = new List <Account>();
     _equip       = new PlayerEquipedItems();
     _mission     = new PlayerMissions();
     _status      = new AccountStatus();
 }
예제 #5
0
 public void SimpleClear()
 {
     this._config      = (PlayerConfig)null;
     this._titles      = (PlayerTitles)null;
     this._bonus       = (PlayerBonus)null;
     this._event       = (PlayerEvent)null;
     this._connection  = (LoginClient)null;
     this._inventory   = new PlayerInventory();
     this.FriendSystem = new FriendSystem();
     this._clanPlayers = new List <Account>();
     this._equip       = new PlayerEquipedItems();
     this._mission     = new PlayerMissions();
     this._status      = new AccountStatus();
 }
예제 #6
0
 public override void run()
 {
     try
     {
         if (this._client == null)
         {
             return;
         }
         Account player = this._client._player;
         if (player == null)
         {
             return;
         }
         this.data = new PlayerEquipedItems();
         DBQuery query = new DBQuery();
         if ((this.type & 1) == 1)
         {
             this.LoadCharaData(player, query);
         }
         if ((this.type & 2) == 2)
         {
             this.LoadWeaponsData(player, query);
         }
         if (ComDiv.updateDB("accounts", "player_id", (object)player.player_id, query.GetTables(), query.GetValues()))
         {
             this.UpdateChara(player);
             this.UpdateWeapons(player);
         }
         Room room = player._room;
         if (room != null)
         {
             if (this.type > 0)
             {
                 AllUtils.updateSlotEquips(player, room);
             }
             room.changeSlotState(player._slotId, SLOT_STATE.NORMAL, true);
         }
         this._client.SendPacket((SendPacket) new SHOP_LEAVE_PAK());
         if (this.erro <= 0)
         {
             return;
         }
         this._client.SendPacket((SendPacket) new INVENTORY_EQUIPED_ITEMS_PAK(player, 3));
     }
     catch (Exception ex)
     {
         Logger.info("SHOP_LEAVE_REC: " + ex.ToString());
     }
 }
예제 #7
0
 public override void read()
 {
     equip            = new PlayerEquipedItems();
     equip._primary   = readD();
     equip._secondary = readD();
     equip._melee     = readD();
     equip._grenade   = readD();
     equip._special   = readD();
     readD();
     equip._red    = readD();
     equip._blue   = readD();
     equip._helmet = readD();
     equip._beret  = readD();
     equip._dino   = readD();
     WeaponsFlag   = readC();
 }
예제 #8
0
 public override void read()
 {
     this.equip            = new PlayerEquipedItems();
     this.equip._primary   = this.readD();
     this.equip._secondary = this.readD();
     this.equip._melee     = this.readD();
     this.equip._grenade   = this.readD();
     this.equip._special   = this.readD();
     this.readD();
     this.equip._red    = this.readD();
     this.equip._blue   = this.readD();
     this.equip._helmet = this.readD();
     this.equip._beret  = this.readD();
     this.equip._dino   = this.readD();
     this.WeaponsFlag   = (int)this.readC();
 }
예제 #9
0
 public override void ReadImplement()
 {
     equipment = new PlayerEquipedItems
     {
         primary   = ReadInt(),
         secondary = ReadInt(),
         melee     = ReadInt(),
         grenade   = ReadInt(),
         special   = ReadInt()
     };
     ReadInt(); //slot do equipment?
     equipment.red    = ReadInt();
     equipment.blue   = ReadInt();
     equipment.helmet = ReadInt();
     equipment.beret  = ReadInt();
     equipment.dino   = ReadInt();
     WeaponsFlag      = ReadByte();
 }
예제 #10
0
 public INVENTORY_EQUIPED_ITEMS_PAK(Account player, int type)
 {
     this.type = (InventoryFlag)type;
     equip     = player.equipments;
 }
예제 #11
0
        private void ClassicModeCheck(string sala,PlayerEquipedItems equip,Account p)
        {
            string t = "";

            if (sala.Contains("@camp"))
            {
                for (int i = 0; i < ClassicModeManager.itemscamp.Count; i++)
                {
                    int id = ClassicModeManager.itemscamp[i];
                    if (equip._primary != 200004006 && id == equip._primary)
                    {
                        equip._primary = 200004006; t = "CAMP";
                    }

                    if (equip._secondary != 601002003 && id == equip._secondary)
                    {
                        equip._secondary = 601002003; t = "CAMP";
                    }

                    if (equip._melee != 702001001 && id == equip._melee)
                    {
                        equip._melee = 702001001; t = "CAMP";
                    }

                    if (equip._grenade != 803007001 && id == equip._grenade)
                    {
                        equip._grenade = 803007001; t = "CAMP";
                    }

                    if (equip._special != 904007002 && id == equip._special)
                    {
                        equip._special = 904007002; t = "CAMP";
                    }
                }
            }
            else if (sala.Contains("@cnpb"))
            {
                for (int i = 0; i < ClassicModeManager.itemscnpb.Count; i++)
                {
                    int id = ClassicModeManager.itemscnpb[i];
                    if (equip._primary != 200004006 && id == equip._primary)
                    {
                        equip._primary = 200004006; t = "CNPB";
                    }

                    if (equip._secondary != 601002003 && id == equip._secondary)
                    {
                        equip._secondary = 601002003; t = "CNPB";
                    }

                    if (equip._melee != 702001001 && id == equip._melee)
                    {
                        equip._melee = 702001001; t = "CNPB";
                    }

                    if (equip._grenade != 803007001 && id == equip._grenade)
                    {
                        equip._grenade = 803007001; t = "CNPB";
                    }

                    if (equip._special != 904007002 && id == equip._special)
                    {
                        equip._special = 904007002; t = "CNPB";
                    }
                }
            }
            else if (sala.Contains("@79"))
            {
                for (int i = 0; i < ClassicModeManager.items79.Count; i++)
                {
                    int id = ClassicModeManager.items79[i];
                    if (equip._primary != 200004006 && id == equip._primary)
                    {
                        equip._primary = 200004006; t = "79";
                    }

                    if (equip._secondary != 601002003 && id == equip._secondary)
                    {
                        equip._secondary = 601002003; t = "79";
                    }

                    if (equip._melee != 702001001 && id == equip._melee)
                    {
                        equip._melee = 702001001; t = "79";
                    }

                    if (equip._grenade != 803007001 && id == equip._grenade)
                    {
                        equip._grenade = 803007001; t = "79";
                    }

                    if (equip._special != 904007002 && id == equip._special)
                    {
                        equip._special = 904007002; t = "79";
                    }
                }
            }
            else // @Lan
            {
                for (int i = 0; i < ClassicModeManager.itemslan.Count; i++)
                {
                    int id = ClassicModeManager.itemslan[i];
                    if (equip._primary != 200004006 && id == equip._primary)
                    {
                        equip._primary = 200004006; t = "LAN";
                    }

                    if (equip._secondary != 601002003 && id == equip._secondary)
                    {
                        equip._secondary = 601002003; t = "LAN";
                    }

                    if (equip._melee != 702001001 && id == equip._melee)
                    {
                        equip._melee = 702001001; t = "LAN";
                    }

                    if (equip._grenade != 803007001 && id == equip._grenade)
                    {
                        equip._grenade = 803007001; t = "LAN";
                    }

                    if (equip._special != 904007002 && id == equip._special)
                    {
                        equip._special = 904007002; t = "LAN";
                    }
                }
            }
            if (t != "")
            {
                p.SendPacket(new LOBBY_CHATTING_PAK("@" + t,p.getSessionId(),0,true,"Arma nao permitida!"));
            }
        }
예제 #12
0
 private void TorunamentRulesCheck(Room room, PlayerEquipedItems equip)
 {
     if (!room.name.ToLower().Contains("@camp") && !room.name.ToLower().Contains("camp") && (!room.name.ToLower().Contains("@cnpb") && !room.name.ToLower().Contains("cnpb")) && (!room.name.ToLower().Contains("@79") && !room.name.ToLower().Contains("79") && (!room.name.ToLower().Contains("@lan") && !room.name.ToLower().Contains("@Lan"))) || !ConfigGS.EnableTournamentRules)
     {
         return;
     }
     if (room.name.ToLower().Contains("@camp") || room.name.ToLower().Contains(" @camp") || (room.name.ToLower().Contains("@camp ") || room.name.ToLower().Contains("camp")))
     {
         for (int index = 0; index < TorunamentRulesManager.itemscamp.Count; ++index)
         {
             int listid = TorunamentRulesManager.itemscamp[index];
             if (TorunamentRulesManager.IsBlocked(listid, equip._primary))
             {
                 equip._primary = 0;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._secondary))
             {
                 equip._secondary = 601002003;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._melee))
             {
                 equip._melee = 702001001;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._grenade))
             {
                 equip._grenade = 803007001;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._special))
             {
                 equip._special = 904007002;
             }
         }
     }
     if (room.name.ToLower().Contains("@cnpb") || room.name.ToLower().Contains("@cnpb ") || (room.name.ToLower().Contains(" @cnpb") || room.name.ToLower().Contains("cnpb")))
     {
         for (int index = 0; index < TorunamentRulesManager.itemscnpb.Count; ++index)
         {
             int listid = TorunamentRulesManager.itemscnpb[index];
             if (TorunamentRulesManager.IsBlocked(listid, equip._primary))
             {
                 equip._primary = 0;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._secondary))
             {
                 equip._secondary = 601002003;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._melee))
             {
                 equip._melee = 702001001;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._grenade))
             {
                 equip._grenade = 803007001;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._special))
             {
                 equip._special = 904007002;
             }
         }
     }
     if (room.name.ToLower().Contains("@79") || room.name.ToLower().Contains("@79") || (room.name.ToLower().Contains(" @79") || room.name.ToLower().Contains("79")))
     {
         for (int index = 0; index < TorunamentRulesManager.items79.Count; ++index)
         {
             int listid = TorunamentRulesManager.items79[index];
             if (TorunamentRulesManager.IsBlocked(listid, equip._primary))
             {
                 equip._primary = 0;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._secondary))
             {
                 equip._secondary = 601002003;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._melee))
             {
                 equip._melee = 702001001;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._grenade))
             {
                 equip._grenade = 803007001;
             }
             else if (TorunamentRulesManager.IsBlocked(listid, equip._special))
             {
                 equip._special = 904007002;
             }
         }
     }
     if (!room.name.ToLower().Contains("@lan") && !room.name.ToLower().Contains("@Lan"))
     {
         return;
     }
     for (int index = 0; index < TorunamentRulesManager.itemslan.Count; ++index)
     {
         int listid = TorunamentRulesManager.itemslan[index];
         if (TorunamentRulesManager.IsBlocked(listid, equip._primary))
         {
             equip._primary = 0;
         }
         else if (TorunamentRulesManager.IsBlocked(listid, equip._secondary))
         {
             equip._secondary = 601002003;
         }
         else if (TorunamentRulesManager.IsBlocked(listid, equip._melee))
         {
             equip._melee = 702001001;
         }
         else if (TorunamentRulesManager.IsBlocked(listid, equip._grenade))
         {
             equip._grenade = 803007001;
         }
         else if (TorunamentRulesManager.IsBlocked(listid, equip._special))
         {
             equip._special = 904007002;
         }
     }
 }
예제 #13
0
 public INVENTORY_EQUIPED_ITEMS_PAK(Account p, int type)
 {
     this.type  = (InventoryFlag)type;
     this.equip = p._equip;
 }
예제 #14
0
 public INVENTORY_EQUIPED_ITEMS_PAK(Account p)
 {
     this.type  = (InventoryFlag)PlayerManager.CheckEquipedItems(p._equip, p._inventory._items, false);
     this.equip = p._equip;
 }
예제 #15
0
        private bool ClassicModeCheck(Account p, Room room) // Regras
        {
            string roomName = room.name.ToLower();

            if (!roomName.Contains("@camp") && !roomName.Contains("@cnpb") && !roomName.Contains("@79") && !roomName.Contains("@lan"))
            {
                return(false);
            }

            List <string>      blocks = new List <string>();
            PlayerEquipedItems equip  = p._equip;

            if (roomName.Contains("@camp"))
            {
                for (int i = 0; i < ClassicModeManager.itemscamp.Count; i++)
                {
                    int id = ClassicModeManager.itemscamp[i];

                    if (id == equip._primary)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat1"));
                    }
                    if (id == equip._secondary)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat2"));
                    }
                    if (id == equip._melee)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat3"));
                    }
                    if (id == equip._grenade)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat4"));
                    }
                    if (id == equip._special)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat5"));
                    }
                    if (id == equip._red)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat6"));
                    }
                    if (id == equip._blue)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat7"));
                    }
                    if (id == equip._helmet)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat8"));
                    }
                    if (id == equip._dino)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat9"));
                    }
                    if (id == equip._beret)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat10"));
                    }
                }
            }
            else if (roomName.Contains("@cnpb"))
            {
                for (int i = 0; i < ClassicModeManager.itemscnpb.Count; i++)
                {
                    int id = ClassicModeManager.itemscnpb[i];
                    if (id == equip._primary)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat1"));
                    }
                    if (id == equip._secondary)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat2"));
                    }
                    if (id == equip._melee)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat3"));
                    }
                    if (id == equip._grenade)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat4"));
                    }
                    if (id == equip._special)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat5"));
                    }
                    if (id == equip._red)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat6"));
                    }
                    if (id == equip._blue)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat7"));
                    }
                    if (id == equip._helmet)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat8"));
                    }
                    if (id == equip._dino)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat9"));
                    }
                    if (id == equip._beret)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat10"));
                    }
                }
            }
            else if (roomName.Contains("@79"))
            {
                for (int i = 0; i < ClassicModeManager.items79.Count; i++)
                {
                    int id = ClassicModeManager.items79[i];
                    if (id == equip._primary)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat1"));
                    }
                    if (id == equip._secondary)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat2"));
                    }
                    if (id == equip._melee)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat3"));
                    }
                    if (id == equip._grenade)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat4"));
                    }
                    if (id == equip._special)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat5"));
                    }
                    if (id == equip._red)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat6"));
                    }
                    if (id == equip._blue)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat7"));
                    }
                    if (id == equip._helmet)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat8"));
                    }
                    if (id == equip._dino)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat9"));
                    }
                    if (id == equip._beret)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat10"));
                    }
                }
            }
            else // @lan
            {
                for (int i = 0; i < ClassicModeManager.itemslan.Count; i++)
                {
                    int id = ClassicModeManager.itemslan[i];
                    if (id == equip._primary)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat1"));
                    }
                    if (id == equip._secondary)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat2"));
                    }
                    if (id == equip._melee)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat3"));
                    }
                    if (id == equip._grenade)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat4"));
                    }
                    if (id == equip._special)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat5"));
                    }
                    if (id == equip._red)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat6"));
                    }
                    if (id == equip._blue)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat7"));
                    }
                    if (id == equip._helmet)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat8"));
                    }
                    if (id == equip._dino)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat9"));
                    }
                    if (id == equip._beret)
                    {
                        blocks.Add(Translation.GetLabel("RulesCat10"));
                    }
                }
            }

            if (blocks.Count > 0)
            {
                p.SendPacket(new SERVER_MESSAGE_ANNOUNCE_PAK(Translation.GetLabel("RulesModeWarn", string.Join(", ", blocks.ToArray()))));
                return(true);
            }
            return(false);
        }
예제 #16
0
 /// <summary>
 /// Gera um pacote que faz uma checagem em todos os itens equipados, comparando-os com o inventário.
 /// </summary>
 /// <param name="player">Conta</param>
 public INVENTORY_EQUIPED_ITEMS_PAK(Account player)
 {
     type  = (InventoryFlag)player.CheckEquipedItems(player.equipments);
     equip = player.equipments;
 }
예제 #17
0
 public override void RunImplement()
 {
     try
     {
         Account  player = client.SessionPlayer;
         DateTime now    = DateTime.Now;
         if (player == null || (now - player.lastInventoryLeave).TotalSeconds < 1)
         {
             return;
         }
         using (DBQuery query = new DBQuery())
         {
             PlayerEquipedItems data = new PlayerEquipedItems();
             if ((type & 1) == 1)
             {
                 data.red    = ReadInt();
                 data.blue   = ReadInt();
                 data.helmet = ReadInt();
                 data.beret  = ReadInt();
                 data.dino   = ReadInt();
                 player.UpdateChars(data, player.equipments, query);
             }
             if ((type & 2) == 2)
             {
                 data.primary   = ReadInt();
                 data.secondary = ReadInt();
                 data.melee     = ReadInt();
                 data.grenade   = ReadInt();
                 data.special   = ReadInt();
                 player.UpdateWeapons(data, player.equipments, query);
             }
             if (Utilities.UpdateDB("accounts", "id", player.playerId, query.GetTables(), query.GetValues()))
             {
                 if ((type & 1) == 1)
                 {
                     player.equipments.red    = data.red;
                     player.equipments.blue   = data.blue;
                     player.equipments.helmet = data.helmet;
                     player.equipments.beret  = data.beret;
                     player.equipments.dino   = data.dino;
                 }
                 if ((type & 2) == 2)
                 {
                     player.equipments.primary   = data.primary;
                     player.equipments.secondary = data.secondary;
                     player.equipments.melee     = data.melee;
                     player.equipments.grenade   = data.grenade;
                     player.equipments.special   = data.special;
                 }
             }
         }
         Room room = player.room;
         if (room != null)
         {
             if (type > 0 && room.GetSlot(player.slotId, out Slot slot))
             {
                 slot.equipment = player.equipments;
             }
             room.ChangeSlotState(player.slotId, SlotStateEnum.NORMAL, true);
         }
         client.SendCompletePacket(PackageDataManager.INVENTORY_LEAVE_PAK);
         client.SendPacket(new INVENTORY_EQUIPED_ITEMS_PAK(player));
         player.lastInventoryLeave = now;
     }
     catch (Exception ex)
     {
         PacketLog(ex);
     }
 }
예제 #18
0
 public PROTOCOL_LOBBY_PLAYER_EQUIPMENTS_ACK(PlayerEquipedItems equipments)
 {
     this.equipments = equipments;
 }