mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
**Description** As of right now `ValidationUtil.cs` does not perform it's intended function, and the callers of it are not properly using the result. Removed the redundant calls and implemented `GameValidationPatch.cs` to properly implement this behavior. If the check fails; 1. All interface elements are disabled. 2. Notification popup is sent. 3. Logs are sent to the `Console`, `Server` and `BepInEx`. **Related** Closes: SPT-AKI/Issues#435 **Showcase** https://streamable.com/2ra4sa Co-authored-by: Deadly <info.saddiki@gmail.com> Reviewed-on: SPT-AKI/Modules#76 Co-authored-by: Deadly Alden <deadly@noreply.dev.sp-tarkov.com> Co-committed-by: Deadly Alden <deadly@noreply.dev.sp-tarkov.com>
43 lines
1.3 KiB
C#
43 lines
1.3 KiB
C#
using System;
|
|
using Aki.Common;
|
|
using Aki.Core.Patches;
|
|
using BepInEx;
|
|
|
|
namespace Aki.Core
|
|
{
|
|
[BepInPlugin("com.spt-aki.core", "AKI.Core", AkiPluginInfo.PLUGIN_VERSION)]
|
|
class AkiCorePlugin : 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: Aki.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();
|
|
new PreventClientModsPatch().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: Aki.Core");
|
|
}
|
|
}
|
|
}
|