allow toggle of automated penalties display on the webfront

issue #112
fix small issue with script plugin loading
This commit is contained in:
RaidMax
2020-02-12 13:13:59 -06:00
parent c3c21a7749
commit f430dab3a7
9 changed files with 134 additions and 36 deletions

View File

@ -1,4 +1,5 @@
using Jint;
using Microsoft.CSharp.RuntimeBinder;
using SharedLibraryCore;
using SharedLibraryCore.Database.Models;
using SharedLibraryCore.Interfaces;
@ -100,19 +101,20 @@ namespace IW4MAdmin.Application.Misc
Name = pluginObject.name;
Version = (float)pluginObject.version;
await OnLoadAsync(manager);
try
{
if (pluginObject.isParser)
{
await OnLoadAsync(manager);
IEventParser eventParser = (IEventParser)_scriptEngine.GetValue("eventParser").ToObject();
IRConParser rconParser = (IRConParser)_scriptEngine.GetValue("rconParser").ToObject();
manager.AdditionalEventParsers.Add(eventParser);
manager.AdditionalRConParsers.Add(rconParser);
}
}
catch { }
catch (RuntimeBinderException) { }
if (!firstRun)
{