From a91e8c18217ae24ce383c7298fc936cbaf138b1e Mon Sep 17 00:00:00 2001 From: massimilianodelliubaldini <8584296+massimilianodelliubaldini@users.noreply.github.com> Date: Wed, 30 Apr 2025 19:44:35 -0400 Subject: [PATCH] Use existing slot name/seed from network protocol. --- worlds/jakanddaxter/Client.py | 10 ++++++++-- worlds/jakanddaxter/__init__.py | 6 +----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/worlds/jakanddaxter/Client.py b/worlds/jakanddaxter/Client.py index 06e95b9fd2..aa963607f0 100644 --- a/worlds/jakanddaxter/Client.py +++ b/worlds/jakanddaxter/Client.py @@ -95,6 +95,9 @@ class JakAndDaxterContext(CommonContext): repl_task: asyncio.Task memr_task: asyncio.Task + # Storing some information for writing save slot identifiers. + slot_seed: str + def __init__(self, server_address: str | None, password: str | None) -> None: self.repl = JakAndDaxterReplClient(self.on_log_error, self.on_log_warn, @@ -134,6 +137,9 @@ class JakAndDaxterContext(CommonContext): def on_package(self, cmd: str, args: dict): + if cmd == "RoomInfo": + self.slot_seed = args["seed_name"] + if cmd == "Connected": slot_data = args["slot_data"] orbsanity_option = slot_data["enable_orbsanity"] @@ -159,8 +165,8 @@ class JakAndDaxterContext(CommonContext): slot_data["oracle_orb_trade_amount"], slot_data["trap_effect_duration"], slot_data["jak_completion_condition"], - slot_data["slot_name"][:16], - slot_data["slot_seed"][:8])) + self.auth[:16], # The slot name + self.slot_seed[:8])) # Because Orbsanity and the orb traders in the game are intrinsically linked, we need the server # to track our trades at all times to support async play. "Retrieved" will tell us the orbs we lost, diff --git a/worlds/jakanddaxter/__init__.py b/worlds/jakanddaxter/__init__.py index b453d01fcd..7e533eb097 100644 --- a/worlds/jakanddaxter/__init__.py +++ b/worlds/jakanddaxter/__init__.py @@ -478,10 +478,6 @@ class JakAndDaxterWorld(World): return change def fill_slot_data(self) -> dict[str, Any]: - slot_dict = { - "slot_name": self.player_name, - "slot_seed": self.multiworld.seed_name, - } options_dict = self.options.as_dict("enable_move_randomizer", "enable_orbsanity", "global_orbsanity_bundle_size", @@ -498,4 +494,4 @@ class JakAndDaxterWorld(World): "jak_completion_condition", "require_punch_for_klaww", ) - return {**slot_dict, **options_dict} + return options_dict