haha forgot to push,,,
This commit is contained in:
@@ -36,11 +36,15 @@ namespace undead_universal_patch_il2cpp.Core.Config
|
|||||||
{
|
{
|
||||||
public static ConfigEntry<bool> CustomEmotes;
|
public static ConfigEntry<bool> CustomEmotes;
|
||||||
public static ConfigEntry<bool> CustomPhoton;
|
public static ConfigEntry<bool> CustomPhoton;
|
||||||
|
public static ConfigEntry<bool> CustomMarquee;
|
||||||
|
public static ConfigEntry<bool> CustomKnownDlls;
|
||||||
}
|
}
|
||||||
public static class ServerPatchesConfigDefaults
|
public static class ServerPatchesConfigDefaults
|
||||||
{
|
{
|
||||||
public static bool CustomEmotes = false;
|
public static bool CustomEmotes = false;
|
||||||
public static bool CustomPhoton = false;
|
public static bool CustomPhoton = false;
|
||||||
|
public static bool CustomMarquee = false;
|
||||||
|
public static bool CustomKnownDlls = false;
|
||||||
}
|
}
|
||||||
public static class GameManagerConfig
|
public static class GameManagerConfig
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,11 +37,11 @@ public class DediConfig<T>
|
|||||||
if (loaded) return cached;
|
if (loaded) return cached;
|
||||||
|
|
||||||
string data = GetAlways();
|
string data = GetAlways();
|
||||||
cached = JsonSerializer.Deserialize<T>(data, _options == null ? new JsonSerializerOptions()
|
cached = JsonSerializer.Deserialize<T>(data, _options ?? new JsonSerializerOptions()
|
||||||
{
|
{
|
||||||
PropertyNameCaseInsensitive = true,
|
PropertyNameCaseInsensitive = true,
|
||||||
AllowTrailingCommas = true
|
AllowTrailingCommas = true
|
||||||
} : _options);
|
});
|
||||||
|
|
||||||
loaded = true;
|
loaded = true;
|
||||||
return cached;
|
return cached;
|
||||||
|
|||||||
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 System;
|
||||||
using BestHTTP;
|
using BestHTTP;
|
||||||
using Il2CppInterop.Runtime;
|
|
||||||
using undead_universal_patch_il2cpp.Core.Config;
|
using undead_universal_patch_il2cpp.Core.Config;
|
||||||
using undead_universal_patch_il2cpp.Patches.Photon;
|
using undead_universal_patch_il2cpp.Patches.Photon;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
@@ -24,31 +23,32 @@ public class CustomPhoton : MonoBehaviour
|
|||||||
|
|
||||||
public void Start()
|
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)
|
void OnServerConfigFailed(HTTPResponse res)
|
||||||
{
|
{
|
||||||
ServerConfigFailed = true;
|
ServerConfigFailed = true;
|
||||||
if (PhotonConfig.PatchPhotonIds.Value)
|
if (PhotonConfig.PatchPhotonIds.Value) 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 ApplyPhotonConfig(HTTPResponse res, PhotonConfigDTO photonConfig)
|
void ApplyPhotonConfig(HTTPResponse res, PhotonConfigDTO photonConfig)
|
||||||
{
|
{
|
||||||
if (!ServerPatchesConfig.CustomPhoton.Value) return;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
UniversalPatchPlugin.Log.LogInfo("Attempting Photon patch from server configuration");
|
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> postNameServerActions = [];
|
||||||
public static List<Action> postAuthenticationActions = [];
|
public static List<Action> postAuthenticationActions = [];
|
||||||
public static List<Action> postLocalAccountActions = [];
|
public static List<Action> postLocalAccountActions = [];
|
||||||
|
public static List<Action> onNotificationsOpen = [];
|
||||||
|
|
||||||
public static Il2CppSystem.Uri CreateServiceUri(Service service, string pathAndQuery)
|
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);
|
|
||||||
}
|
|
||||||
18
Core/Init.cs
18
Core/Init.cs
@@ -1,9 +1,11 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
using undead_universal_patch_il2cpp.Core.Config;
|
using undead_universal_patch_il2cpp.Core.Config;
|
||||||
|
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet.CheatManager;
|
||||||
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet.CustomEmotes;
|
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet.CustomEmotes;
|
||||||
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet.CustomPhoton;
|
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet.CustomPhoton;
|
||||||
using undead_universal_patch_il2cpp.Core.Content.UndeadGameManager;
|
using undead_universal_patch_il2cpp.Core.Content.UndeadGameManager;
|
||||||
@@ -33,7 +35,10 @@ public class Initialization
|
|||||||
{
|
{
|
||||||
UniversalPatchPlugin.Log.LogInfo("PATCH LIST START =========================");
|
UniversalPatchPlugin.Log.LogInfo("PATCH LIST START =========================");
|
||||||
foreach (var method in UniversalPatchPlugin.Instance.HarmonyInstance.GetPatchedMethods())
|
foreach (var method in UniversalPatchPlugin.Instance.HarmonyInstance.GetPatchedMethods())
|
||||||
UniversalPatchPlugin.Log.LogInfo($"- {method.ToString()}");
|
{
|
||||||
|
var paramStr = string.Join(" ", [.. method.GetParameters().Select(param => param.ParameterType.FullName)]);
|
||||||
|
UniversalPatchPlugin.Log.LogInfo($"- {method.DeclaringType.FullName} {method.Name}({paramStr})");
|
||||||
|
}
|
||||||
UniversalPatchPlugin.Log.LogInfo("PATCH LIST END =========================");
|
UniversalPatchPlugin.Log.LogInfo("PATCH LIST END =========================");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,8 +54,6 @@ public class Initialization
|
|||||||
|
|
||||||
private static void CacheChangePatchConfigs()
|
private static void CacheChangePatchConfigs()
|
||||||
{
|
{
|
||||||
if (GameManagerConfig.AnyGameFreeSpawn.Value) GameFreeSpawns.config.Get();
|
|
||||||
if (GameManagerConfig.StaticGameConfig.Value) GameConfigurator.config.Get();
|
|
||||||
VideoTamperPatch.config.Get();
|
VideoTamperPatch.config.Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,6 +63,7 @@ public class Initialization
|
|||||||
|
|
||||||
if (ServerPatchesConfig.CustomEmotes.Value) UniversalPatchPlugin.Instance.AddComponent<CustomEmotes>();
|
if (ServerPatchesConfig.CustomEmotes.Value) UniversalPatchPlugin.Instance.AddComponent<CustomEmotes>();
|
||||||
UniversalPatchPlugin.Instance.AddComponent<CustomPhoton>();
|
UniversalPatchPlugin.Instance.AddComponent<CustomPhoton>();
|
||||||
|
if (ServerPatchesConfig.CustomKnownDlls.Value) UniversalPatchPlugin.Instance.AddComponent<CustomCheatManager>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void FetchConfigurations()
|
private static void FetchConfigurations()
|
||||||
@@ -91,11 +95,15 @@ public class Initialization
|
|||||||
"Patch Photon ServerSettings values with a configuration from the server." +
|
"Patch Photon ServerSettings values with a configuration from the server." +
|
||||||
"\nWhen the server fails to provide a valid configuration, values from the local config will be used." +
|
"\nWhen the server fails to provide a valid configuration, values from the local config will be used." +
|
||||||
"\nPhoton.PatchPhotonIds must be enabled for this fallback to work.");
|
"\nPhoton.PatchPhotonIds must be enabled for this fallback to work.");
|
||||||
|
ServerPatchesConfig.CustomMarquee = UniversalPatchPlugin.Instance.Config.Bind("ServerPatches", "CustomMarquee", ServerPatchesConfigDefaults.CustomMarquee,
|
||||||
|
"Set custom text on the ^reccenter theater marquee.");
|
||||||
|
ServerPatchesConfig.CustomKnownDlls = UniversalPatchPlugin.Instance.Config.Bind("ServerPatches", "CustomKnownDlls", ServerPatchesConfigDefaults.CustomKnownDlls,
|
||||||
|
"Add items to the list of known DLLs.");
|
||||||
|
|
||||||
GameManagerConfig.AnyGameFreeSpawn = UniversalPatchPlugin.Instance.Config.Bind("GameManagerConfig", "AnyGameFreeSpawn", GameManagerConfigDefaults.AnyGameFreeSpawn,
|
GameManagerConfig.AnyGameFreeSpawn = UniversalPatchPlugin.Instance.Config.Bind("GameManagerConfig", "AnyGameFreeSpawn", GameManagerConfigDefaults.AnyGameFreeSpawn,
|
||||||
$"Use patches from '{GameFreeSpawns.config.path}' to spawn in any valid player spawnpoint in specified games. See README.md");
|
$"Spawn in any valid player spawnpoint in specified games. See README.md");
|
||||||
GameManagerConfig.StaticGameConfig = UniversalPatchPlugin.Instance.Config.Bind("GameManagerConfig", "StaticGameConfig", GameManagerConfigDefaults.StaticGameConfig,
|
GameManagerConfig.StaticGameConfig = UniversalPatchPlugin.Instance.Config.Bind("GameManagerConfig", "StaticGameConfig", GameManagerConfigDefaults.StaticGameConfig,
|
||||||
$"Use patches from '{GameConfigurator.config.path}' to set new configurations for built-in games. See README.md");
|
$"Set new configurations for built-in games. See README.md");
|
||||||
|
|
||||||
PhotonConfig.PatchPhotonIds = UniversalPatchPlugin.Instance.Config.Bind("Photon", "PatchPhotonIds", PhotonConfigDefaults.PatchPhotonIds,
|
PhotonConfig.PatchPhotonIds = UniversalPatchPlugin.Instance.Config.Bind("Photon", "PatchPhotonIds", PhotonConfigDefaults.PatchPhotonIds,
|
||||||
"Patch Photon configuration.");
|
"Patch Photon configuration.");
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2024 proxnet.dev
|
Copyright (c) 2025 proxnet.dev by @zombieb
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using System.Security.Cryptography;
|
||||||
using BestHTTP;
|
using BestHTTP;
|
||||||
|
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using undead_universal_patch_il2cpp.Core;
|
using undead_universal_patch_il2cpp.Core;
|
||||||
using undead_universal_patch_il2cpp.Core.Config;
|
using undead_universal_patch_il2cpp.Core.Config;
|
||||||
@@ -35,7 +37,7 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
]).Success;
|
]).Success;
|
||||||
|
|
||||||
static MethodBase TargetMethod() => patchResult.Method;
|
static MethodBase TargetMethod() => patchResult.Method;
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
static void Prefix(ref object request)
|
static void Prefix(ref object request)
|
||||||
{
|
{
|
||||||
@@ -66,7 +68,7 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
|
|
||||||
if (GenericConfig.LogAllRequests.Value)
|
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 Before : {beforeUrl}\n" +
|
||||||
$" URL After : {(beforeUrl == afterUrl ? "(unmodified)" : afterUrl)}\n" +
|
$" URL After : {(beforeUrl == afterUrl ? "(unmodified)" : afterUrl)}\n" +
|
||||||
$" Method : {method}\n" +
|
$" Method : {method}\n" +
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using undead_universal_patch_il2cpp.Core;
|
using undead_universal_patch_il2cpp.Core;
|
||||||
using undead_universal_patch_il2cpp.Core.Config;
|
using undead_universal_patch_il2cpp.Core.Config;
|
||||||
using undead_universal_patch_il2cpp.Core.Content.UndeadGameManager;
|
|
||||||
|
|
||||||
namespace undead_universal_patch_il2cpp.Patches.UndeadGameManager;
|
namespace undead_universal_patch_il2cpp.Patches.UndeadGameManager;
|
||||||
|
|
||||||
[HarmonyPatch]
|
[HarmonyPatch]
|
||||||
public class FreeSpawnsPatch_Array
|
public class FreeSpawnsPatch_Array
|
||||||
{
|
{
|
||||||
public static List<string> config = GameFreeSpawns.config.Get();
|
public static List<string> spawns = null;
|
||||||
|
|
||||||
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
|
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
|
||||||
GameManagerConfig.AnyGameFreeSpawn,
|
GameManagerConfig.AnyGameFreeSpawn,
|
||||||
@@ -26,6 +24,12 @@ public class FreeSpawnsPatch_Array
|
|||||||
|
|
||||||
public static void Postfix(ref GamePlayerSpawnPoint __instance)
|
public static void Postfix(ref GamePlayerSpawnPoint __instance)
|
||||||
{
|
{
|
||||||
|
if (spawns == null)
|
||||||
|
{
|
||||||
|
Util.ConditionalDebug("FreeSpawns was not yet fetched!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Util.ConditionalDebug("Attempting FreeSpawns patch");
|
Util.ConditionalDebug("Attempting FreeSpawns patch");
|
||||||
GameManager man = NetworkedSingletonMonoBehaviour<GameManager>.instance;
|
GameManager man = NetworkedSingletonMonoBehaviour<GameManager>.instance;
|
||||||
|
|
||||||
@@ -39,7 +43,7 @@ public class FreeSpawnsPatch_Array
|
|||||||
Util.ConditionalDebug("CurrentGameConfiguration.configurationData was null");
|
Util.ConditionalDebug("CurrentGameConfiguration.configurationData was null");
|
||||||
return;
|
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");
|
Util.ConditionalDebug($"Game '{man.CurrentGameConfiguration.configurationData.Name}' is not specified by GameFreeSpawns");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace undead_universal_patch_il2cpp.Patches.UndeadGameManager;
|
|||||||
[HarmonyPatch]
|
[HarmonyPatch]
|
||||||
public class GameConfiguratorPatch
|
public class GameConfiguratorPatch
|
||||||
{
|
{
|
||||||
static Dictionary<string, GameConfigurationAssetDTO> gameConfig = GameConfigurator.config.Get();
|
public static Dictionary<string, GameConfigurationAssetDTO> gameConfig = null;
|
||||||
|
|
||||||
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
|
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
|
||||||
GameManagerConfig.StaticGameConfig,
|
GameManagerConfig.StaticGameConfig,
|
||||||
@@ -28,6 +28,12 @@ public class GameConfiguratorPatch
|
|||||||
|
|
||||||
public static void Prefix(ref GameConfigurationAsset config, ref bool showNotification)
|
public static void Prefix(ref GameConfigurationAsset config, ref bool showNotification)
|
||||||
{
|
{
|
||||||
|
if (gameConfig == null)
|
||||||
|
{
|
||||||
|
Util.ConditionalDebug("gameconfigassets was not yet fetched!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var conf = config;
|
var conf = config;
|
||||||
showNotification = GenericConfig.PatchDebug.Value;
|
showNotification = GenericConfig.PatchDebug.Value;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
using System.Reflection;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using undead_universal_patch_il2cpp.Core;
|
using undead_universal_patch_il2cpp.Core;
|
||||||
using undead_universal_patch_il2cpp.Core.Config;
|
using undead_universal_patch_il2cpp.Core.Config;
|
||||||
@@ -22,19 +24,16 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
|
|
||||||
static void Prefix()
|
static void Prefix()
|
||||||
{
|
{
|
||||||
if (PatchConfig.HilePatch.Value) HilePatch.Patch();
|
if (!ServerPatchesConfig.CustomKnownDlls.Value && PatchConfig.HilePatch.Value) HilePatch.Patch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class HilePatch
|
public static class HilePatch
|
||||||
{
|
{
|
||||||
public static void Patch()
|
public static void Patch([Optional] string[] dlls)
|
||||||
{
|
{
|
||||||
GameObject cheatManagerObject = GameObject.Find("[CheatManager]");
|
Util.ConditionalDebug($"Patching KnownDlls with {(dlls != null ? dlls.Length : 0)} new filenames");
|
||||||
HileManager hileManager = cheatManagerObject.GetComponent<HileManager>();
|
string[] baseDlls = [
|
||||||
|
|
||||||
PropertyInfo knownDllsProperty = AccessTools.Property(typeof(HileManager), "KnownDlls");
|
|
||||||
knownDllsProperty.SetValue(hileManager, new Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppStringArray([
|
|
||||||
"GameAssembly.dll",
|
"GameAssembly.dll",
|
||||||
"UnityPlayer.dll",
|
"UnityPlayer.dll",
|
||||||
"WinPixEventRuntime.dll",
|
"WinPixEventRuntime.dll",
|
||||||
@@ -46,9 +45,16 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
"ddraw.dll",
|
"ddraw.dll",
|
||||||
"dxgi.dll",
|
"dxgi.dll",
|
||||||
"winhttp.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.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
Patches/Internals/LockerroomOOBEFlow.cs
Normal file
30
Patches/Internals/LockerroomOOBEFlow.cs
Normal 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()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45
Patches/Internals/NotificationTargets/MarqueeTexts.cs
Normal file
45
Patches/Internals/NotificationTargets/MarqueeTexts.cs
Normal 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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
Patches/Internals/Notifications.cs
Normal file
28
Patches/Internals/Notifications.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,6 +36,5 @@ public class AuthenticationEventPatch
|
|||||||
action();
|
action();
|
||||||
}
|
}
|
||||||
else RanPostActions = true;
|
else RanPostActions = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
@@ -37,7 +37,7 @@ public class PhotonPatch
|
|||||||
PropertyInfo voiceAppIdProperty = serverSettingsType.GetRuntimeProperty("VoiceAppID");
|
PropertyInfo voiceAppIdProperty = serverSettingsType.GetRuntimeProperty("VoiceAppID");
|
||||||
|
|
||||||
Util.ConditionalDebug($"New Photon AppID: '{photonConfig.AppID}'");
|
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);
|
appIdProperty.SetValue(serverSettings, photonConfig.AppID);
|
||||||
voiceAppIdProperty.SetValue(serverSettings, photonConfig.VoiceAppID);
|
voiceAppIdProperty.SetValue(serverSettings, photonConfig.VoiceAppID);
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ using undead_universal_patch_il2cpp.Core;
|
|||||||
|
|
||||||
namespace undead_universal_patch_il2cpp;
|
namespace undead_universal_patch_il2cpp;
|
||||||
|
|
||||||
[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.il2cpp", "Undead Universal Patch", "2.1.1")]
|
[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.il2cpp", "Undead Universal Patch", "2.2.0")]
|
||||||
public class UniversalPatchPlugin : BasePlugin
|
public class UniversalPatchPlugin : BasePlugin
|
||||||
{
|
{
|
||||||
public static new readonly ManualLogSource Log = Logger.CreateLogSource("UUPatch");
|
public static new readonly ManualLogSource Log = Logger.CreateLogSource("UUPatch");
|
||||||
|
|||||||
@@ -31,8 +31,9 @@ Run BepInEx interop on your build and add the following assemblies to new folder
|
|||||||
- `BepInEx/interop/Il2CppSystem.dll`
|
- `BepInEx/interop/Il2CppSystem.dll`
|
||||||
- `BepInEx/interop/Photon3Unity3D.dll`
|
- `BepInEx/interop/Photon3Unity3D.dll`
|
||||||
- `BepInEx/interop/RecRoom.Datastructures.Runtime`
|
- `BepInEx/interop/RecRoom.Datastructures.Runtime`
|
||||||
` `BepInEx/interop/RecRoom.Promises.Runtime`
|
- `BepInEx/interop/RecRoom.Promises.Runtime`
|
||||||
- `BepInEx/interop/UnityEngine.CoreModule.dll`
|
- `BepInEx/interop/UnityEngine.CoreModule.dll`
|
||||||
|
- `BepInEx/interop/UnityEngine.TextRenderingModule.dll`
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ Voice will go over the same gameserver port as PUN does when selfhosting.
|
|||||||
|
|
||||||
See [the source](./Core/Content/CustomRecNet/CustomPhoton/CustomPhoton.cs) for more information.
|
See [the source](./Core/Content/CustomRecNet/CustomPhoton/CustomPhoton.cs) for more information.
|
||||||
|
|
||||||
|
### `API: GET "/api/undead/v1/knowndlls"` (post-nameserver)
|
||||||
|
Expects: `List<string>`
|
||||||
|
|
||||||
|
Add custom DLL filenames to `CheatManager.KnownDlls`. `winhttp.dll` is added by default and does not need to be specified by the server.
|
||||||
|
When the server patch is enabled at the same time as the local patch (HilePatch), the local patch will be used as a fallback and will add only `winhttp.dll`.
|
||||||
|
|
||||||
|
See [the source](./Core/Content/CustomRecNet/CheatManager/CustomCheatManager.cs) for more information.
|
||||||
|
|
||||||
## DTOs
|
## DTOs
|
||||||
|
|
||||||
### `EmoteConfigDTO`
|
### `EmoteConfigDTO`
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<TargetFramework>net6.0</TargetFramework>
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
<AssemblyName>undead_universal_patch_il2cpp</AssemblyName>
|
<AssemblyName>undead_universal_patch_il2cpp</AssemblyName>
|
||||||
<Description>Non-EAC, IL2CPP build patcher for Rec Room (Late 2018*-*April 2020) </Description>
|
<Description>Non-EAC, IL2CPP build patcher for Rec Room (Late 2018*-*April 2020) </Description>
|
||||||
<Version>2.1.1</Version>
|
<Version>2.2.0</Version>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<RestoreAdditionalProjectSources>
|
<RestoreAdditionalProjectSources>
|
||||||
@@ -15,6 +15,10 @@
|
|||||||
<RootNamespace>undead_universal_patch_il2cpp</RootNamespace>
|
<RootNamespace>undead_universal_patch_il2cpp</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Core\Content\CustomRecNet\CheatManager\CustomCheatManager.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.*" IncludeAssets="compile" />
|
<PackageReference Include="BepInEx.Unity.IL2CPP" Version="6.0.0-be.*" IncludeAssets="compile" />
|
||||||
<PackageReference Include="Mapster" Version="7.4.0" />
|
<PackageReference Include="Mapster" Version="7.4.0" />
|
||||||
@@ -42,5 +46,8 @@
|
|||||||
<Reference Include="UnityEngine.CoreModule">
|
<Reference Include="UnityEngine.CoreModule">
|
||||||
<HintPath>AssemblyReferences\UnityEngine.CoreModule.dll</HintPath>
|
<HintPath>AssemblyReferences\UnityEngine.CoreModule.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="UnityEngine.TextRenderingModule">
|
||||||
|
<HintPath>..\RecRoom 4766551521966830741\BepInEx\interop\UnityEngine.TextRenderingModule.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
Reference in New Issue
Block a user