From f5f554cb3dd89a96b44209f5eb0bbd4a0b30d45d Mon Sep 17 00:00:00 2001 From: Rosalie <61372066+Rosalie-A@users.noreply.github.com> Date: Fri, 17 Oct 2025 10:34:10 -0400 Subject: [PATCH] [FF1] Client fix and improvement (#5390) * FF1 Client fixes. * Strip leading/trailing spaces from rom-stored player name. * FF1R encodes the name as utf-8, as it happens. * UTF-8 is four bytes per character, so we need 64 bytes for the name, not 16. --- worlds/ff1/Client.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/worlds/ff1/Client.py b/worlds/ff1/Client.py index a4279afd..4b21e2ac 100644 --- a/worlds/ff1/Client.py +++ b/worlds/ff1/Client.py @@ -16,6 +16,7 @@ logger = logging.getLogger("Client") rom_name_location = 0x07FFE3 +player_name_location = 0x07BCC0 locations_array_start = 0x200 locations_array_length = 0x100 items_obtained = 0x03 @@ -111,6 +112,12 @@ class FF1Client(BizHawkClient): return True + async def set_auth(self, ctx: "BizHawkClientContext") -> None: + auth_raw = (await bizhawk.read( + ctx.bizhawk_ctx, + [(player_name_location, 0x40, self.rom)]))[0] + ctx.auth = str(auth_raw, "utf-8").replace("\x00", "").strip() + async def game_watcher(self, ctx: "BizHawkClientContext") -> None: if ctx.server is None: return @@ -204,7 +211,7 @@ class FF1Client(BizHawkClient): write_list.append((location, [0], self.sram)) elif current_item_name in no_overworld_items: if current_item_name == "Sigil": - location = 0x28 + location = 0x2B else: location = 0x12 write_list.append((location, [1], self.sram))