diff --git a/src/Modules/ScoreboardModule/Controllers/ScoreboardEventController.cs b/src/Modules/ScoreboardModule/Controllers/ScoreboardEventController.cs index f916bc08..9943a7af 100644 --- a/src/Modules/ScoreboardModule/Controllers/ScoreboardEventController.cs +++ b/src/Modules/ScoreboardModule/Controllers/ScoreboardEventController.cs @@ -3,7 +3,6 @@ using EvoSC.Common.Events.Attributes; using EvoSC.Common.Interfaces.Controllers; using EvoSC.Common.Remote; -using EvoSC.Common.Remote.EventArgsModels; using EvoSC.Modules.Official.ScoreboardModule.Interfaces; using GbxRemoteNet.Events; @@ -20,10 +19,6 @@ IScoreboardNicknamesService nicknamesService public Task OnPlayerConnectAsync(object sender, PlayerGbxEventArgs args) => nicknamesService.AddNicknameByLoginAsync(args.Login); - [Subscribe(ModeScriptEvent.EndMapEnd)] - public Task OnEndMapAsync(object sender, MapEventArgs args) => - nicknamesService.ClearNicknamesAsync(); - [Subscribe(GbxRemoteEvent.BeginMap)] public async Task OnBeginMapAsync(object sender, MapGbxEventArgs args) { diff --git a/src/Modules/ScoreboardModule/Services/ScoreboardNicknamesService.cs b/src/Modules/ScoreboardModule/Services/ScoreboardNicknamesService.cs index 56fbedc9..7619688c 100644 --- a/src/Modules/ScoreboardModule/Services/ScoreboardNicknamesService.cs +++ b/src/Modules/ScoreboardModule/Services/ScoreboardNicknamesService.cs @@ -37,7 +37,7 @@ public Task ClearNicknamesAsync() public async Task LoadNicknamesAsync() { var onlinePlayers = await playerManagerService.GetOnlinePlayersAsync(); - foreach (var player in onlinePlayers) + foreach (var player in onlinePlayers.Where(player => player.NickName != player.UbisoftName)) { _nicknames[player.GetLogin()] = player.NickName; } diff --git a/src/Modules/ScoreboardModule/Services/ScoreboardService.cs b/src/Modules/ScoreboardModule/Services/ScoreboardService.cs index bae50ef0..79c31c37 100644 --- a/src/Modules/ScoreboardModule/Services/ScoreboardService.cs +++ b/src/Modules/ScoreboardModule/Services/ScoreboardService.cs @@ -29,9 +29,19 @@ public async Task SendScoreboardAsync() private async Task GetDataAsync() { - var maxPlayers = await server.Remote.GetMaxPlayersAsync(); + var currentNextMaxPlayers = await server.Remote.GetMaxPlayersAsync(); + var maxPlayers = 128; - return new { settings, MaxPlayers = maxPlayers.CurrentValue }; + if (currentNextMaxPlayers.CurrentValue > 0) + { + maxPlayers = currentNextMaxPlayers.CurrentValue; + } + else if (currentNextMaxPlayers.NextValue > 0) + { + maxPlayers = currentNextMaxPlayers.NextValue; + } + + return new { settings, MaxPlayers = maxPlayers }; } public Task HideNadeoScoreboardAsync() => diff --git a/src/Modules/ScoreboardModule/Templates/Components/Row/Framemodel.mt b/src/Modules/ScoreboardModule/Templates/Components/Row/Framemodel.mt index 22ea094d..e38ae2fb 100644 --- a/src/Modules/ScoreboardModule/Templates/Components/Row/Framemodel.mt +++ b/src/Modules/ScoreboardModule/Templates/Components/Row/Framemodel.mt @@ -66,6 +66,7 @@ class="text-primary" text="CLUB" pos="{{ rowInnerHeight * 0.75 }} 0" + size="{{ rowInnerHeight * 2.0 }} {{ rowInnerHeight }}" valign="center2" halign="center" textsize="{{ Theme.UI_FontSize*2 }}" diff --git a/src/Modules/ScoreboardModule/Templates/Scoreboard.mt b/src/Modules/ScoreboardModule/Templates/Scoreboard.mt index edf8dc37..474a3733 100644 --- a/src/Modules/ScoreboardModule/Templates/Scoreboard.mt +++ b/src/Modules/ScoreboardModule/Templates/Scoreboard.mt @@ -414,6 +414,10 @@ declare cursor = 0; foreach(Score => Weight in GetSortedScores()){ + if(!RowsFrame.Controls.existskey(cursor)){ + continue; + } + declare persistent Boolean SB_Setting_ShowSpectators for LocalUser = True; declare persistent Boolean SB_Setting_ShowDisconnected for LocalUser = True; @@ -459,6 +463,10 @@ //Hide remaining rows for(i, cursor, {{ MaxPlayers - 1 }}){ + if(!RowsFrame.Controls.existskey(i)){ + continue; + } + declare playerRow = (RowsFrame.Controls[i] as CMlFrame); playerRow.Hide(); }