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

game interface improvements

This commit is contained in:
RaidMax
2022-02-13 21:38:40 -06:00
parent 6eaae7ea22
commit 96b53ada1b
5 changed files with 91 additions and 40 deletions

View File

@ -236,7 +236,7 @@ namespace IW4MAdmin
private async Task CreatePluginTask(IPlugin plugin, GameEvent gameEvent)
{
// we don't want to run the events on parser plugins
if (plugin is ScriptPlugin scriptPlugin && scriptPlugin.IsParser)
if (plugin is ScriptPlugin { IsParser: true })
{
return;
}
@ -248,6 +248,11 @@ namespace IW4MAdmin
{
await plugin.OnEventAsync(gameEvent, this).WithWaitCancellation(tokenSource.Token);
}
catch (OperationCanceledException)
{
ServerLogger.LogWarning("Timed out executing event {EventType} for {Plugin}", gameEvent.Type,
plugin.Name);
}
catch (Exception ex)
{
Console.WriteLine(loc["SERVER_PLUGIN_ERROR"].FormatExt(plugin.Name, ex.GetType().Name));