about summary refs log tree commit diff stats
path: root/apworld/client/client.gd
diff options
context:
space:
mode:
Diffstat (limited to 'apworld/client/client.gd')
-rw-r--r--apworld/client/client.gd26
1 files changed, 26 insertions, 0 deletions
diff --git a/apworld/client/client.gd b/apworld/client/client.gd index ce5ac7e..c149482 100644 --- a/apworld/client/client.gd +++ b/apworld/client/client.gd
@@ -26,6 +26,7 @@ var _accessible_locations = []
26var _accessible_worldports = [] 26var _accessible_worldports = []
27var _goal_accessible = false 27var _goal_accessible = false
28var _latched_doors = [] 28var _latched_doors = []
29var _hinted_locations = []
29 30
30signal could_not_connect 31signal could_not_connect
31signal connect_status 32signal connect_status
@@ -38,8 +39,10 @@ signal hint_received(message)
38signal door_latched(id) 39signal door_latched(id)
39signal accessible_locations_updated 40signal accessible_locations_updated
40signal checked_locations_updated 41signal checked_locations_updated
42signal ignored_locations_updated(locations)
41signal checked_worldports_updated 43signal checked_worldports_updated
42signal keyboard_update_received 44signal keyboard_update_received
45signal hinted_locations_updated
43 46
44 47
45func _init(): 48func _init():
@@ -199,6 +202,21 @@ func _on_web_socket_server_message_received(_peer_id: int, packet: String) -> vo
199 202
200 door_latched.emit(iid) 203 door_latched.emit(iid)
201 204
205 elif cmd == "SetIgnoredLocations":
206 var locs = []
207 for id in message["locations"]:
208 locs.append(int(id))
209
210 ignored_locations_updated.emit(locs)
211
212 elif cmd == "UpdateHintedLocations":
213 for id in message["locations"]:
214 var iid = int(id)
215 if !_hinted_locations.has(iid):
216 _hinted_locations.append(iid)
217
218 hinted_locations_updated.emit()
219
202 220
203func connectToServer(server, un, pw): 221func connectToServer(server, un, pw):
204 sendMessage([{"cmd": "Connect", "server": server, "player": un, "password": pw}]) 222 sendMessage([{"cmd": "Connect", "server": server, "player": un, "password": pw}])
@@ -280,6 +298,14 @@ func getLogicalPath(object_type, object_id):
280 sendMessage([msg]) 298 sendMessage([msg])
281 299
282 300
301func addIgnoredLocation(loc_id):
302 sendMessage([{"cmd": "IgnoreLocation", "id": loc_id}])
303
304
305func removeIgnoredLocation(loc_id):
306 sendMessage([{"cmd": "UnignoreLocation", "id": loc_id}])
307
308
283func sendQuit(): 309func sendQuit():
284 sendMessage([{"cmd": "Quit"}]) 310 sendMessage([{"cmd": "Quit"}])
285 311