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

@@ -1,6 +1,8 @@
using System;
using System.Reflection;
using System.Security.Cryptography;
using BestHTTP;
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls;
using HarmonyLib;
using undead_universal_patch_il2cpp.Core;
using undead_universal_patch_il2cpp.Core.Config;
@@ -35,7 +37,7 @@ namespace undead_universal_patch_il2cpp.Patches
]).Success;
static MethodBase TargetMethod() => patchResult.Method;
[HarmonyPrefix]
static void Prefix(ref object request)
{
@@ -66,7 +68,7 @@ namespace undead_universal_patch_il2cpp.Patches
if (GenericConfig.LogAllRequests.Value)
{
if (GenericConfig.VerboseRequestLogs.Value) UniversalPatchPlugin.Log.LogInfo("BestHTTP Request Log\n" +
if (GenericConfig.VerboseRequestLogs.Value) UniversalPatchPlugin.Log.LogInfo($"BestHTTP Request Log{(customCertProp.GetGetMethod().Invoke(request, []) == null ? "" : " (verify)")}\n" +
$" URL Before : {beforeUrl}\n" +
$" URL After : {(beforeUrl == afterUrl ? "(unmodified)" : afterUrl)}\n" +
$" Method : {method}\n" +

View File

@@ -1,17 +1,15 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using HarmonyLib;
using undead_universal_patch_il2cpp.Core;
using undead_universal_patch_il2cpp.Core.Config;
using undead_universal_patch_il2cpp.Core.Content.UndeadGameManager;
namespace undead_universal_patch_il2cpp.Patches.UndeadGameManager;
[HarmonyPatch]
public class FreeSpawnsPatch_Array
{
public static List<string> config = GameFreeSpawns.config.Get();
public static List<string> spawns = null;
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
GameManagerConfig.AnyGameFreeSpawn,
@@ -26,6 +24,12 @@ public class FreeSpawnsPatch_Array
public static void Postfix(ref GamePlayerSpawnPoint __instance)
{
if (spawns == null)
{
Util.ConditionalDebug("FreeSpawns was not yet fetched!");
return;
}
Util.ConditionalDebug("Attempting FreeSpawns patch");
GameManager man = NetworkedSingletonMonoBehaviour<GameManager>.instance;
@@ -39,7 +43,7 @@ public class FreeSpawnsPatch_Array
Util.ConditionalDebug("CurrentGameConfiguration.configurationData was null");
return;
}
if (!config.Contains(man.CurrentGameConfiguration.configurationData.Name))
if (!spawns.Contains(man.CurrentGameConfiguration.configurationData.Name))
{
Util.ConditionalDebug($"Game '{man.CurrentGameConfiguration.configurationData.Name}' is not specified by GameFreeSpawns");
return;

View File

@@ -13,7 +13,7 @@ namespace undead_universal_patch_il2cpp.Patches.UndeadGameManager;
[HarmonyPatch]
public class GameConfiguratorPatch
{
static Dictionary<string, GameConfigurationAssetDTO> gameConfig = GameConfigurator.config.Get();
public static Dictionary<string, GameConfigurationAssetDTO> gameConfig = null;
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
GameManagerConfig.StaticGameConfig,
@@ -28,6 +28,12 @@ public class GameConfiguratorPatch
public static void Prefix(ref GameConfigurationAsset config, ref bool showNotification)
{
if (gameConfig == null)
{
Util.ConditionalDebug("gameconfigassets was not yet fetched!");
return;
}
var conf = config;
showNotification = GenericConfig.PatchDebug.Value;

View File

@@ -1,4 +1,6 @@
using System.Reflection;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using HarmonyLib;
using undead_universal_patch_il2cpp.Core;
using undead_universal_patch_il2cpp.Core.Config;
@@ -22,19 +24,16 @@ namespace undead_universal_patch_il2cpp.Patches
static void Prefix()
{
if (PatchConfig.HilePatch.Value) HilePatch.Patch();
if (!ServerPatchesConfig.CustomKnownDlls.Value && PatchConfig.HilePatch.Value) HilePatch.Patch();
}
}
public static class HilePatch
{
public static void Patch()
public static void Patch([Optional] string[] dlls)
{
GameObject cheatManagerObject = GameObject.Find("[CheatManager]");
HileManager hileManager = cheatManagerObject.GetComponent<HileManager>();
PropertyInfo knownDllsProperty = AccessTools.Property(typeof(HileManager), "KnownDlls");
knownDllsProperty.SetValue(hileManager, new Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppStringArray([
Util.ConditionalDebug($"Patching KnownDlls with {(dlls != null ? dlls.Length : 0)} new filenames");
string[] baseDlls = [
"GameAssembly.dll",
"UnityPlayer.dll",
"WinPixEventRuntime.dll",
@@ -46,9 +45,16 @@ namespace undead_universal_patch_il2cpp.Patches
"ddraw.dll",
"dxgi.dll",
"winhttp.dll"
]));
];
if (dlls != null) baseDlls = baseDlls.Concat(dlls).ToArray();
UniversalPatchPlugin.Log.LogInfo("Hile patch succeeded.");
GameObject cheatManagerObject = GameObject.Find("[CheatManager]");
HileManager hileManager = cheatManagerObject.GetComponent<HileManager>();
PropertyInfo knownDllsProperty = AccessTools.Property(typeof(HileManager), "KnownDlls");
knownDllsProperty.SetValue(hileManager, new Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppStringArray(baseDlls));
UniversalPatchPlugin.Log.LogInfo($"Hile patch succeeded: {baseDlls.Length} new KnownDlls.");
}
}
}

View File

@@ -0,0 +1,30 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using undead_universal_patch_il2cpp.Core;
using UnityEngine;
namespace undead_universal_patch_il2cpp.Patches.Internals
{
[HarmonyPatch]
public class LockerroomOOBEFlow
{
static PatchTypesResult patchResult = Util.PreparePatchTypes(
"Event patch for changing marquee text in the reccenter",
"LockerroomOOBEFlow",
"Start"
);
static bool Prepare() => patchResult.Success;
static MethodBase TargetMethod() => patchResult.Method;
static void Postfix()
{
}
}
}

View File

@@ -0,0 +1,45 @@
using Il2CppInterop.Runtime;
using RecNet;
using System.Collections.Generic;
using System.Linq;
using undead_universal_patch_il2cpp.Core.Config;
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
using UnityEngine;
namespace undead_universal_patch_il2cpp.Patches.Internals.NotificationTargets
{
public class MarqueeTexts : MonoBehaviour
{
void Start()
{
if (ServerPatchesConfig.CustomMarquee.Value)
{
UniversalPatchPlugin.Log.LogWarning("CustomMarquee patch is unavailable at this time. A future update may resolve this.");
//RecNetInteractions.onNotificationsOpen.Add(OnSocketOpen);
}
}
void OnSocketOpen()
{
var d = DelegateSupport.ConvertDelegate<RecNet.Notifications.NotificationHandler>(OnTextChange);
RecNet.Notifications.RegisterHandler("MarqueeTexts", d);
}
void OnTextChange(Dictionary<string, string> args)
{
GameObject go = GameObject.Find("DynamicObjects/[RecCenter_Marquee]");
string[] transforms = ["Text", "Now Playing", "SubText"];
var texts = transforms.Select(str => go.transform.Find(str).GetComponent<TextMesh>()).ToArray();
foreach (var t in transforms)
{
TextMesh tm = go.transform.Find(t).GetComponent<TextMesh>();
args.TryGetValue(t, out string res);
tm.text = res;
}
Core.Util.ConditionalDebug("Replaced marquee texts");
}
}
}

View File

@@ -0,0 +1,28 @@
using HarmonyLib;
using Il2CppInterop.Runtime;
using RecNet;
using System.Reflection;
using undead_universal_patch_il2cpp.Core;
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
namespace undead_universal_patch_il2cpp.Patches.Internals
{
[HarmonyPatch]
public class Notifications
{
static PatchTypesResult patchResult = Core.Util.PreparePatchTypes(
"Event patch for notification availability",
"RecNet.Notifications",
"OnOpenInternal"
);
static bool Prepare() => patchResult.Success;
static MethodBase TargetMethod() => patchResult.Method;
static void Postfix(ref SignalRHubConnection hub)
{
UniversalPatchPlugin.Log.LogInfo("Running onNotificationsOpen actions");
foreach (var action in RecNetInteractions.onNotificationsOpen) action();
}
}
}

View File

@@ -36,6 +36,5 @@ public class AuthenticationEventPatch
action();
}
else RanPostActions = true;
}
}

View File

@@ -1,18 +0,0 @@
using System.Reflection;
using HarmonyLib;
using undead_universal_patch_il2cpp.Core;
namespace undead_universal_patch_il2cpp.Patches.Photon;
[HarmonyPatch]
public class NameserverTest
{
static PatchTypesResult patchTypesResult = Util.PreparePatchTypes(
"Photon nameserver test",
"NetworkingPeer",
"GetNameServerAddress"
);
static bool Prepare() => patchTypesResult.Success;
static MethodBase TargetMethod() => patchTypesResult.Method;
}

View File

@@ -37,7 +37,7 @@ public class PhotonPatch
PropertyInfo voiceAppIdProperty = serverSettingsType.GetRuntimeProperty("VoiceAppID");
Util.ConditionalDebug($"New Photon AppID: '{photonConfig.AppID}'");
Util.ConditionalDebug($"New Photon AppID: '{photonConfig.VoiceAppID}'");
Util.ConditionalDebug($"New Photon VoiceAppID: '{photonConfig.VoiceAppID}'");
appIdProperty.SetValue(serverSettings, photonConfig.AppID);
voiceAppIdProperty.SetValue(serverSettings, photonConfig.VoiceAppID);