From 5a57519c321e5964e7750070802f4bfa047aa5e6 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Mon, 20 Apr 2020 11:47:50 +0200 Subject: [PATCH] Add count to missing command Add a server's missing command Fix password wasn't able to remove a set password --- MultiClient.py | 11 +++++++++-- MultiServer.py | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/MultiClient.py b/MultiClient.py index 7b7b9c75..13e94b5c 100644 --- a/MultiClient.py +++ b/MultiClient.py @@ -824,10 +824,17 @@ class ClientCommandProcessor(CommandProcessor): get_location_name_from_address(item.location), index, len(self.ctx.items_received))) def _cmd_missing(self): - """List all missing location checks""" + """List all missing location checks, from your local game state""" + count = 0 for location in [k for k, v in Regions.location_table.items() if type(v[0]) is int]: if location not in self.ctx.locations_checked: - logging.info('Missing: ' + location) + self.output('Missing: ' + location) + count += 1 + + if count: + self.output(f"Found {count} missing location checks") + else: + self.output("No missing location checks found.") def _cmd_show_items(self, toggle: str = ""): """Toggle showing of items received across the team""" diff --git a/MultiServer.py b/MultiServer.py index 2375d1e3..e5bb7ee2 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -466,6 +466,20 @@ class ClientMessageProcessor(CommandProcessor): timer = 10 asyncio.create_task(countdown(self.ctx, timer)) + def _cmd_missing(self): + """List all missing location checks from the server's perspective""" + buffer = "" # try not to spam small packets over network + count = 0 + 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]: + buffer += f'Missing: {location_name}\n' + count += 1 + + if buffer: + self.output(buffer + f"Found {count} missing location checks") + else: + self.output("No missing location checks found.") + @mark_raw def _cmd_getitem(self, item_name: str): """Cheat in an item""" @@ -670,7 +684,7 @@ class ServerCommandProcessor(CommandProcessor): self.ctx.running = False @mark_raw - def _cmd_password(self, new_password: str): + def _cmd_password(self, new_password: str = ""): """Set the server password. Leave the password text empty to remove the password""" set_password(self.ctx, new_password if new_password else None)