You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My bots started behaving odd after running for a while - TradeOfferAccepted , TradeOfferNeedsConfirmation etc was beeing fired multiple times on the same offer. At first i thought it might be related to some threading i have implemented but im pretty sure its not.
One of the major issues with this was that when TradeOfferNeedsConfirmation was beeing called 2nd time it would fail (because it was allready confirmed 1st time this code ran) .. and because of this it would instantly cancel the trade.
i narrowed the problem down to the code in UserWebLogOn() beeing flawed i think:
here it creates a new tradeoffers handler every time it logs in, and hooks up the functions , but it does not take into account that it might be a re-login. so the old tradeoffers handler (this is running on its own thread) keeps running in the background causing double polling of the offers.
a quick fix is to simply add the following code before hooking up the new tradeOffers object :
if (TradeOffers != null)
{
TradeOffers.StopCheckingPendingTradeOffers();
}
im pretty sure this will cause the background threads to all exit ok, but there might be better cleanup needed.
The text was updated successfully, but these errors were encountered:
My bots started behaving odd after running for a while - TradeOfferAccepted , TradeOfferNeedsConfirmation etc was beeing fired multiple times on the same offer. At first i thought it might be related to some threading i have implemented but im pretty sure its not.
One of the major issues with this was that when TradeOfferNeedsConfirmation was beeing called 2nd time it would fail (because it was allready confirmed 1st time this code ran) .. and because of this it would instantly cancel the trade.
i narrowed the problem down to the code in UserWebLogOn() beeing flawed i think:
here it creates a new tradeoffers handler every time it logs in, and hooks up the functions , but it does not take into account that it might be a re-login. so the old tradeoffers handler (this is running on its own thread) keeps running in the background causing double polling of the offers.
a quick fix is to simply add the following code before hooking up the new tradeOffers object :
if (TradeOffers != null)
{
TradeOffers.StopCheckingPendingTradeOffers();
}
im pretty sure this will cause the background threads to all exit ok, but there might be better cleanup needed.
The text was updated successfully, but these errors were encountered: