From 5afe44f9cbe31658f54f25487c3b0ecb210d8f01 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Fri, 15 Jan 2021 03:22:56 +0100 Subject: [PATCH] use multidata locations to get missing checks (in server) --- MultiServer.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/MultiServer.py b/MultiServer.py index 6586fd15..011fca9a 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -964,20 +964,19 @@ class ClientMessageProcessor(CommonCommandProcessor): self.output(response) return False + def get_missing_checks(ctx: Context, client: Client) -> list: - locations = [] - #for location_id in [k[0] for k, v in ctx.locations if k[1] == client.slot]: - # if location_id not in ctx.location_checks[client.team, client.slot]: - # locations.append(Regions.lookup_id_to_name.get(location_id, f'Unknown Location ID: {location_id}')) - for location_id, location_name in Regions.lookup_id_to_name.items(): # cheat console is -1, keep in mind - if location_id != -1 and location_id not in ctx.location_checks[client.team, client.slot] and (location_id, client.slot) in ctx.locations: - locations.append(location_name) - return locations + return [Regions.lookup_id_to_name.get(location_id, f'Unknown Location ID: {location_id}') for + location_id, slot in ctx.locations if + slot == client.slot and + location_id not in ctx.location_checks[client.team, client.slot]] + def get_client_points(ctx: Context, client: Client) -> int: return (ctx.location_check_points * len(ctx.location_checks[client.team, client.slot]) - ctx.hint_cost * ctx.hints_used[client.team, client.slot]) + async def process_client_cmd(ctx: Context, client: Client, cmd, args): if type(cmd) is not str: await ctx.send_msgs(client, [['InvalidCmd']])