forked from zombieb/undead-universal-patch-il2cpp
haha forgot to push,,,
This commit is contained in:
38
Core/Content/CustomRecNet/CheatManager/CustomCheatManager.cs
Normal file
38
Core/Content/CustomRecNet/CheatManager/CustomCheatManager.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using BestHTTP;
|
||||
using System.Collections.Generic;
|
||||
using undead_universal_patch_il2cpp.Core.Config;
|
||||
using undead_universal_patch_il2cpp.Patches;
|
||||
using UnityEngine;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Core.Content.CustomRecNet.CheatManager;
|
||||
|
||||
public class CustomCheatManager : MonoBehaviour
|
||||
{
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (ServerPatchesConfig.CustomKnownDlls.Value) RecNetInteractions.postNameServerActions.Add(DownloadKnownDlls);
|
||||
}
|
||||
|
||||
void Patch(HTTPResponse _res, List<string> dlls)
|
||||
{
|
||||
UniversalPatchPlugin.Log.LogInfo("Setting new KnownDlls (server)");
|
||||
|
||||
HilePatch.Patch([.. dlls]);
|
||||
}
|
||||
|
||||
void OnFailed(HTTPResponse _res)
|
||||
{
|
||||
if (PatchConfig.HilePatch.Value)
|
||||
{
|
||||
UniversalPatchPlugin.Log.LogInfo("Setting new KnownDlls (local fallback)");
|
||||
HilePatch.Patch();
|
||||
}
|
||||
}
|
||||
|
||||
void DownloadKnownDlls()
|
||||
{
|
||||
RecNetInteractions.SendRequest<List<string>>(HTTPMethods.Get, RecNet.Service.API, "/api/undead/v1/knowndlls", Patch, OnFailed);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user