Пример #1
0
        private int?GetItemSlot(ulong itemid, int appid, long contextid, int amount, bool iscurrency)
        {
            var item = new GenericInventory.GenericItem(appid, contextid, itemid, amount, iscurrency);

            foreach (int slot in steamMyOfferedItems.Keys)
            {
                if (steamMyOfferedItems[slot].Equals(item))
                {
                    return(slot);
                }
            }
            return(null);
        }
Пример #2
0
        private void CopyNewAssets(List <GenericInventory.GenericItem> dest, IEnumerable <TradeUserAssets> assetList)
        {
            if (assetList == null)
            {
                return;
            }

            dest.Clear();
            foreach (var asset in assetList)
            {
                var genericItem = new GenericInventory.GenericItem(asset.appid, asset.contextid, asset.assetid, asset.amount, asset.iscurrency);
                dest.Add(genericItem);
            }
        }
Пример #3
0
        public bool AddItem(TradeUserAssets item)
        {
            var slot = NextTradeSlot();

            bool success = false;

            if (item.iscurrency)
            {
                success = RetryWebRequest(() => session.AddCurrencyWebCmd(item.assetid, item.amount, item.appid, item.contextid));
            }
            else
            {
                success = RetryWebRequest(() => session.AddItemWebCmd(item.assetid, slot, item.appid, item.contextid, item.amount));
            }

            if (success)
            {
                steamMyOfferedItems[slot] = new GenericInventory.GenericItem(item.appid, item.contextid, item.assetid, item.amount, item.iscurrency);
            }

            return(success);
        }