LADX: Give better feedback during patching (#5401)

This commit is contained in:
threeandthreee
2025-11-25 14:42:55 -05:00
committed by GitHub
parent aa2774a5d5
commit f3000a89d4
5 changed files with 69 additions and 9 deletions

View File

@@ -47,6 +47,10 @@ class BadRetroArchResponse(GameboyException):
class BadRetroArchResponse(GameboyException):
pass
class VersionError(Exception):
pass
class LAClientConstants:
@@ -518,7 +522,7 @@ class LinksAwakeningContext(CommonContext):
class LADXManager(GameManager):
logging_pairs = [
("Client", "Archipelago"),
("Tracker", "Tracker"),
("Tracker", "Tracker"),
]
base_title = f"Links Awakening DX Client {LinksAwakeningWorld.world_version.as_simple_string()} | Archipelago"
@@ -614,11 +618,20 @@ class LinksAwakeningContext(CommonContext):
def on_package(self, cmd: str, args: dict):
if cmd == "Connected":
self.game = self.slot_info[self.slot].game
self.slot_data = args.get("slot_data", {})
generated_version = Utils.tuplize_version(self.slot_data.get("world_version", "2.0.0"))
client_version = LinksAwakeningWorld.world_version
if generated_version.major != client_version.major:
self.disconnected_intentionally = True
raise VersionError(
f"The installed world ({client_version.as_simple_string()}) is incompatible with "
f"the world this game was generated on ({generated_version.as_simple_string()})"
)
# This is sent to magpie over local websocket to make its own connection
self.slot_data.update({
"server_address": self.server_address,
"slot_name": self.player_names[self.slot],
"password": self.password,
"client_version": client_version.as_simple_string(),
})