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

Using TellAsync instead of Tell to prevent Event flooding. (#332)

This commit is contained in:
Amos 2024-07-22 20:43:54 +01:00 committed by GitHub
parent 95523885b8
commit bc3bd5b0f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,12 +48,11 @@ namespace IW4MAdmin.Application.Commands
return;
}
foreach (var client in players)
{
gameEvent.Origin.Tell(_translationLookup["COMMANDS_FIND_FORMAT_V2"].FormatExt(client.Name,
client.ClientId, Utilities.ConvertLevelToColor((EFClient.Permission) client.LevelInt, client.Level),
client.IPAddress, (DateTime.UtcNow - client.LastConnection).HumanizeForCurrentCulture()));
}
var messages = players.Select(client => _translationLookup["COMMANDS_FIND_FORMAT_V2"].FormatExt(client.Name,
client.ClientId, Utilities.ConvertLevelToColor((EFClient.Permission)client.LevelInt, client.Level),
client.IPAddress, (TimeProvider.System.GetUtcNow() - client.LastConnection).HumanizeForCurrentCulture()));
await gameEvent.Origin.TellAsync(messages);
}
}
}
}