Preparing for PluginLoader

This commit is contained in:
Sardelka
2022-06-30 09:28:13 +08:00
parent f9b9d78b79
commit 58362c2613
7 changed files with 101 additions and 74 deletions

View File

@ -1,6 +1,7 @@
using System.IO;
using RageCoop.Core.Scripting;
using ICSharpCode.SharpZipLib.Zip;
using System;
namespace RageCoop.Client.Scripting
{
@ -15,7 +16,15 @@ namespace RageCoop.Client.Scripting
{
foreach (var s in d.Scripts)
{
Main.QueueAction(() => s.OnStart());
try
{
s.OnStart();
}
catch(Exception ex)
{
Logger.Error("Error occurred when starting script:"+s.GetType().FullName);
Logger?.Error(ex);
}
}
}
}
@ -28,7 +37,15 @@ namespace RageCoop.Client.Scripting
{
foreach (var s in d.Scripts)
{
Main.QueueAction(() => s.OnStop());
try
{
s.OnStop();
}
catch (Exception ex)
{
Logger.Error("Error occurred when stopping script:"+s.GetType().FullName);
Logger?.Error(ex);
}
}
}
}