public bool AddItem(TradeUserAssets item) { var slot = NextTradeSlot(); bool success = RetryWebRequest(() => session.AddItemWebCmd(item.assetid, slot, item.appid, item.contextid)); if (success) { myOfferedItemsLocalCopy[slot] = item; } return(success); }
public bool AddItem(TradeUserAssets item) { var slot = NextTradeSlot(); bool ok = session.AddItemWebCmd(item.assetid, slot, item.appid, item.contextid); if (!ok) { throw new TradeException("The Web command to add the Item failed"); } myOfferedItems[slot] = item.assetid; return(true); }
/// <summary> /// Adds a specified item by its itemid. /// </summary> /// <returns><c>false</c> if the item was not found in the inventory.</returns> public bool AddItem(ulong itemid) { if (MyInventory.GetItem(itemid) == null) { return(false); } var slot = NextTradeSlot(); bool ok = session.AddItemWebCmd(itemid, slot); if (!ok) { throw new TradeException("The Web command to add the Item failed"); } myOfferedItems [slot] = itemid; return(true); }
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); }