From 6b47a69966e8721e7a6357606ef3ee8c462a1c93 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Thu, 16 Apr 2020 15:23:08 -0700 Subject: [PATCH] Actually close SNES connection on invalid rom. (#69) This nicely makes it also attempt to reconnect in 5 seconds alongside the client to server. --- MultiClient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MultiClient.py b/MultiClient.py index 22a86c35..1ab66cb2 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -675,8 +675,8 @@ async def process_server_cmd(ctx : Context, cmd, args): ctx.password = None await server_auth(ctx, True) if 'InvalidRom' in args: - ctx.snes_state = SNES_DISCONNECTED - ctx.rom = None + if ctx.snes_socket is not None and not ctx.snes_socket.closed: + asyncio.create_task(ctx.snes_socket.close()) raise Exception( 'Invalid ROM detected, please verify that you have loaded the correct rom and reconnect your snes (/snes)') if 'SlotAlreadyTaken' in args: