forked from Jessecar96/SteamBot
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tradeoffers events get attached multiple times #19
Comments
same here ! my bot check multiple times on the same offer when disconnect and relogin . quick fix is this ? |
Hello , Yes confirmed. This will fix the problem. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: