Actually close SNES connection on invalid rom. (#69)
This nicely makes it also attempt to reconnect in 5 seconds alongside the client to server.
This commit is contained in:
parent
e60f20ef44
commit
6b47a69966
|
@ -675,8 +675,8 @@ async def process_server_cmd(ctx : Context, cmd, args):
|
||||||
ctx.password = None
|
ctx.password = None
|
||||||
await server_auth(ctx, True)
|
await server_auth(ctx, True)
|
||||||
if 'InvalidRom' in args:
|
if 'InvalidRom' in args:
|
||||||
ctx.snes_state = SNES_DISCONNECTED
|
if ctx.snes_socket is not None and not ctx.snes_socket.closed:
|
||||||
ctx.rom = None
|
asyncio.create_task(ctx.snes_socket.close())
|
||||||
raise Exception(
|
raise Exception(
|
||||||
'Invalid ROM detected, please verify that you have loaded the correct rom and reconnect your snes (/snes)')
|
'Invalid ROM detected, please verify that you have loaded the correct rom and reconnect your snes (/snes)')
|
||||||
if 'SlotAlreadyTaken' in args:
|
if 'SlotAlreadyTaken' in args:
|
||||||
|
|
Loading…
Reference in New Issue