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

small tweak for preconnect events

This commit is contained in:
RaidMax
2020-04-26 12:32:41 -05:00
parent 1f7f40f296
commit 6c52e4346b
2 changed files with 9 additions and 2 deletions

View File

@ -741,7 +741,7 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
// kill event is not designated as blocking, so we should be able to enter and exit
// we need to make this thread safe because we can potentially have kills qualify
// for stat history update, but one is already processing that invalidates the original
await attacker.Lock();
await attackerStats.ProcessingHit.WaitAsync(Utilities.DefaultCommandTimeout, Plugin.ServerManager.CancellationToken);
await UpdateStatHistory(attacker, attackerStats);
attackerStats.LastStatHistoryUpdate = DateTime.UtcNow;
}
@ -754,7 +754,10 @@ namespace IW4MAdmin.Plugins.Stats.Helpers
finally
{
attacker.Unlock();
if (attackerStats.ProcessingHit.CurrentCount == 0)
{
attackerStats.ProcessingHit.Release(1);
}
}
}
}