Merge branch '2.3' into 2.4-pr
This commit is contained in:
commit
7c0e37cc8e
@ -6,7 +6,7 @@
|
|||||||
<RuntimeFrameworkVersion>2.2.2</RuntimeFrameworkVersion>
|
<RuntimeFrameworkVersion>2.2.2</RuntimeFrameworkVersion>
|
||||||
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
|
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
|
||||||
<PackageId>RaidMax.IW4MAdmin.Application</PackageId>
|
<PackageId>RaidMax.IW4MAdmin.Application</PackageId>
|
||||||
<Version>2.2.8.1</Version>
|
<Version>2.2.8.2</Version>
|
||||||
<Authors>RaidMax</Authors>
|
<Authors>RaidMax</Authors>
|
||||||
<Company>Forever None</Company>
|
<Company>Forever None</Company>
|
||||||
<Product>IW4MAdmin</Product>
|
<Product>IW4MAdmin</Product>
|
||||||
@ -34,8 +34,8 @@
|
|||||||
<ServerGarbageCollection>false</ServerGarbageCollection>
|
<ServerGarbageCollection>false</ServerGarbageCollection>
|
||||||
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
|
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
|
||||||
<TieredCompilation>true</TieredCompilation>
|
<TieredCompilation>true</TieredCompilation>
|
||||||
<AssemblyVersion>2.2.8.1</AssemblyVersion>
|
<AssemblyVersion>2.2.8.2</AssemblyVersion>
|
||||||
<FileVersion>2.2.8.1</FileVersion>
|
<FileVersion>2.2.8.2</FileVersion>
|
||||||
<LangVersion>7.1</LangVersion>
|
<LangVersion>7.1</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -48,6 +48,8 @@ namespace IW4MAdmin.Application.IO
|
|||||||
|
|
||||||
await Task.Delay(_reader.UpdateInterval, _server.Manager.CancellationToken);
|
await Task.Delay(_reader.UpdateInterval, _server.Manager.CancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_server.Logger.WriteDebug("Stopped polling for changes");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task UpdateLogEvents()
|
private async Task UpdateLogEvents()
|
||||||
|
@ -431,21 +431,21 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
// get individual client's stats
|
// get individual client's stats
|
||||||
var clientStats = playerStats[pl.ClientId];
|
var clientStats = playerStats[pl.ClientId];
|
||||||
|
|
||||||
// remove the client from the stats dictionary as they're leaving
|
|
||||||
playerStats.TryRemove(pl.ClientId, out _);
|
|
||||||
detectionStats.TryRemove(pl.ClientId, out _);
|
|
||||||
|
|
||||||
// sync their stats before they leave
|
// sync their stats before they leave
|
||||||
clientStats = UpdateStats(clientStats);
|
clientStats = UpdateStats(clientStats);
|
||||||
await SaveClientStats(clientStats);
|
await SaveClientStats(clientStats);
|
||||||
|
|
||||||
|
// remove the client from the stats dictionary as they're leaving
|
||||||
|
playerStats.TryRemove(pl.ClientId, out _);
|
||||||
|
detectionStats.TryRemove(pl.ClientId, out _);
|
||||||
|
|
||||||
// increment the total play time
|
// increment the total play time
|
||||||
serverStats.TotalPlayTime += pl.ConnectionLength;
|
serverStats.TotalPlayTime += pl.ConnectionLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task SaveClientStats(EFClientStatistics clientStats)
|
private static async Task SaveClientStats(EFClientStatistics clientStats)
|
||||||
{
|
{
|
||||||
using (var ctx = new DatabaseContext(disableTracking: true))
|
using (var ctx = new DatabaseContext())
|
||||||
{
|
{
|
||||||
ctx.Update(clientStats);
|
ctx.Update(clientStats);
|
||||||
await ctx.SaveChangesAsync();
|
await ctx.SaveChangesAsync();
|
||||||
@ -533,11 +533,6 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
await AddStandardKill(attacker, victim);
|
await AddStandardKill(attacker, victim);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hit.IsKillstreakKill)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// incase the add player event get delayed
|
// incase the add player event get delayed
|
||||||
if (!_servers[serverId].PlayerStats.ContainsKey(attacker.ClientId))
|
if (!_servers[serverId].PlayerStats.ContainsKey(attacker.ClientId))
|
||||||
{
|
{
|
||||||
@ -560,15 +555,21 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
await SaveClientStats(clientStats);
|
await SaveClientStats(clientStats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hit.IsKillstreakKill)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Plugin.Config.Configuration().StoreClientKills)
|
if (Plugin.Config.Configuration().StoreClientKills)
|
||||||
{
|
{
|
||||||
|
OnProcessingPenalty.Wait();
|
||||||
_hitCache.Add(hit);
|
_hitCache.Add(hit);
|
||||||
|
|
||||||
if (_hitCache.Count > Detection.MAX_TRACKED_HIT_COUNT)
|
if (_hitCache.Count > Detection.MAX_TRACKED_HIT_COUNT)
|
||||||
{
|
{
|
||||||
OnProcessingPenalty.Wait();
|
|
||||||
using (var ctx = new DatabaseContext())
|
using (var ctx = new DatabaseContext())
|
||||||
{
|
{
|
||||||
ctx.AddRange(_hitCache);
|
ctx.AddRange(_hitCache);
|
||||||
@ -576,8 +577,8 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
}
|
}
|
||||||
|
|
||||||
_hitCache.Clear();
|
_hitCache.Clear();
|
||||||
OnProcessingPenalty.Release();
|
|
||||||
}
|
}
|
||||||
|
OnProcessingPenalty.Release(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -630,6 +631,11 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
|
|||||||
{
|
{
|
||||||
_log.WriteError("Could not save hit or AC info");
|
_log.WriteError("Could not save hit or AC info");
|
||||||
_log.WriteDebug(ex.GetExceptionInfo());
|
_log.WriteDebug(ex.GetExceptionInfo());
|
||||||
|
|
||||||
|
if (OnProcessingPenalty.CurrentCount == 0)
|
||||||
|
{
|
||||||
|
OnProcessingPenalty.Release();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user