-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Unexpected halts and Unhandled exception raised while handling message #518
Comments
Even weirder is, sometimes the bot just stops, no clue why and no steps to reproduce as its seemingly random |
Hey! Im having the exact same issue. Did you find the solution or any leads? |
Might help. |
Idk if the issue you mentioned is going to fix it 100%, since i think its not returning None anywhere, maybe i have to choose a random move in the outer most except block? |
For my code, the sentchoice NotImplementedError occurred when players have the same usernames as those in previous unfinished battles. For some reason they rejoin these old battle rooms and battle in them. I do not know why they do this. The rejoining previous rooms happens fairly regularly, but I believe the error only occurs when the room is deemed inactive. The player tries to send an action choice for the inactive battle, which results in the error. As for the other RunTimeErrors, I have not seen any of them. |
I found what was causing the sentchoice NotImplementedError. You need to call .close() on the gym environment when done using it, always. If your run crashes or otherwise ends before calling .close() on all gym environments you started, it will leave all unfinished battles open, with no easy way of closing them. This results in my previously mentioned behavior, where players with the same usernames as those in the unfinished battle will rejoin the unfinished battle and cause the sentchoice NotImplementedError. |
I'm not using a gym environment but experiencing this issue, is there any way of just cleaning up all battles when turning the bot back on? |
Not that I know of, but I'm working on a solution right now. I think an if statement may be added to Player's _handle_battle_message before it creates a battle object, after line 255. This should ignore battle object creation if the battle was created before the Player, using the UNIX timestamp |t:| provided by showdown in the battle's initialization message. This way the player never recognizes battles made before it. |
This happens in two cases:
Here's the error message:
My custom player code is the following:
and the functions from "utils"
The text was updated successfully, but these errors were encountered: