diff options
Diffstat (limited to 'apworld')
-rw-r--r-- | apworld/__init__.py | 3 | ||||
-rw-r--r-- | apworld/client/main.gd | 13 | ||||
-rw-r--r-- | apworld/client/manager.gd | 9 | ||||
-rw-r--r-- | apworld/context.py | 7 | ||||
-rw-r--r-- | apworld/static_logic.py | 5 | ||||
-rw-r--r-- | apworld/version.py | 1 |
6 files changed, 21 insertions, 17 deletions
diff --git a/apworld/__init__.py b/apworld/__init__.py index 1af31c0..96f6804 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py | |||
@@ -11,7 +11,6 @@ from .options import Lingo2Options | |||
11 | from .player_logic import Lingo2PlayerLogic | 11 | from .player_logic import Lingo2PlayerLogic |
12 | from .regions import create_regions, shuffle_entrances, connect_ports_from_ut | 12 | from .regions import create_regions, shuffle_entrances, connect_ports_from_ut |
13 | from .static_logic import Lingo2StaticLogic | 13 | from .static_logic import Lingo2StaticLogic |
14 | from .version import APWORLD_VERSION | ||
15 | from ..LauncherComponents import Component, Type, components, launch as launch_component, icon_paths | 14 | from ..LauncherComponents import Component, Type, components, launch as launch_component, icon_paths |
16 | 15 | ||
17 | 16 | ||
@@ -138,7 +137,7 @@ class Lingo2World(World): | |||
138 | 137 | ||
139 | slot_data: dict[str, object] = { | 138 | slot_data: dict[str, object] = { |
140 | **self.options.as_dict(*slot_options), | 139 | **self.options.as_dict(*slot_options), |
141 | "version": [self.static_logic.get_data_version(), APWORLD_VERSION], | 140 | "version": self.static_logic.get_data_version(), |
142 | } | 141 | } |
143 | 142 | ||
144 | if self.options.shuffle_worldports: | 143 | if self.options.shuffle_worldports: |
diff --git a/apworld/client/main.gd b/apworld/client/main.gd index 8425d8c..2d2e606 100644 --- a/apworld/client/main.gd +++ b/apworld/client/main.gd | |||
@@ -102,8 +102,9 @@ func _ready(): | |||
102 | history_box.get_popup().id_pressed.connect(historySelected) | 102 | history_box.get_popup().id_pressed.connect(historySelected) |
103 | 103 | ||
104 | # Show client version. | 104 | # Show client version. |
105 | var version = gamedata.objects.get_version() | ||
105 | get_node("../Panel/title").text = ( | 106 | get_node("../Panel/title").text = ( |
106 | "ARCHIPELAGO (%d.%d)" % [gamedata.objects.get_version(), ap.MOD_VERSION] | 107 | "ARCHIPELAGO (%d.%d.%d)" % [version.get_major(), version.get_minor(), version.get_patch()] |
107 | ) | 108 | ) |
108 | 109 | ||
109 | # Increase font size in text boxes. | 110 | # Increase font size in text boxes. |
@@ -173,18 +174,20 @@ func connectionSuccessful(): | |||
173 | var gamedata = global.get_node("Gamedata") | 174 | var gamedata = global.get_node("Gamedata") |
174 | 175 | ||
175 | # Check for major version mismatch. | 176 | # Check for major version mismatch. |
176 | if ap.apworld_version[0] != gamedata.objects.get_version(): | 177 | if ap.apworld_version[0] != gamedata.objects.get_version().get_major(): |
177 | get_node("../Panel/AcceptDialog").exclusive = false | 178 | get_node("../Panel/AcceptDialog").exclusive = false |
178 | 179 | ||
179 | var popup = get_node("../Panel/VersionMismatch") | 180 | var popup = get_node("../Panel/VersionMismatch") |
180 | popup.title = "Version Mismatch!" | 181 | popup.title = "Version Mismatch!" |
181 | popup.dialog_text = ( | 182 | popup.dialog_text = ( |
182 | "This slot was generated using v%d.%d of the Lingo 2 apworld,\nwhich has a different major version than this client (v%d.%d).\nIt is highly recommended to play using the correct version of the client.\nYou may experience bugs or logic issues if you continue." | 183 | "This slot was generated using v%d.%d.%d of the Lingo 2 apworld,\nwhich has a different major version than this client (v%d.%d.%d).\nIt is highly recommended to play using the correct version of the client.\nYou may experience bugs or logic issues if you continue." |
183 | % [ | 184 | % [ |
184 | ap.apworld_version[0], | 185 | ap.apworld_version[0], |
185 | ap.apworld_version[1], | 186 | ap.apworld_version[1], |
186 | gamedata.objects.get_version(), | 187 | ap.apworld_version[2], |
187 | ap.MOD_VERSION | 188 | gamedata.objects.get_version().get_major(), |
189 | gamedata.objects.get_version().get_minor(), | ||
190 | gamedata.objects.get_version().get_patch() | ||
188 | ] | 191 | ] |
189 | ) | 192 | ) |
190 | popup.exclusive = true | 193 | popup.exclusive = true |
diff --git a/apworld/client/manager.gd b/apworld/client/manager.gd index b4fef1c..a5b9db0 100644 --- a/apworld/client/manager.gd +++ b/apworld/client/manager.gd | |||
@@ -1,7 +1,5 @@ | |||
1 | extends Node | 1 | extends Node |
2 | 2 | ||
3 | const MOD_VERSION = 7 | ||
4 | |||
5 | var SCRIPT_client | 3 | var SCRIPT_client |
6 | var SCRIPT_keyboard | 4 | var SCRIPT_keyboard |
7 | var SCRIPT_locationListener | 5 | var SCRIPT_locationListener |
@@ -61,7 +59,7 @@ const kEndingNameByVictoryValue = { | |||
61 | 12: "WHITE", | 59 | 12: "WHITE", |
62 | } | 60 | } |
63 | 61 | ||
64 | var apworld_version = [0, 0] | 62 | var apworld_version = [0, 0, 0] |
65 | var cyan_door_behavior = kCYAN_DOOR_BEHAVIOR_H2 | 63 | var cyan_door_behavior = kCYAN_DOOR_BEHAVIOR_H2 |
66 | var daedalus_roof_access = false | 64 | var daedalus_roof_access = false |
67 | var keyholder_sanity = false | 65 | var keyholder_sanity = false |
@@ -395,7 +393,10 @@ func _client_connected(slot_data): | |||
395 | victory_condition = int(slot_data.get("victory_condition", 0)) | 393 | victory_condition = int(slot_data.get("victory_condition", 0)) |
396 | 394 | ||
397 | if slot_data.has("version"): | 395 | if slot_data.has("version"): |
398 | apworld_version = [int(slot_data["version"][0]), int(slot_data["version"][1])] | 396 | var version_msg = slot_data["version"] |
397 | apworld_version = [int(version_msg[0]), int(version_msg[1]), 0] | ||
398 | if version_msg.size() > 2: | ||
399 | apworld_version[2] = int(version_msg[2]) | ||
399 | 400 | ||
400 | port_pairings.clear() | 401 | port_pairings.clear() |
401 | if slot_data.has("port_pairings"): | 402 | if slot_data.has("port_pairings"): |
diff --git a/apworld/context.py b/apworld/context.py index 0e1a125..ffe2acd 100644 --- a/apworld/context.py +++ b/apworld/context.py | |||
@@ -369,9 +369,10 @@ class Lingo2ClientContext(CommonContext): | |||
369 | }) | 369 | }) |
370 | 370 | ||
371 | self.manager.game_ctx.send_location_info(locations) | 371 | self.manager.game_ctx.send_location_info(locations) |
372 | elif cmd == "Received": | 372 | elif cmd == "Retrieved": |
373 | if args["key"] == self.victory_data_storage_key: | 373 | for k, v in args["keys"].items(): |
374 | self.handle_status_update(args["value"]) | 374 | if k == self.victory_data_storage_key: |
375 | self.handle_status_update(v) | ||
375 | elif cmd == "SetReply": | 376 | elif cmd == "SetReply": |
376 | if args["key"] == self.get_datastorage_key("keyboard1"): | 377 | if args["key"] == self.get_datastorage_key("keyboard1"): |
377 | self.handle_keyboard_update(1, args) | 378 | self.handle_keyboard_update(1, args) |
diff --git a/apworld/static_logic.py b/apworld/static_logic.py index ef70b58..e59a47d 100644 --- a/apworld/static_logic.py +++ b/apworld/static_logic.py | |||
@@ -166,5 +166,6 @@ class Lingo2StaticLogic: | |||
166 | else: | 166 | else: |
167 | return game_map.display_name | 167 | return game_map.display_name |
168 | 168 | ||
169 | def get_data_version(self) -> int: | 169 | def get_data_version(self) -> list[int]: |
170 | return self.objects.version | 170 | version = self.objects.version |
171 | return [version.major, version.minor, version.patch] | ||
diff --git a/apworld/version.py b/apworld/version.py deleted file mode 100644 index ac799cd..0000000 --- a/apworld/version.py +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | APWORLD_VERSION = 6 | ||