0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 06:10:45 -05:00
modules/project/SPT.Core/SPTCorePlugin.cs
2024-05-21 19:10:17 +01:00

43 lines
1.2 KiB
C#

using System;
using SPT.Common;
using SPT.Core.Patches;
using BepInEx;
namespace SPT.Core
{
[BepInPlugin("com.SPT.core", "SPT.Core", SPTPluginInfo.PLUGIN_VERSION)]
class SPTCorePlugin : BaseUnityPlugin
{
// Temp static logger field, remove along with plugin whitelisting before release
internal static BepInEx.Logging.ManualLogSource _logger;
public void Awake()
{
_logger = Logger;
Logger.LogInfo("Loading: SPT.Core");
try
{
new ConsistencySinglePatch().Enable();
new ConsistencyMultiPatch().Enable();
new GameValidationPatch().Enable();
new BattlEyePatch().Enable();
new SslCertificatePatch().Enable();
new UnityWebRequestPatch().Enable();
new WebSocketPatch().Enable();
new TransportPrefixPatch().Enable();
}
catch (Exception ex)
{
Logger.LogError($"A PATCH IN {GetType().Name} FAILED. SUBSEQUENT PATCHES HAVE NOT LOADED");
Logger.LogError($"{GetType().Name}: {ex}");
throw;
}
Logger.LogInfo("Completed: SPT.Core");
}
}
}