From 3fbb9596220ba6baa1f9dc92828b46a875c1d739 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Mon, 15 Jun 2020 22:07:43 +0200 Subject: [PATCH] fix !missing for older clients --- MultiServer.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/MultiServer.py b/MultiServer.py index 5efa95a6..9a399b8d 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -309,7 +309,6 @@ async def countdown(ctx: Context, timer): await asyncio.sleep(1) ctx.notify_all(f'[Server]: GO') - async def missing(ctx: Context, client: Client, locations: list): await ctx.send_msgs(client, [['Missing', { 'locations': json.dumps(locations) @@ -655,13 +654,20 @@ class ClientMessageProcessor(CommandProcessor): def _cmd_missing(self) -> bool: """List all missing location checks from the server's perspective""" + locations = [] 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 self.ctx.location_checks[self.client.team, self.client.slot]: locations.append(location_name) if len(locations) > 0: - asyncio.create_task(missing(self.ctx, self.client, locations)) + if self.client.version < [2, 3, 0]: + buffer = "" + for location in locations: + buffer += f'Missing: {location}\n' + self.output(buffer + f"Found {len(locations)} missing location checks") + else: + asyncio.create_task(missing(self.ctx, self.client, locations)) else: self.output("No missing location checks found.") return True