mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-07 21:58:06 -05:00
prevent auto parsing of base gamescript and anticheat events to mitigate unneeded processing time
This commit is contained in:
parent
135fc98e1c
commit
a34ac7d224
@ -6,6 +6,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Data.Models;
|
||||
using IW4MAdmin.Plugins.Stats.Events;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using SharedLibraryCore.Events.Game;
|
||||
using SharedLibraryCore.Interfaces.Events;
|
||||
@ -201,8 +202,18 @@ namespace IW4MAdmin.Application.EventParsers
|
||||
{
|
||||
var createdEvent = _gameScriptEventFactory.Create(split[0], logLine.Replace(split[0], ""));
|
||||
if (createdEvent is not null)
|
||||
{
|
||||
var eventTypeName = createdEvent.GetType().Name;
|
||||
var isParseIgnoredEvent = eventTypeName is nameof(GameScriptEvent) or nameof(AntiCheatDamageEvent);
|
||||
|
||||
// avoid parsing base script event (which has no viable properties)
|
||||
// and anticheat events as they are manually mapped.
|
||||
// for performance as dynamic "Invoke" is relatively costly due
|
||||
if (isParseIgnoredEvent)
|
||||
{
|
||||
createdEvent.ParseArguments();
|
||||
}
|
||||
|
||||
return createdEvent as GameEventV2;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user