1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

webfront profile loading optimizations

This commit is contained in:
RaidMax
2022-01-28 14:33:08 -06:00
parent dc69e5d602
commit c84b270ef7
3 changed files with 26 additions and 19 deletions

View File

@ -11,7 +11,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Data.Abstractions;
using Data.Models.Client;
using Data.Models.Client.Stats;
using Data.Models.Server;
using Microsoft.Extensions.Logging;
@ -195,7 +194,6 @@ namespace IW4MAdmin.Plugins.Stats
int messageCount = 0;
await using var ctx = _databaseContextFactory.CreateContext(enableTracking: false);
clientStats = await ctx.Set<EFClientStatistics>().Where(c => c.ClientId == request.ClientId).ToListAsync();
messageCount = await ctx.Set<EFClientMessage>().CountAsync(_message => _message.ClientId == request.ClientId);
int kills = clientStats.Sum(c => c.Kills);
int deaths = clientStats.Sum(c => c.Deaths);
@ -254,14 +252,6 @@ namespace IW4MAdmin.Plugins.Stats
Column = 0,
Order = 5,
Type = MetaType.Information
},
new InformationResponse()
{
Key = Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PROFILE_MESSAGES"],
Value = messageCount.ToString("#,##0", new System.Globalization.CultureInfo(Utilities.CurrentLocalization.LocalizationName)),
Column = 1,
Order = 4,
Type = MetaType.Information
}
};
}