예제 #1
0
        public void RemoveLockerItem(LockerItem li, BaseItem item, bool deleteFromDB)
        {
            _cashItems.RemoveItem(li, item);
            if (item != null)
            {
                RemoveItem(item);
            }

            if (deleteFromDB && li.SavedToDatabase)
            {
                _cashItems.DeletedCashItems.Add(li.CashId);
            }
        }
예제 #2
0
        public void AddItem(LockerItem lockerItem, BaseItem baseItem)
        {
            Items.Add(lockerItem);

            if (baseItem is EquipItem ei)
            {
                Equips.Add(ei);
            }
            else if (baseItem is BundleItem bi)
            {
                Bundles.Add(bi);
            }
            else if (baseItem is PetItem pi)
            {
                Pets.Add(pi);
            }
        }
예제 #3
0
        public void RemoveItem(LockerItem lockerItem, BaseItem baseItem)
        {
            Items.Remove(lockerItem);

            if (baseItem is EquipItem ei)
            {
                Equips.Remove(ei);
            }
            else if (baseItem is BundleItem bi)
            {
                Bundles.Remove(bi);
            }
            else if (baseItem is PetItem pi)
            {
                Pets.Remove(pi);
            }
        }
예제 #4
0
 private static IEnumerable <LockerItem> GetLocker(int userId, int characterId)
 {
     using (var data = Connection.RunQuery(
                "SELECT * FROM itemlocker WHERE userid = @userid AND characterid = @charid AND worldid = @worldid ORDER BY slot ASC LIMIT 400",
                "@userid", userId,
                "@worldid", WorldID,
                "@charid", characterId
                ) as MySqlDataReader)
     {
         while (data.Read())
         {
             var lockerItem = new LockerItem(data);
             lockerItem.SavedToDatabase = true;
             Console.WriteLine("Loading item {0} cashid {1}", lockerItem.ItemId, lockerItem.CashId);
             yield return(lockerItem);
         }
     }
 }
예제 #5
0
 public void AddLockerItem(LockerItem item)
 {
     _cashItems.Items.Add(item);
 }