From bb16fe284ad19304d800a7d99d9d3b71626268c5 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 23 Apr 2024 19:05:03 +0200 Subject: [PATCH 1/4] Core: make open_filename log that it's asking (#3199) --- Utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Utils.py b/Utils.py index 6d4462651c89..a35dbf08156a 100644 --- a/Utils.py +++ b/Utils.py @@ -619,6 +619,8 @@ def get_fuzzy_ratio(word1: str, word2: str) -> float: def open_filename(title: str, filetypes: typing.Sequence[typing.Tuple[str, typing.Sequence[str]]], suggest: str = "") \ -> typing.Optional[str]: + logging.info(f"Opening file input dialog for {title}.") + def run(*args: str): return subprocess.run(args, capture_output=True, text=True).stdout.split("\n", 1)[0] or None From cca9778871de67a19fe339b3ade66e4d65eda429 Mon Sep 17 00:00:00 2001 From: Scipio Wright Date: Tue, 23 Apr 2024 13:58:38 -0400 Subject: [PATCH 2/4] Delete worlds/sc2wol directory (#3202) --- worlds/sc2wol/Regions.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 worlds/sc2wol/Regions.py diff --git a/worlds/sc2wol/Regions.py b/worlds/sc2wol/Regions.py deleted file mode 100644 index e69de29bb2d1..000000000000 From 2f78860d8cfc8d445de425a68dc159f80e9f197f Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Wed, 24 Apr 2024 06:24:44 +0200 Subject: [PATCH 3/4] Core/SNIClient/LttP/Factorio: switch to get_settings (#3208) --- MultiServer.py | 2 +- SNIClient.py | 4 ++-- Utils.py | 2 +- worlds/alttp/Rom.py | 4 ++-- worlds/factorio/Client.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/MultiServer.py b/MultiServer.py index bfbed4620218..a92edf7660a9 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -2198,7 +2198,7 @@ async def console(ctx: Context): def parse_args() -> argparse.Namespace: parser = argparse.ArgumentParser() - defaults = Utils.get_options()["server_options"].as_dict() + defaults = Utils.get_settings()["server_options"].as_dict() parser.add_argument('multidata', nargs="?", default=defaults["multidata"]) parser.add_argument('--host', default=defaults["host"]) parser.add_argument('--port', default=defaults["port"], type=int) diff --git a/SNIClient.py b/SNIClient.py index cf4ef758ff7d..9fdddc99a3c3 100644 --- a/SNIClient.py +++ b/SNIClient.py @@ -282,7 +282,7 @@ class SNESState(enum.IntEnum): def launch_sni() -> None: - sni_path = Utils.get_options()["sni_options"]["sni_path"] + sni_path = Utils.get_settings()["sni_options"]["sni_path"] if not os.path.isdir(sni_path): sni_path = Utils.local_path(sni_path) @@ -654,7 +654,7 @@ async def game_watcher(ctx: SNIContext) -> None: async def run_game(romfile: str) -> None: auto_start = typing.cast(typing.Union[bool, str], - Utils.get_options()["sni_options"].get("snes_rom_start", True)) + Utils.get_settings()["sni_options"].get("snes_rom_start", True)) if auto_start is True: import webbrowser webbrowser.open(romfile) diff --git a/Utils.py b/Utils.py index a35dbf08156a..141b1dc7f8c6 100644 --- a/Utils.py +++ b/Utils.py @@ -201,7 +201,7 @@ def cache_path(*path: str) -> str: def output_path(*path: str) -> str: if hasattr(output_path, 'cached_path'): return os.path.join(output_path.cached_path, *path) - output_path.cached_path = user_path(get_options()["general_options"]["output_path"]) + output_path.cached_path = user_path(get_settings()["general_options"]["output_path"]) path = os.path.join(output_path.cached_path, *path) os.makedirs(os.path.dirname(path), exist_ok=True) return path diff --git a/worlds/alttp/Rom.py b/worlds/alttp/Rom.py index 08597cea0474..7c3c87683a37 100644 --- a/worlds/alttp/Rom.py +++ b/worlds/alttp/Rom.py @@ -1859,7 +1859,7 @@ def apply_oof_sfx(rom, oof: str): rom.write_bytes(0x12803A, oof_bytes) rom.write_bytes(0x12803A + len(oof_bytes), [0xEB, 0xEB]) - #Enemizer patch: prevent Enemizer from overwriting $3188 in SPC memory with an unused sound effect ("WHAT") + # Enemizer patch: prevent Enemizer from overwriting $3188 in SPC memory with an unused sound effect ("WHAT") rom.write_bytes(0x13000D, [0x00, 0x00, 0x00, 0x08]) @@ -3021,7 +3021,7 @@ def get_base_rom_bytes(file_name: str = "") -> bytes: def get_base_rom_path(file_name: str = "") -> str: - options = Utils.get_options() + options = Utils.get_settings() if not file_name: file_name = options["lttp_options"]["rom_file"] if not os.path.exists(file_name): diff --git a/worlds/factorio/Client.py b/worlds/factorio/Client.py index f612605b4c19..d245e1bb7af6 100644 --- a/worlds/factorio/Client.py +++ b/worlds/factorio/Client.py @@ -521,7 +521,7 @@ def _handle_color(self, node: JSONMessagePart): rcon_password = args.rcon_password if args.rcon_password else ''.join( random.choice(string.ascii_letters) for x in range(32)) factorio_server_logger = logging.getLogger("FactorioServer") -options = Utils.get_options() +options = Utils.get_settings() executable = options["factorio_options"]["executable"] server_settings = args.server_settings if args.server_settings \ else options["factorio_options"].get("server_settings", None) From 4756c76541e7a7e2fd6252356332191cf80c2fbb Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Wed, 24 Apr 2024 06:36:35 +0200 Subject: [PATCH 4/4] WebHost: remove JSON_AS_ASCII (#3209) --- docs/webhost configuration sample.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/webhost configuration sample.yaml b/docs/webhost configuration sample.yaml index d0556453b388..afb87b399643 100644 --- a/docs/webhost configuration sample.yaml +++ b/docs/webhost configuration sample.yaml @@ -45,9 +45,6 @@ # TODO #CACHE_TYPE: "simple" -# TODO -#JSON_AS_ASCII: false - # Host Address. This is the address encoded into the patch that will be used for client auto-connect. #HOST_ADDRESS: archipelago.gg