feat: admin UI, player scoreboard, back button logic

This commit is contained in:
2025-12-04 10:47:40 -05:00
Unverified
parent a16a44ba7a
commit 24ca218ee2
8 changed files with 236 additions and 17 deletions

View File

@@ -30,6 +30,7 @@ public partial class Connection : Node
public event Action<string, int> OnObserveMove;
public event Action<List<MatchData>> OnUpdatedMatches;
public event Action<List<PlayerData>> OnUpdatedPlayers;
public event Action OnStartTournamentAck;
public event Action<List<(string, int)>> OnTournamentEnd;
public event Action OnBecomeAdmin;
@@ -39,6 +40,8 @@ public partial class Connection : Node
public bool IsAdmin { get; private set; }
public bool IsPlayer { get; private set; }
public bool ActiveTournament { get; private set; }
public MatchData CurrentObservingMatch { get; private set; }
@@ -334,6 +337,7 @@ public partial class Connection : Node
{
case "END":
{
ActiveTournament = false;
List<(string, int)> playerScoreboard = new List<(string, int)>();
string[] entries = segments[1].Split("|");
foreach (string entry in entries)
@@ -345,6 +349,12 @@ public partial class Connection : Node
OnTournamentEnd?.Invoke(playerScoreboard);
break;
}
case "START":
{
OnStartTournamentAck?.Invoke();
ActiveTournament = true;
break;
}
}
}