From 1a60d263ff6fcc5f496a49e85945fc947620b0f7 Mon Sep 17 00:00:00 2001 From: Bonta-kun <40473493+Bonta0@users.noreply.github.com> Date: Tue, 10 Dec 2019 03:01:13 +0100 Subject: [PATCH] client: accept rom names smaller than 21b --- MultiClient.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MultiClient.py b/MultiClient.py index a112715c..cd9c997b 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -621,12 +621,13 @@ async def process_server_cmd(ctx : Context, cmd, args): if cmd == 'Connected': ctx.expected_rom = args - if ctx.last_rom == ctx.expected_rom: - rom_confirmed(ctx) - if ctx.locations_checked: - await send_msgs(ctx.socket, [['LocationChecks', [Regions.location_table[loc][0] for loc in ctx.locations_checked]]]) - elif ctx.last_rom is not None: - raise Exception('Different ROM expected from server') + if ctx.last_rom is not None: + if ctx.last_rom[:len(args)] == ctx.expected_rom: + rom_confirmed(ctx) + if ctx.locations_checked: + await send_msgs(ctx.socket, [['LocationChecks', [Regions.location_table[loc][0] for loc in ctx.locations_checked]]]) + else: + raise Exception('Different ROM expected from server') if cmd == 'ReceivedItems': start_index, items = args @@ -829,7 +830,7 @@ async def game_watcher(ctx : Context): ctx.last_rom = list(rom) ctx.locations_checked = set() if ctx.expected_rom is not None: - if ctx.last_rom != ctx.expected_rom: + if ctx.last_rom[:len(ctx.expected_rom)] != ctx.expected_rom: print("Wrong ROM detected") await ctx.snes_socket.close() continue