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

actually fix it here

This commit is contained in:
RaidMax
2019-08-23 21:27:36 -05:00
parent 09061a310b
commit 981d698f70

View File

@ -551,26 +551,23 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
clientStats.HitLocations.Single(hl => hl.Location == hit.HitLoc).HitCount += 1;
}
try
{
if (Plugin.Config.Configuration().StoreClientKills)
{
lock (_hitCache)
_hitCache.Add(hit);
if (_hitCache.Count > Detection.MAX_TRACKED_HIT_COUNT)
{
_hitCache.Add(hit);
if (_hitCache.Count > Detection.MAX_TRACKED_HIT_COUNT)
OnProcessingPenalty.Wait();
using (var ctx = new DatabaseContext())
{
using (var ctx = new DatabaseContext())
{
ctx.AddRange(_hitCache);
await ctx.SaveChangesAsync();
}
_hitCache.Clear();
ctx.AddRange(_hitCache);
await ctx.SaveChangesAsync();
}
_hitCache.Clear();
OnProcessingPenalty.Release();
}
}