Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool Validate (TradeOffer offer)
- {
- Log.Warn("getting trade offer items");
- Log.Warn("getting MY offer items");
- if (offer.Items.GetMyItems() != null)
- {
- Bot.GetInventory();
- foreach (var a in offer.Items.GetMyItems())
- {
- Inventory.Item item = null;
- try
- {
- for (int i = 0; i < 5; i++)
- {
- item = Bot.MyInventory.GetItem((ulong)a.AssetId);
- if (item != null) break;
- }
- Log.Info("Defindex:{5}, AppID:{0}, ContextID:{1}, Amount:{2}, AssetID:{3}, CurrencyID:{4}", a.AppId, a.ContextId, a.Amount, a.AssetId, a.CurrencyId, item.Defindex);
- }
- catch (System.Net.WebException e)
- {
- Log.Warn("Failed to get inventory items.");
- //return false;
- }
- }
- }
- Log.Warn("getting THEIR offer items");
- if (offer.Items.GetTheirItems() != null)
- {
- GetOtherInventory();
- foreach (var a in offer.Items.GetTheirItems())
- {
- Inventory.Item item = null;
- try
- {
- for (int i = 0; i < 5; i++)
- {
- item = OtherInventory.GetItem((ulong)a.AssetId);
- if (item != null) break;
- }
- Log.Info("Defindex:{5}, AppID:{0}, ContextID:{1}, Amount:{2}, AssetID:{3}, CurrencyID:{4}", a.AppId, a.ContextId, a.Amount, a.AssetId, a.CurrencyId, item.Defindex);
- }
- catch (System.Net.WebException e)
- {
- Log.Warn("Failed to get inventory items.");
- //return false;
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement