Move server calls to MusicServerClient and give players stable ids

Server requests move out of Settings into a new MusicServerClient
autoload with one function per endpoint. It sends requests through a
swappable HttpTransport so tests can fake the server, and it frees its
HTTPRequest nodes after use.

Players now have a UUID that never changes. Their position in
Settings.player_array is only used for the Alt+<number> keybinds.
Previously the position doubled as the id, so removing a player made
points and wins land on the wrong player, and could delete another
player's point from a song.

Also fixes:
- format_time showed 59.6 seconds as "00:60"
- searches containing regex characters such as "Q*bert" broke search
- SongObject and PlayerObject were Nodes that were never freed; they
  are now RefCounted
- search matching is split out of the UI code into find_matches()
This commit is contained in:
Sansan committed 2026-10-06 08:32:55 +02:00
1 parent ab338b0696
commit 56e9fe66d3
18 files changed
+281 -162

No files matched your search

+2 -2
View File
@@ -105,7 +105,7 @@ func start_sync() -> void:
sync_started.emit()
show_sync_progress()
if !Settings.currently_syncing:
Settings.make_request2("/sync", sync_request_sent, false)
MusicServerClient.start_sync(sync_request_sent)
func _on_sync_timeout() -> void:
print("_on_sync_timeout!")
@@ -118,7 +118,7 @@ func _on_sync_timeout() -> void:
sync_time.text = data_received.time_spent if data_received.has("time_spent") else ""
else:
on_sync_finished(data_received)
Settings.make_request2("/sync/progress", get_progress, true)
MusicServerClient.fetch_sync_progress(get_progress)
func on_sync_finished(data_received: Dictionary) -> void:
has_synced = true