ztizzlegaming / CSGOWinBig

Open-source Counter-Strike: Global Offensive jackpot betting website.
MIT License
169 stars 104 forks source link

Invalid Trade Link #184

Open IBeRamen opened 8 years ago

IBeRamen commented 8 years ago

If a user does not have an updated trade link the bot crashes attempting to send the trade offer to an outdated trade link (Steam API error 404).

I was thinking of adding a function in the bot DepositTradeOfferUserHandler.cs that keeps the items with the bot, logs which items were supposed to be sent and the user with the outdated link has to submit a support ticket to get the items he won because his trade link was out of date.

Would that be the best way of handling this or does anyone think there is a better way?

andrewda commented 8 years ago

I think this is probably the best way, besides having the bot periodically going through the database of unsent offers and attempting to send them if the link has been updated.

IBeRamen commented 8 years ago

Currently testing to see if this fixes it:

else if (errorResponse.StatusCode == HttpStatusCode.NotFound) { Bot.CloseTrade(); Log.Error("User has an invalid Steam Trade Link."); }

Right after the if statement line 391 in DepositTradeOfferUserHandler.cs

IBeRamen commented 8 years ago

I found a better way of doing this. Here is the modified code for DepositTradeOfferUserHandler.cs

Pastebin