diff --git a/src/EvoSC.Common/Util/RaceTime.cs b/src/EvoSC.Common/Util/RaceTime.cs index 73d1e3277..2f8ddf2da 100644 --- a/src/EvoSC.Common/Util/RaceTime.cs +++ b/src/EvoSC.Common/Util/RaceTime.cs @@ -1,4 +1,5 @@ -using EvoSC.Common.Interfaces.Util; +using System.Globalization; +using EvoSC.Common.Interfaces.Util; namespace EvoSC.Common.Util; @@ -30,15 +31,15 @@ public static IRaceTime FromMilliseconds(int totalMilliseconds) public override string ToString() { - var milli = Milliseconds.ToString().PadLeft(3, '0'); - var seconds = Seconds.ToString().PadLeft(2, '0'); + var milli = Milliseconds.ToString(CultureInfo.InvariantCulture).PadLeft(3, '0'); + var seconds = Seconds.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0'); if (Minutes == 0 && Hours == 0) { return $"{seconds}.{milli}"; } - var minutes = Minutes.ToString().PadLeft(2, '0'); + var minutes = Minutes.ToString(CultureInfo.InvariantCulture).PadLeft(2, '0'); return Hours == 0 ? $"{minutes}:{seconds}.{milli}" : $"{Hours}:{minutes}:{seconds}.{milli}"; } diff --git a/src/Modules/Scoreboard/Controllers/ScoreboardCommandsController.cs b/src/Modules/Scoreboard/Controllers/ScoreboardCommandsController.cs index b6e6e4528..d90971c23 100644 --- a/src/Modules/Scoreboard/Controllers/ScoreboardCommandsController.cs +++ b/src/Modules/Scoreboard/Controllers/ScoreboardCommandsController.cs @@ -15,7 +15,7 @@ public ScoreboardCommandsController(IScoreboardService scoreboardService) => _scoreboardService = scoreboardService; [ChatCommand("scoreboard", "[Command.ShowScoreboard]")] - public async Task ShowScoreboard() + public async Task ShowScoreboardAsync() { await _scoreboardService.ShowScoreboardAsync(Context.Player); } diff --git a/src/Modules/Scoreboard/Controllers/ScoreboardEventController.cs b/src/Modules/Scoreboard/Controllers/ScoreboardEventController.cs index 545199285..bfeb638bf 100644 --- a/src/Modules/Scoreboard/Controllers/ScoreboardEventController.cs +++ b/src/Modules/Scoreboard/Controllers/ScoreboardEventController.cs @@ -20,21 +20,21 @@ public ScoreboardEventController(IScoreboardService scoreboardService) => _scoreboardService = scoreboardService; [Subscribe(GbxRemoteEvent.BeginMap)] - public async Task OnBeginMap(object sender, MapGbxEventArgs args) + public async Task OnBeginMapAsync(object sender, MapGbxEventArgs args) { await _scoreboardService.LoadAndSendRequiredAdditionalInfoAsync(); await _scoreboardService.ShowScoreboardToAllAsync(); } [Subscribe(MatchSettingsEvent.MatchSettingsLoaded)] - public async Task OnMatchSettingsLoaded(object sender, MatchSettingsLoadedEventArgs args) + public async Task OnMatchSettingsLoadedAsync(object sender, MatchSettingsLoadedEventArgs args) { await _scoreboardService.LoadAndSendRequiredAdditionalInfoAsync(); await _scoreboardService.ShowScoreboardToAllAsync(); } [Subscribe(ModeScriptEvent.StartRoundStart)] - public async Task OnRoundStart(object sender, RoundEventArgs args) + public async Task OnRoundStartAsync(object sender, RoundEventArgs args) { _scoreboardService.SetCurrentRound(args.Count); await _scoreboardService.SendRequiredAdditionalInfoAsync(); diff --git a/src/Modules/Scoreboard/Services/ScoreboardService.cs b/src/Modules/Scoreboard/Services/ScoreboardService.cs index e529bb533..6dfa156ba 100644 --- a/src/Modules/Scoreboard/Services/ScoreboardService.cs +++ b/src/Modules/Scoreboard/Services/ScoreboardService.cs @@ -30,15 +30,15 @@ public ScoreboardService(IManialinkManager manialinks, IServerClient server, IEv public async Task ShowScoreboardToAllAsync() { - await _manialinks.SendPersistentManialinkAsync("Scoreboard.Scoreboard", await GetData()); + await _manialinks.SendPersistentManialinkAsync("Scoreboard.Scoreboard", await GetDataAsync()); } public async Task ShowScoreboardAsync(IPlayer playerLogin) { - await _manialinks.SendManialinkAsync(playerLogin, "Scoreboard.Scoreboard", await GetData()); + await _manialinks.SendManialinkAsync(playerLogin, "Scoreboard.Scoreboard", await GetDataAsync()); } - private Task GetData() + private Task GetDataAsync() { return Task.FromResult(new { @@ -57,7 +57,7 @@ private Task GetData() public async Task HideNadeoScoreboardAsync() { - var hudSettings = new List() + var hudSettings = new List { @"{ ""uimodules"": [ @@ -77,7 +77,7 @@ public async Task HideNadeoScoreboardAsync() public async Task ShowNadeoScoreboardAsync() { - var hudSettings = new List() + var hudSettings = new List { @"{ ""uimodules"": [ diff --git a/src/Modules/SpectatorTargetInfoModule/Controllers/SpectatorTargetInfoEventController.cs b/src/Modules/SpectatorTargetInfoModule/Controllers/SpectatorTargetInfoEventController.cs index 82c2f0499..b9b2777cc 100644 --- a/src/Modules/SpectatorTargetInfoModule/Controllers/SpectatorTargetInfoEventController.cs +++ b/src/Modules/SpectatorTargetInfoModule/Controllers/SpectatorTargetInfoEventController.cs @@ -18,18 +18,18 @@ public SpectatorTargetInfoEventController(ISpectatorTargetInfoService spectatorT _spectatorTargetInfoService = spectatorTargetInfoService; [Subscribe(GbxRemoteEvent.PlayerConnect)] - public Task OnPlayerConnect(object x, PlayerConnectGbxEventArgs args) => + public Task OnPlayerConnectAsync(object x, PlayerConnectGbxEventArgs args) => _spectatorTargetInfoService.SendManiaLinkAsync(args.Login); [Subscribe(ModeScriptEvent.WayPoint)] - public Task OnWayPoint(object sender, WayPointEventArgs wayPointEventArgs) => + public Task OnWayPointAsync(object sender, WayPointEventArgs wayPointEventArgs) => _spectatorTargetInfoService.ForwardCheckpointTimeToClientsAsync(wayPointEventArgs); [Subscribe(ModeScriptEvent.StartRoundStart)] - public Task OnNewRound(object sender, RoundEventArgs roundEventArgs) => + public Task OnNewRoundAsync(object sender, RoundEventArgs roundEventArgs) => _spectatorTargetInfoService.ResetCheckpointTimesAsync(); [Subscribe(ModeScriptEvent.GiveUp)] - public Task OnPlayerGiveUp(object sender, PlayerUpdateEventArgs playerUpdateEventArgs) => + public Task OnPlayerGiveUpAsync(object sender, PlayerUpdateEventArgs playerUpdateEventArgs) => _spectatorTargetInfoService.ForwardDnfToClientsAsync(playerUpdateEventArgs); } diff --git a/src/Modules/SpectatorTargetInfoModule/Services/SpectatorTargetInfoService.cs b/src/Modules/SpectatorTargetInfoModule/Services/SpectatorTargetInfoService.cs index 6c5a9b2cf..6d0db7f0b 100644 --- a/src/Modules/SpectatorTargetInfoModule/Services/SpectatorTargetInfoService.cs +++ b/src/Modules/SpectatorTargetInfoModule/Services/SpectatorTargetInfoService.cs @@ -36,7 +36,7 @@ public async Task HideManiaLinkAsync() => public Task HideNadeoSpectatorInfoAsync() { - var hudSettings = new List() + var hudSettings = new List { @"{""uimodules"": [ { @@ -57,7 +57,7 @@ public Task HideNadeoSpectatorInfoAsync() public Task ShowNadeoSpectatorInfoAsync() { - var hudSettings = new List() + var hudSettings = new List { @"{""uimodules"": [ { diff --git a/src/Modules/WorldRecordModule/Controllers/WorldRecordEventController.cs b/src/Modules/WorldRecordModule/Controllers/WorldRecordEventController.cs index c2bb294be..c0c3de979 100644 --- a/src/Modules/WorldRecordModule/Controllers/WorldRecordEventController.cs +++ b/src/Modules/WorldRecordModule/Controllers/WorldRecordEventController.cs @@ -17,10 +17,10 @@ public WorldRecordEventController(IWorldRecordService worldRecordService) => _worldRecordService = worldRecordService; [Subscribe(ModeScriptEvent.EndMapEnd)] - public Task OnMapEnd(object sender, MapEventArgs mapEventArgs) + public Task OnMapEndAsync(object sender, MapEventArgs mapEventArgs) => _worldRecordService.ClearRecordAsync(); [Subscribe(ModeScriptEvent.StartMapStart)] - public Task OnMapStart(object sender, MapEventArgs mapEventArgs) + public Task OnMapStartAsync(object sender, MapEventArgs mapEventArgs) => _worldRecordService.FetchRecordAsync(mapEventArgs.Map.Uid); } diff --git a/tests/Modules/MatchTrackerModule.Tests/UnitTest1.cs b/tests/Modules/MatchTrackerModule.Tests/UnitTest1.cs deleted file mode 100644 index dc11279db..000000000 --- a/tests/Modules/MatchTrackerModule.Tests/UnitTest1.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MatchTrackerModule.Tests; - -public class UnitTest1 -{ - [Fact] - public void Test1() - { - } -}