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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP;
|
||||
using undead_universal_patch_il2cpp.Patches.UndeadGameManager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Core.Content.CustomRecNet.CustomGameManager;
|
||||
|
||||
public class CustomFreeSpawns : MonoBehaviour
|
||||
{
|
||||
public void Start()
|
||||
{
|
||||
RecNetInteractions.postAuthenticationActions.Add(DownloadFreeSpawns);
|
||||
}
|
||||
|
||||
public void OnFailed([Optional] HTTPResponse res)
|
||||
{
|
||||
Util.ConditionalDebug($"CustomFreeSpawns failed: HTTP Error {res.StatusCode}");
|
||||
}
|
||||
|
||||
public void Finished(HTTPResponse res, List<string> spawns)
|
||||
{
|
||||
FreeSpawnsPatch_Array.spawns = spawns;
|
||||
}
|
||||
|
||||
public void DownloadFreeSpawns()
|
||||
{
|
||||
RecNetInteractions.SendRequest<List<string>>(HTTPMethods.Get, RecNet.Service.API, "/api/undead/v1/freespawns", Finished, OnFailed);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using BestHTTP;
|
||||
using undead_universal_patch_il2cpp.Core.Content.UndeadGameManager;
|
||||
using undead_universal_patch_il2cpp.Patches.UndeadGameManager;
|
||||
using UnityEngine;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Core.Content.CustomRecNet.CustomGameManager;
|
||||
|
||||
public class CustomGameManager : MonoBehaviour
|
||||
{
|
||||
public void Start()
|
||||
{
|
||||
RecNetInteractions.postAuthenticationActions.Add(DownlaodGameConfigAssets);
|
||||
}
|
||||
|
||||
public void OnFailed([Optional] HTTPResponse res)
|
||||
{
|
||||
Util.ConditionalDebug($"CustomGameManager failed: HTTP Error {res.StatusCode}");
|
||||
}
|
||||
|
||||
public void Finished(HTTPResponse res, Dictionary<string, GameConfigurationAssetDTO> configs)
|
||||
{
|
||||
GameConfiguratorPatch.gameConfig = configs;
|
||||
}
|
||||
|
||||
public void DownlaodGameConfigAssets()
|
||||
{
|
||||
RecNetInteractions.SendRequest<Dictionary<string, GameConfigurationAssetDTO>>(HTTPMethods.Get, RecNet.Service.API, "/api/undead/v1/gameconfigassets", Finished, OnFailed);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using BestHTTP;
|
||||
using Il2CppInterop.Runtime;
|
||||
using undead_universal_patch_il2cpp.Core.Config;
|
||||
using undead_universal_patch_il2cpp.Patches.Photon;
|
||||
using UnityEngine;
|
||||
@@ -24,31 +23,32 @@ public class CustomPhoton : MonoBehaviour
|
||||
|
||||
public void Start()
|
||||
{
|
||||
RecNetInteractions.postLocalAccountActions.Add(DownloadServerConfig);
|
||||
if (ServerPatchesConfig.CustomPhoton.Value) RecNetInteractions.postLocalAccountActions.Add(DownloadServerConfig);
|
||||
else if (PhotonConfig.PatchPhotonIds.Value) LocalPatch();
|
||||
}
|
||||
|
||||
void LocalPatch()
|
||||
{
|
||||
UniversalPatchPlugin.Log.LogInfo("Attempting Photon patch from local configuration");
|
||||
PhotonPatch.Patch(new PhotonConfigDTO
|
||||
{
|
||||
Logging = PhotonConfig.PunLogging.Value,
|
||||
AppID = PhotonConfig.AppID.Value,
|
||||
VoiceAppID = PhotonConfig.VoiceAppID.Value,
|
||||
SelfHosted = PhotonConfig.SelfHosted.Value,
|
||||
ServerAddress = PhotonConfig.ServerAddress.Value,
|
||||
ServerPort = PhotonConfig.ServerPort.Value,
|
||||
ConnectionProtocol = PhotonConfig.ConnectionProtocol.Value
|
||||
});
|
||||
}
|
||||
|
||||
void OnServerConfigFailed(HTTPResponse res)
|
||||
{
|
||||
ServerConfigFailed = true;
|
||||
if (PhotonConfig.PatchPhotonIds.Value)
|
||||
{
|
||||
UniversalPatchPlugin.Log.LogInfo("Attempting Photon patch from local configuration");
|
||||
PhotonPatch.Patch(new PhotonConfigDTO
|
||||
{
|
||||
Logging = PhotonConfig.PunLogging.Value,
|
||||
AppID = PhotonConfig.AppID.Value,
|
||||
VoiceAppID = PhotonConfig.VoiceAppID.Value,
|
||||
SelfHosted = PhotonConfig.SelfHosted.Value,
|
||||
ServerAddress = PhotonConfig.ServerAddress.Value,
|
||||
ServerPort = PhotonConfig.ServerPort.Value,
|
||||
ConnectionProtocol = PhotonConfig.ConnectionProtocol.Value
|
||||
});
|
||||
}
|
||||
if (PhotonConfig.PatchPhotonIds.Value) LocalPatch();
|
||||
}
|
||||
void ApplyPhotonConfig(HTTPResponse res, PhotonConfigDTO photonConfig)
|
||||
{
|
||||
if (!ServerPatchesConfig.CustomPhoton.Value) return;
|
||||
|
||||
try
|
||||
{
|
||||
UniversalPatchPlugin.Log.LogInfo("Attempting Photon patch from server configuration");
|
||||
|
||||
@@ -15,6 +15,7 @@ public class RecNetInteractions
|
||||
public static List<Action> postNameServerActions = [];
|
||||
public static List<Action> postAuthenticationActions = [];
|
||||
public static List<Action> postLocalAccountActions = [];
|
||||
public static List<Action> onNotificationsOpen = [];
|
||||
|
||||
public static Il2CppSystem.Uri CreateServiceUri(Service service, string pathAndQuery)
|
||||
{
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using undead_universal_patch_il2cpp.Core.Config;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Core.Content.UndeadGameManager;
|
||||
|
||||
public static class GameConfigurator
|
||||
{
|
||||
static readonly string name = "GameConfigurations";
|
||||
public static DediConfig<Dictionary<string, GameConfigurationAssetDTO>> config = new(name, "{}", null);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using undead_universal_patch_il2cpp.Core.Config;
|
||||
|
||||
namespace undead_universal_patch_il2cpp.Core.Content.UndeadGameManager;
|
||||
|
||||
public static class GameFreeSpawns
|
||||
{
|
||||
static readonly string name = "GameFreeSpawns";
|
||||
public static DediConfig<List<string>> config = new(name, "[]", null);
|
||||
}
|
||||
Reference in New Issue
Block a user