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

harden up the script timer/game interface dvar operations for multithreading

This commit is contained in:
RaidMax
2022-10-23 14:03:33 -05:00
parent 5b7e56f894
commit 7b2cd19fc1
5 changed files with 95 additions and 48 deletions

View File

@ -867,6 +867,12 @@ namespace IW4MAdmin
/// <returns></returns>
async Task<List<EFClient>[]> PollPlayersAsync(CancellationToken token)
{
if (DateTime.Now - (MatchEndTime ?? MatchStartTime) < TimeSpan.FromSeconds(15))
{
ServerLogger.LogDebug("Skipping status poll attempt because the match ended recently");
return null;
}
var currentClients = GetClientsAsList();
var statusResponse = await this.GetStatusAsync(token);
@ -874,7 +880,7 @@ namespace IW4MAdmin
{
return null;
}
var polledClients = statusResponse.Clients.AsEnumerable();
if (Manager.GetApplicationSettings().Configuration().IgnoreBots)