public void TradeAccept() { if (OtherSID == MainSID || OtherSID == CrateSID) { Thread.Sleep(100); Success = AcceptTrade(); if (Success) { Log.Success("Trade was Successful!"); totalAdded += Trade.OtherOfferedItems.Count; TradeReadyBots.Remove(mySteamID); //Trade.Poll(); //Bot.StopBot(); } else { Log.Warn("Trade might have failed."); Bot.GetInventory(); int ItemsLeft = 0; if (ManageCrates) { ItemsLeft = GetTradeItems(Bot.OtherInventory, TransferCrates).Count; } else { ItemsLeft = GetTradeItems(Bot.OtherInventory, 0).Count; } if (ItemsLeft > 0) { Log.Warn("Bot has no items, trade may have succeeded. Removing bot."); TradeReadyBots.Remove(mySteamID); CancelTrade(); Log.Warn("[Receiving] TRADE CLOSED"); Bot.CloseTrade(); Bot.StopBot(); } } } else if (IsAdmin) { if (AcceptTrade()) { totalAdded += Trade.OtherOfferedItems.Count; Log.Success("Trade was Successful!"); } else { Log.Warn("Trade might have failed."); // Going to wait a little while to give the other bot time to finish prep if necessary. Thread.Sleep(1000); } OnTradeClose(); } }
public void OnDisconnected(SteamClient.DisconnectedCallback e) { if (Bot.IsLoggedIn) { Bot.IsLoggedIn = false; Bot.CloseTrade(); Log.Warn("Disconnected from Steam Network!"); } Bot.SteamClient.Connect(); }
public void OnTradeResult(SteamTrading.TradeResultCallback e) { if (e.Response == EEconTradeResponse.Accepted) { Log.Debug("Trade Status: {0}", e.Response); Log.Success("Trade Accepted!"); Bot._getUserHandler(e.OtherClient).OnTradeRequestReply(true, e.Response.ToString()); } else { Log.Warn("Trade failed: {0}", e.Response); Bot.CloseTrade(); Bot._getUserHandler(e.OtherClient).OnTradeRequestReply(false, e.Response.ToString()); } }
public override void OnTradeClose() { Log.Warn("[Receiving] TRADE CLOSED"); Bot.CloseTrade(); Thread.Sleep(150); if (OtherSID != MainSID && OtherSID != CrateSID) { if (TradeReadyBots.Count > 0) { BeginNextTrade(TradeReadyBots[0]); } else if (BotItemMap.Count < NumberOfBots) { // Wait for the rest of the bots while ((TradeReadyBots.Count == 0) && (BotItemMap.Count < NumberOfBots)) { Log.Info("Waiting for bots..."); Log.Debug("Bot count: " + BotItemMap.Count + " of " + NumberOfBots); Thread.Sleep(1000); } if (TradeReadyBots.Count > 0) { BeginNextTrade(TradeReadyBots[0]); } else { Log.Info("Trade List is empty"); Log.Success("All Bots have traded. Items moved: " + totalAdded); FinishTrades(); } } else { Log.Info("Trade List is empty"); Log.Success("All Bots have traded. Items moved: " + totalAdded); FinishTrades(); } } }
public override void OnTradeAccept() { Log.Debug("OnTradeAccept"); if (OtherSID == MainSID || OtherSID == CrateSID) { Log.Warn("[Receiving] TRADE CLOSED"); Bot.CloseTrade(); //Bot.StopBot(); } else if (IsAdmin) { if (AcceptTrade()) { Log.Success("Trade was Successful!"); } else { Log.Warn("Trade might have failed."); // Going to wait a little while to give the other bot time to finish prep if necessary. Thread.Sleep(1000); } } OnTradeClose(); }
public virtual void OnTradeClose() { Bot.CloseTrade(); }
public virtual void OnTradeClose() { Bot.log.Warn("[USERHANDLER] TRADE CLOSED"); Bot.CloseTrade(); }
public override void OnTradeClose() { Log.Warn("[Giving] TRADE CLOSED"); Bot.CloseTrade(); }
public void AddItems() { Log.Info("Getting Inventory"); Bot.GetInventory(); var AllItems = new List <Inventory.Item>(); if (OtherSID == CrateSID) { if (ManageCrates) { AllItems = GetCrates(Bot.MyInventory, TransferCrates); } else { return; } } else if (OtherSID == MainSID) { AllItems = GetTradeItems(Bot.MyInventory, TransferCrates); } else { return; } Log.Debug("Adding items"); uint added = AddItemsFromList(AllItems); if (added > 0 || AllItems.Count == 0) { Log.Info("Added " + added + " items."); System.Threading.Thread.Sleep(50); MeAdded = true; if (!SendMessage("ready")) { CancelTrade(); OnTradeClose(); } } else { Log.Debug("Something's gone wrong."); Bot.GetInventory(); int ItemsLeft = 0; if (ManageCrates) { ItemsLeft = GetTradeItems(Bot.MyInventory, TransferCrates).Count; } else { ItemsLeft = GetTradeItems(Bot.MyInventory, 0).Count; } if (ItemsLeft > 0) { Log.Debug("Still have items to trade, aborting trade."); //errorOcccured = true; CancelTrade(); OnTradeClose(); } else { Log.Debug("No items in bot inventory. This shouldn't be possible."); TradeReadyBots.Remove(mySteamID); CancelTrade(); Log.Warn("[Receiving] TRADE CLOSED"); Bot.CloseTrade(); Bot.StopBot(); } } }