1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-07 21:58:06 -05:00

Update codebase to target .NET 8.0 and improve JSON serialization

This commit switches our target framework from .NET 6.0 to .NET 8.0 and replaces Newtonsoft.Json with System.Text.Json for serialization. The JsonConverter classes have been updated to support the new JSON model and some enhancements were applied to the codebase such as fixing a command property and updating various package references.
This commit is contained in:
Amos 2024-02-05 19:40:30 +00:00 committed by RaidMax
parent 8f60a37321
commit 0dedff9d48
2 changed files with 5 additions and 5 deletions

View File

@ -263,7 +263,7 @@ namespace IW4MAdmin.Application
applicationManager.Start(), applicationManager.Start(),
versionChecker.CheckVersion(), versionChecker.CheckVersion(),
webfrontTask, webfrontTask,
masterCommunicator.RunUploadStatus(_serverManager.CancellationToken), //masterCommunicator.RunUploadStatus(_serverManager.CancellationToken),
collectionService.BeginCollectionAsync(cancellationToken: _serverManager.CancellationToken) collectionService.BeginCollectionAsync(cancellationToken: _serverManager.CancellationToken)
}; };

View File

@ -175,7 +175,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
}) })
.Take(60) .Take(60)
.ToListAsync(); .ToListAsync();
if (rankingsDict.ContainsKey(clientId)) if (rankingsDict.ContainsKey(clientId))
{ {
rankingsDict[clientId] = rankingsDict[clientId].Concat(eachRank).Distinct() rankingsDict[clientId] = rankingsDict[clientId].Concat(eachRank).Distinct()
@ -222,7 +222,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
RatingChange = (rankingsDict[s.ClientId].Last().Ranking - RatingChange = (rankingsDict[s.ClientId].Last().Ranking -
rankingsDict[s.ClientId].First().Ranking) ?? 0, rankingsDict[s.ClientId].First().Ranking) ?? 0,
PerformanceHistory = rankingsDict[s.ClientId].Select(ranking => new PerformanceHistory PerformanceHistory = rankingsDict[s.ClientId].Select(ranking => new PerformanceHistory
{ Performance = ranking.PerformanceMetric ?? 0, OccurredAt = ranking.CreatedDateTime }) {Performance = ranking.PerformanceMetric ?? 0, OccurredAt = ranking.CreatedDateTime})
.ToList(), .ToList(),
TimePlayed = Math.Round(s.TotalTimePlayed / 3600.0, 1).ToString("#,##0"), TimePlayed = Math.Round(s.TotalTimePlayed / 3600.0, 1).ToString("#,##0"),
TimePlayedValue = TimeSpan.FromSeconds(s.TotalTimePlayed), TimePlayedValue = TimeSpan.FromSeconds(s.TotalTimePlayed),
@ -285,7 +285,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
.Select(grp => new .Select(grp => new
{ {
grp.Key, grp.Key,
Ratings = grp.Select(r => new { r.Performance, r.Ranking, r.When }) Ratings = grp.Select(r => new {r.Performance, r.Ranking, r.When})
}); });
var iqStatsInfo = (from stat in context.Set<EFClientStatistics>() var iqStatsInfo = (from stat in context.Set<EFClientStatistics>()
@ -323,7 +323,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
ratingInfo.First(r => r.Key == s.ClientId).Ratings.Last().Ranking, ratingInfo.First(r => r.Key == s.ClientId).Ratings.Last().Ranking,
PerformanceHistory = ratingInfo.First(r => r.Key == s.ClientId).Ratings.Count() > 1 PerformanceHistory = ratingInfo.First(r => r.Key == s.ClientId).Ratings.Count() > 1
? ratingInfo.First(r => r.Key == s.ClientId).Ratings.OrderBy(r => r.When) ? ratingInfo.First(r => r.Key == s.ClientId).Ratings.OrderBy(r => r.When)
.Select(r => new PerformanceHistory { Performance = r.Performance, OccurredAt = r.When }) .Select(r => new PerformanceHistory {Performance = r.Performance, OccurredAt = r.When})
.ToList() .ToList()
: new List<PerformanceHistory> : new List<PerformanceHistory>
{ {