2023-03-03 18:52:31 +00:00
|
|
|
using System;
|
2023-06-21 13:43:15 +03:00
|
|
|
using Aki.Common;
|
2023-03-03 18:52:31 +00:00
|
|
|
using Aki.Core.Patches;
|
|
|
|
using BepInEx;
|
|
|
|
|
|
|
|
namespace Aki.Core
|
|
|
|
{
|
2023-06-21 13:43:15 +03:00
|
|
|
[BepInPlugin("com.spt-aki.core", "AKI.Core", AkiPluginInfo.PLUGIN_VERSION)]
|
2023-03-03 18:52:31 +00:00
|
|
|
class AkiCorePlugin : BaseUnityPlugin
|
|
|
|
{
|
2024-02-01 16:43:18 +00:00
|
|
|
// Temp static logger field, remove along with plugin whitelisting before release
|
2024-02-02 13:59:10 +00:00
|
|
|
internal static BepInEx.Logging.ManualLogSource _logger;
|
2024-02-01 16:43:18 +00:00
|
|
|
|
2023-11-14 18:49:42 +00:00
|
|
|
public void Awake()
|
2023-03-03 18:52:31 +00:00
|
|
|
{
|
2024-02-01 16:43:18 +00:00
|
|
|
_logger = Logger;
|
|
|
|
|
2023-03-03 18:52:31 +00:00
|
|
|
Logger.LogInfo("Loading: Aki.Core");
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
new ConsistencySinglePatch().Enable();
|
|
|
|
new ConsistencyMultiPatch().Enable();
|
2024-02-08 09:10:34 +00:00
|
|
|
new GameValidationPatch().Enable();
|
2023-03-03 18:52:31 +00:00
|
|
|
new BattlEyePatch().Enable();
|
|
|
|
new SslCertificatePatch().Enable();
|
|
|
|
new UnityWebRequestPatch().Enable();
|
|
|
|
new WebSocketPatch().Enable();
|
|
|
|
new TransportPrefixPatch().Enable();
|
|
|
|
}
|
|
|
|
catch (Exception ex)
|
|
|
|
{
|
2023-10-10 10:58:33 +00:00
|
|
|
Logger.LogError($"A PATCH IN {GetType().Name} FAILED. SUBSEQUENT PATCHES HAVE NOT LOADED");
|
2023-03-03 18:52:31 +00:00
|
|
|
Logger.LogError($"{GetType().Name}: {ex}");
|
2024-03-14 17:08:20 +00:00
|
|
|
|
2023-03-03 18:52:31 +00:00
|
|
|
throw;
|
|
|
|
}
|
|
|
|
|
|
|
|
Logger.LogInfo("Completed: Aki.Core");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|