haha forgot to push,,,

This commit is contained in:
2025-09-11 19:54:25 -04:00
parent d45fc2c953
commit 9318ac75d6
25 changed files with 296 additions and 86 deletions

View 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);
}
}

View File

@@ -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);
}
}

View File

@@ -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);
}
}

View File

@@ -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");

View File

@@ -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)
{