diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-10-22 21:58:43 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-10-22 21:58:43 -0400 |
commit | 7544b11c86fd597321a507747fbd0fe1491ccbd8 (patch) | |
tree | bd5f22ee5478eaa46c1b8e42de0035d4010448d1 /apworld/client/client.gd | |
parent | dcecbb87a19c47c7d00f773f8df6bf98d65410ef (diff) | |
download | lingo2-archipelago-7544b11c86fd597321a507747fbd0fe1491ccbd8.tar.gz lingo2-archipelago-7544b11c86fd597321a507747fbd0fe1491ccbd8.tar.bz2 lingo2-archipelago-7544b11c86fd597321a507747fbd0fe1491ccbd8.zip |
Implemented latched doors in the client
Diffstat (limited to 'apworld/client/client.gd')
-rw-r--r-- | apworld/client/client.gd | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/apworld/client/client.gd b/apworld/client/client.gd index 9a4b402..ce5ac7e 100644 --- a/apworld/client/client.gd +++ b/apworld/client/client.gd | |||
@@ -25,6 +25,7 @@ var _slot_data = {} | |||
25 | var _accessible_locations = [] | 25 | var _accessible_locations = [] |
26 | var _accessible_worldports = [] | 26 | var _accessible_worldports = [] |
27 | var _goal_accessible = false | 27 | var _goal_accessible = false |
28 | var _latched_doors = [] | ||
28 | 29 | ||
29 | signal could_not_connect | 30 | signal could_not_connect |
30 | signal connect_status | 31 | signal connect_status |
@@ -34,6 +35,7 @@ signal location_scout_received(location_id, item_name, player_name, flags, for_s | |||
34 | signal text_message_received(message) | 35 | signal text_message_received(message) |
35 | signal item_sent_notification(message) | 36 | signal item_sent_notification(message) |
36 | signal hint_received(message) | 37 | signal hint_received(message) |
38 | signal door_latched(id) | ||
37 | signal accessible_locations_updated | 39 | signal accessible_locations_updated |
38 | signal checked_locations_updated | 40 | signal checked_locations_updated |
39 | signal checked_worldports_updated | 41 | signal checked_worldports_updated |
@@ -189,6 +191,14 @@ func _on_web_socket_server_message_received(_peer_id: int, packet: String) -> vo | |||
189 | message["type"], int(message.get("id", null)), message["path"] | 191 | message["type"], int(message.get("id", null)), message["path"] |
190 | ) | 192 | ) |
191 | 193 | ||
194 | elif cmd == "UpdateLatches": | ||
195 | for id in message["latches"]: | ||
196 | var iid = int(id) | ||
197 | if not _latched_doors.has(iid): | ||
198 | _latched_doors.append(iid) | ||
199 | |||
200 | door_latched.emit(iid) | ||
201 | |||
192 | 202 | ||
193 | func connectToServer(server, un, pw): | 203 | func connectToServer(server, un, pw): |
194 | sendMessage([{"cmd": "Connect", "server": server, "player": un, "password": pw}]) | 204 | sendMessage([{"cmd": "Connect", "server": server, "player": un, "password": pw}]) |
@@ -255,6 +265,13 @@ func checkWorldport(port_id): | |||
255 | sendMessage([{"cmd": "CheckWorldport", "port_id": port_id}]) | 265 | sendMessage([{"cmd": "CheckWorldport", "port_id": port_id}]) |
256 | 266 | ||
257 | 267 | ||
268 | func latchDoor(id): | ||
269 | if not _latched_doors.has(id): | ||
270 | _latched_doors.append(id) | ||
271 | |||
272 | sendMessage([{"cmd": "LatchDoor", "door": id}]) | ||
273 | |||
274 | |||
258 | func getLogicalPath(object_type, object_id): | 275 | func getLogicalPath(object_type, object_id): |
259 | var msg = {"cmd": "GetPath", "type": object_type} | 276 | var msg = {"cmd": "GetPath", "type": object_type} |
260 | if object_id != null: | 277 | if object_id != null: |