MultiServer: fix IncompatibleVersion not triggering

This commit is contained in:
Fabian Dill 2021-11-22 20:32:59 +01:00
parent fbd5bfd382
commit 26b336d6db
2 changed files with 7 additions and 6 deletions

View File

@ -1244,6 +1244,9 @@ async def process_client_cmd(ctx: Context, client: Client, args: dict):
game = ctx.games[slot] game = ctx.games[slot]
if "IgnoreGame" not in args["tags"] and args['game'] != game: if "IgnoreGame" not in args["tags"] and args['game'] != game:
errors.add('InvalidGame') errors.add('InvalidGame')
minver = ctx.minimum_client_versions[slot]
if minver > args['version']:
errors.add('IncompatibleVersion')
# only exact version match allowed # only exact version match allowed
if ctx.compatibility == 0 and args['version'] != version_tuple: if ctx.compatibility == 0 and args['version'] != version_tuple:
@ -1259,9 +1262,7 @@ async def process_client_cmd(ctx: Context, client: Client, args: dict):
client.auth = False # swapping Team/Slot client.auth = False # swapping Team/Slot
client.team = team client.team = team
client.slot = slot client.slot = slot
minver = ctx.minimum_client_versions[slot]
if minver > args['version']:
errors.add('IncompatibleVersion')
ctx.client_ids[client.team, client.slot] = args["uuid"] ctx.client_ids[client.team, client.slot] = args["uuid"]
ctx.clients[team][slot].append(client) ctx.clients[team][slot].append(client)
client.version = args['version'] client.version = args['version']

View File

@ -889,10 +889,10 @@ async def game_watcher(ctx: Context):
if not ctx.rom: if not ctx.rom:
ctx.finished_game = False ctx.finished_game = False
gameName = await snes_read(ctx, SM_ROMNAME_START, 2) game_name = await snes_read(ctx, SM_ROMNAME_START, 2)
if gameName is None: if game_name is None:
continue continue
elif gameName == b"SM": elif game_name == b"SM":
ctx.game = GAME_SM ctx.game = GAME_SM
else: else:
ctx.game = GAME_ALTTP ctx.game = GAME_ALTTP