From b0c1a7acce61fc6b64a34a624cc593c31855ac8c Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Mon, 12 Jul 2021 20:07:02 +0200 Subject: [PATCH] Remove remaining ALTTP import from CommonClient.py and fix /missing in FactorioClient.py --- CommonClient.py | 7 ++++--- FactorioClient.py | 1 + LttPClient.py | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CommonClient.py b/CommonClient.py index 3ff87aad..70201921 100644 --- a/CommonClient.py +++ b/CommonClient.py @@ -14,8 +14,7 @@ from Utils import Version # logging note: # logging.* gets send to only the text console, logger.* gets send to the WebUI as well, if it's initialized. -from worlds import network_data_package -from worlds.alttp import Items, Regions +from worlds import network_data_package, AutoWorldRegister logger = logging.getLogger("Client") @@ -54,7 +53,7 @@ class ClientCommandProcessor(CommandProcessor): """List all missing location checks, from your local game state""" count = 0 checked_count = 0 - for location, location_id in Regions.lookup_name_to_id.items(): + for location, location_id in AutoWorldRegister.world_types[self.ctx.game].item_name_to_id.items(): if location_id < 0: continue if location_id not in self.ctx.locations_checked: @@ -92,6 +91,8 @@ class CommonContext(): starting_reconnect_delay = 5 current_reconnect_delay = starting_reconnect_delay command_processor = ClientCommandProcessor + game: None + def __init__(self, server_address, password, found_items: bool): # server state self.server_address = server_address diff --git a/FactorioClient.py b/FactorioClient.py index 9babdc72..925c3f6f 100644 --- a/FactorioClient.py +++ b/FactorioClient.py @@ -64,6 +64,7 @@ class FactorioCommandProcessor(ClientCommandProcessor): class FactorioContext(CommonContext): command_processor = FactorioCommandProcessor + game = "Factorio" def __init__(self, *args, **kwargs): super(FactorioContext, self).__init__(*args, **kwargs) diff --git a/LttPClient.py b/LttPClient.py index 83cf5273..6a4060b3 100644 --- a/LttPClient.py +++ b/LttPClient.py @@ -57,6 +57,8 @@ class LttPCommandProcessor(ClientCommandProcessor): class Context(CommonContext): command_processor = LttPCommandProcessor + game = "A Link to the Past" + def __init__(self, snes_address, server_address, password, found_items): super(Context, self).__init__(server_address, password, found_items)