Archipelago
Archipelago copied to clipboard
SNIClient: Attempt to keep game_watcher task alive
What is this fixing or adding?
The most common failure point for SNIClient currently is the death of the game_watcher task, primarily as a result of SNI missing a read and returning None (which is generally improperly handled, but could create issues even with games that attempt to account for this fact). By instead raising a custom exception when a read fails, we can maintain the game_watcher task while still preventing client handlers from continuing.
This also makes it such that if a non-SNI exception is thrown within the game_watcher, the thread is forcibly killed and the error is properly displayed to the user (currently, these errors are only shown in the log and players will not recognize an issue has occurred).
How was this tested?
Several means of unsafe SNI interactions, including:
- Resetting the game during the middle of the client_handler's game_watcher and rom_validation
- Shutting off the console
Additionally a full seed of lx5's MMX randomizer was played using the adjusted client for testing.
No automated testing was added.