diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-31 19:24:11 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2025-08-31 19:24:11 -0400 |
| commit | a54edd2c0a2fc3ca851e14be96068909a56a42df (patch) | |
| tree | 9f802dc3a91daf019a5e331a0de83043175fa5d6 /client/Archipelago/manager.gd | |
| parent | 1d9fcb1db4ab2b9b5314588d18fc601a9a83f6fa (diff) | |
| download | lingo2-archipelago-a54edd2c0a2fc3ca851e14be96068909a56a42df.tar.gz lingo2-archipelago-a54edd2c0a2fc3ca851e14be96068909a56a42df.tar.bz2 lingo2-archipelago-a54edd2c0a2fc3ca851e14be96068909a56a42df.zip | |
[Client] Batch sending locations on map load
Diffstat (limited to 'client/Archipelago/manager.gd')
| -rw-r--r-- | client/Archipelago/manager.gd | 17 |
1 files changed, 16 insertions, 1 deletions
| diff --git a/client/Archipelago/manager.gd b/client/Archipelago/manager.gd index 60b447a..f83d0cc 100644 --- a/client/Archipelago/manager.gd +++ b/client/Archipelago/manager.gd | |||
| @@ -16,6 +16,8 @@ var client | |||
| 16 | var _localdata_file = "" | 16 | var _localdata_file = "" |
| 17 | var _received_indexes = [] | 17 | var _received_indexes = [] |
| 18 | var _last_new_item = -1 | 18 | var _last_new_item = -1 |
| 19 | var _batch_locations = false | ||
| 20 | var _held_locations = [] | ||
| 19 | 21 | ||
| 20 | signal could_not_connect | 22 | signal could_not_connect |
| 21 | signal connect_status | 23 | signal connect_status |
| @@ -286,8 +288,21 @@ func _client_connected(): | |||
| 286 | emit_signal("ap_connected") | 288 | emit_signal("ap_connected") |
| 287 | 289 | ||
| 288 | 290 | ||
| 291 | func start_batching_locations(): | ||
| 292 | _batch_locations = true | ||
| 293 | |||
| 294 | |||
| 289 | func send_location(loc_id): | 295 | func send_location(loc_id): |
| 290 | client.sendLocation(loc_id) | 296 | if _batch_locations: |
| 297 | _held_locations.append(loc_id) | ||
| 298 | else: | ||
| 299 | client.sendLocation(loc_id) | ||
| 300 | |||
| 301 | |||
| 302 | func stop_batching_locations(): | ||
| 303 | _batch_locations = false | ||
| 304 | client.sendLocations(_held_locations) | ||
| 305 | _held_locations.clear() | ||
| 291 | 306 | ||
| 292 | 307 | ||
| 293 | func colorForItemType(flags): | 308 | func colorForItemType(flags): |
