fix !missing for older clients
This commit is contained in:
		
							parent
							
								
									7353b489ce
								
							
						
					
					
						commit
						3fbb959622
					
				|  | @ -309,7 +309,6 @@ async def countdown(ctx: Context, timer): | ||||||
|             await asyncio.sleep(1) |             await asyncio.sleep(1) | ||||||
|         ctx.notify_all(f'[Server]: GO') |         ctx.notify_all(f'[Server]: GO') | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| async def missing(ctx: Context, client: Client, locations: list): | async def missing(ctx: Context, client: Client, locations: list): | ||||||
|     await ctx.send_msgs(client, [['Missing', { |     await ctx.send_msgs(client, [['Missing', { | ||||||
|         'locations': json.dumps(locations) |         'locations': json.dumps(locations) | ||||||
|  | @ -655,12 +654,19 @@ class ClientMessageProcessor(CommandProcessor): | ||||||
| 
 | 
 | ||||||
|     def _cmd_missing(self) -> bool: |     def _cmd_missing(self) -> bool: | ||||||
|         """List all missing location checks from the server's perspective""" |         """List all missing location checks from the server's perspective""" | ||||||
|  | 
 | ||||||
|         locations = [] |         locations = [] | ||||||
|         for location_id, location_name in Regions.lookup_id_to_name.items():  # cheat console is -1, keep in mind |         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]: |             if location_id != -1 and location_id not in self.ctx.location_checks[self.client.team, self.client.slot]: | ||||||
|                 locations.append(location_name) |                 locations.append(location_name) | ||||||
| 
 | 
 | ||||||
|         if len(locations) > 0: |         if len(locations) > 0: | ||||||
|  |             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)) |                 asyncio.create_task(missing(self.ctx, self.client, locations)) | ||||||
|         else: |         else: | ||||||
|             self.output("No missing location checks found.") |             self.output("No missing location checks found.") | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue