Compare commits
11 Commits
8ac42d3fc5
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| ae54aab490 | |||
| 4800fe995a | |||
| 9f5eb531b6 | |||
| b861c0236a | |||
| 18eab45ec3 | |||
| 2ff60f8399 | |||
| 4649042ac1 | |||
| 672b34b556 | |||
| 10e8797ba2 | |||
| 584f19b016 | |||
| a924465919 |
@@ -22,6 +22,8 @@ namespace undead_universal_patch_il2cpp.Core.Config
|
|||||||
public static ConfigEntry<bool> ImageSignaturePatch;
|
public static ConfigEntry<bool> ImageSignaturePatch;
|
||||||
public static ConfigEntry<bool> RegistrationPatch;
|
public static ConfigEntry<bool> RegistrationPatch;
|
||||||
public static ConfigEntry<bool> AFKPatch;
|
public static ConfigEntry<bool> AFKPatch;
|
||||||
|
public static ConfigEntry<bool> RefreshTokenFix;
|
||||||
|
public static ConfigEntry<bool> ProtonDeviceIdFix;
|
||||||
}
|
}
|
||||||
public static class PatchConfigDefaults
|
public static class PatchConfigDefaults
|
||||||
{
|
{
|
||||||
@@ -31,6 +33,8 @@ namespace undead_universal_patch_il2cpp.Core.Config
|
|||||||
public static bool ImageSignaturePatch = false;
|
public static bool ImageSignaturePatch = false;
|
||||||
public static bool RegistrationPatch = false;
|
public static bool RegistrationPatch = false;
|
||||||
public static bool AFKPatch = false;
|
public static bool AFKPatch = false;
|
||||||
|
public static bool RefreshTokenFix = false;
|
||||||
|
public static bool ProtonDeviceIdFix = false;
|
||||||
}
|
}
|
||||||
public static class ServerPatchesConfig
|
public static class ServerPatchesConfig
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public class RecNetInteractions
|
|||||||
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 List<Action> onNotificationsOpen = [];
|
||||||
|
public static List<Action> onLogout = [];
|
||||||
|
public static List<Action> onPlatformInitialize = [];
|
||||||
|
|
||||||
public static Il2CppSystem.Uri CreateServiceUri(Service service, string pathAndQuery)
|
public static Il2CppSystem.Uri CreateServiceUri(Service service, string pathAndQuery)
|
||||||
{
|
{
|
||||||
|
|||||||
21
Core/Init.cs
21
Core/Init.cs
@@ -43,6 +43,7 @@ public class Initialization
|
|||||||
UniversalPatchPlugin.Log.LogInfo("PATCH LIST END =========================");
|
UniversalPatchPlugin.Log.LogInfo("PATCH LIST END =========================");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// to be removed in a future update
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
CacheChangePatchConfigs();
|
CacheChangePatchConfigs();
|
||||||
@@ -62,8 +63,9 @@ public class Initialization
|
|||||||
{
|
{
|
||||||
UniversalPatchPlugin.Log.LogInfo("Attaching game objects");
|
UniversalPatchPlugin.Log.LogInfo("Attaching game objects");
|
||||||
|
|
||||||
if (ServerPatchesConfig.CustomEmotes.Value) UniversalPatchPlugin.Instance.AddComponent<CustomEmotes>();
|
UniversalPatchPlugin.Instance.AddComponent<SteamPlatform>();
|
||||||
UniversalPatchPlugin.Instance.AddComponent<CustomPhoton>();
|
UniversalPatchPlugin.Instance.AddComponent<CustomPhoton>();
|
||||||
|
if (ServerPatchesConfig.CustomEmotes.Value) UniversalPatchPlugin.Instance.AddComponent<CustomEmotes>();
|
||||||
if (ServerPatchesConfig.CustomKnownDlls.Value) UniversalPatchPlugin.Instance.AddComponent<CustomCheatManager>();
|
if (ServerPatchesConfig.CustomKnownDlls.Value) UniversalPatchPlugin.Instance.AddComponent<CustomCheatManager>();
|
||||||
if (ServerPatchesConfig.CustomGameConfigurations.Value) UniversalPatchPlugin.Instance.AddComponent<CustomGameManager>();
|
if (ServerPatchesConfig.CustomGameConfigurations.Value) UniversalPatchPlugin.Instance.AddComponent<CustomGameManager>();
|
||||||
}
|
}
|
||||||
@@ -76,20 +78,25 @@ public class Initialization
|
|||||||
"Log all BestHTTP requests sent by the game.");
|
"Log all BestHTTP requests sent by the game.");
|
||||||
GenericConfig.VerboseRequestLogs = UniversalPatchPlugin.Instance.Config.Bind("Generic", "VerboseRequestLogs", GenericConfigDefaults.VerboseRequestLogs,
|
GenericConfig.VerboseRequestLogs = UniversalPatchPlugin.Instance.Config.Bind("Generic", "VerboseRequestLogs", GenericConfigDefaults.VerboseRequestLogs,
|
||||||
"Add additional request information to BestHTTPProxy logs. Requires LogAllRequest to be enabled.");
|
"Add additional request information to BestHTTPProxy logs. Requires LogAllRequest to be enabled.");
|
||||||
PatchConfig.CertificatePatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "CertificatePatch", PatchConfigDefaults.CertificatePatch,
|
PatchConfig.CertificatePatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "CertificatePatch", PatchConfigDefaults.CertificatePatch,
|
||||||
"The game expects a certain certificate from rec.net when making HTTPS requests. Enable this to allow any valid certificate.");
|
"The game expects a certain certificate from rec.net when making HTTPS requests. Enable this to allow any valid certificate.");
|
||||||
PatchConfig.HilePatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "HilePatch", PatchConfigDefaults.HilePatch,
|
PatchConfig.HilePatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "HilePatch", PatchConfigDefaults.HilePatch,
|
||||||
"The game will close after a short period of time if BepInEx is found. Enable to stop this from happening." +
|
"The game will close after a short period of time if BepInEx is found. Enable to stop this from happening." +
|
||||||
"\nThis will also enable the AGRoomRuntimeConfig patch. See the README for more info.");
|
"\nThis will also enable the AGRoomRuntimeConfig patch. See the README for more info.");
|
||||||
PatchConfig.SignalRHandshakeFix = UniversalPatchPlugin.Instance.Config.Bind("Generic", "SignalRHandshakeFix", PatchConfigDefaults.SignalRHandshakeFix,
|
PatchConfig.SignalRHandshakeFix = UniversalPatchPlugin.Instance.Config.Bind("Patches", "SignalRHandshakeFix", PatchConfigDefaults.SignalRHandshakeFix,
|
||||||
"Replace apostrophes with quotes in the initial SignalR handshake.");
|
"Replace apostrophes with quotes in the initial SignalR handshake.");
|
||||||
PatchConfig.ImageSignaturePatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "ImageSignaturePatch", PatchConfigDefaults.ImageSignaturePatch,
|
PatchConfig.ImageSignaturePatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "ImageSignaturePatch", PatchConfigDefaults.ImageSignaturePatch,
|
||||||
"When enabled, all image signatures will be valid." +
|
"When enabled, all image signatures will be valid." +
|
||||||
"\nWorks only if the server appends a properly formatted signature header (signature does not need to be valid)");
|
"\nWorks only if the server appends a properly formatted signature header (signature does not need to be valid)");
|
||||||
PatchConfig.RegistrationPatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "RegistrationPatch", PatchConfigDefaults.RegistrationPatch,
|
PatchConfig.RegistrationPatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "RegistrationPatch", PatchConfigDefaults.RegistrationPatch,
|
||||||
"Always disable the registration prompt.");
|
"Always disable the registration prompt.");
|
||||||
PatchConfig.AFKPatch = UniversalPatchPlugin.Instance.Config.Bind("Generic", "AFKPatch", PatchConfigDefaults.AFKPatch,
|
PatchConfig.AFKPatch = UniversalPatchPlugin.Instance.Config.Bind("Patches", "AFKPatch", PatchConfigDefaults.AFKPatch,
|
||||||
"Always present patch. Never get kicked to dorm for being AFK.");
|
"Always present patch. Never get kicked to dorm for being AFK.");
|
||||||
|
PatchConfig.RefreshTokenFix = UniversalPatchPlugin.Instance.Config.Bind("Patches", "RefreshTokenFix", PatchConfigDefaults.RefreshTokenFix,
|
||||||
|
"Fix for the game needlessly requesting a refresh token in a loop. Cause for this issue is unknown." +
|
||||||
|
"\nDon't enable unless you know what this does.");
|
||||||
|
PatchConfig.ProtonDeviceIdFix = UniversalPatchPlugin.Instance.Config.Bind("Patches", "ProtonDeviceIdFix", PatchConfigDefaults.ProtonDeviceIdFix,
|
||||||
|
"Fix for device IDs on Wine/Proton. Enable if you get a null reference exception related to cryptography APIs during connect/token.");
|
||||||
|
|
||||||
ServerPatchesConfig.CustomEmotes = UniversalPatchPlugin.Instance.Config.Bind("ServerPatches", "CustomEmotes", ServerPatchesConfigDefaults.CustomEmotes,
|
ServerPatchesConfig.CustomEmotes = UniversalPatchPlugin.Instance.Config.Bind("ServerPatches", "CustomEmotes", ServerPatchesConfigDefaults.CustomEmotes,
|
||||||
"Modify the game's emote text with a configuration from the server.");
|
"Modify the game's emote text with a configuration from the server.");
|
||||||
|
|||||||
14
Core/PluginHash.cs
Normal file
14
Core/PluginHash.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Security.Cryptography;
|
||||||
|
|
||||||
|
namespace undead_universal_patch_il2cpp.Core;
|
||||||
|
|
||||||
|
public class PluginHash
|
||||||
|
{
|
||||||
|
public static string GetHash()
|
||||||
|
{
|
||||||
|
return BitConverter.ToString(MD5.Create().ComputeHash(File.OpenRead(Assembly.GetExecutingAssembly().Location))).Replace("-", "").ToLowerInvariant();
|
||||||
|
}
|
||||||
|
}
|
||||||
46
Core/SteamPlatform.cs
Normal file
46
Core/SteamPlatform.cs
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
using Il2CppInterop.Runtime;
|
||||||
|
using Steamworks;
|
||||||
|
using System;
|
||||||
|
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace undead_universal_patch_il2cpp.Core;
|
||||||
|
|
||||||
|
public class SteamPlatform : MonoBehaviour
|
||||||
|
{
|
||||||
|
public static string AuthTicket { get; set; } = null;
|
||||||
|
|
||||||
|
void GetAuthTicket() {
|
||||||
|
SteamPlatformManager manager = PlatformManager.Instance.GetComponentInChildren<SteamPlatformManager>();
|
||||||
|
manager.GetAuthSessionTicket().Then(
|
||||||
|
DelegateSupport.ConvertDelegate<Il2CppSystem.Action<SteamPlatformManager.AuthSessionTicket>>((SteamPlatformManager.AuthSessionTicket ticket) =>
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(ticket.Error)) UniversalPatchPlugin.Log.LogError($"Could not get Steam auth ticket!: {ticket.Error}");
|
||||||
|
else
|
||||||
|
{
|
||||||
|
AuthTicket = BitConverter.ToString(ticket.Ticket).Replace("-", "").ToUpperInvariant().TrimEnd('0');
|
||||||
|
Util.ConditionalDebug($"Got new Steam auth ticket");
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
RecNetInteractions.onLogout.Add(GetAuthTicket);
|
||||||
|
RecNetInteractions.onPlatformInitialize.Add(GetAuthTicket);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Every time the user logs out of matchmaking
|
||||||
|
or when PlatformManager initializes, fetch a new ticket.
|
||||||
|
The user might be logging out to the account selection screen
|
||||||
|
where they might create a new one; a Steam auth ticket is added to
|
||||||
|
the auth params in the create request and it must be valid.
|
||||||
|
|
||||||
|
It *is* possible (though very unlikely) that the user creates a new account
|
||||||
|
before the first ticket is fetched, since the method that gets a ticket is
|
||||||
|
an IPromise.
|
||||||
|
|
||||||
|
If this way of doing things isn't the best, fix it and I'll merge
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
2
LINUX.md
2
LINUX.md
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
[<-- Back to README.md](./README.md)
|
[<-- Back to README.md](./README.md)
|
||||||
|
|
||||||
|
**Linux support is currently broken due to Proton bugs with .NET cryptography APIs. This may be resolved in a future update.**
|
||||||
|
|
||||||
No native Linux build exists for the game. Proton, however, works just fine. You can install it using the instructions below.
|
No native Linux build exists for the game. Proton, however, works just fine. You can install it using the instructions below.
|
||||||
|
|
||||||
Reminder that EAC or Referee builds will never be supported by Undead Universal Patch.
|
Reminder that EAC or Referee builds will never be supported by Undead Universal Patch.
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Security.Cryptography;
|
using System.Threading.Tasks;
|
||||||
using BestHTTP;
|
using BestHTTP;
|
||||||
using BestHTTP.SecureProtocol.Org.BouncyCastle.Crypto.Tls;
|
using BestHTTP.Forms;
|
||||||
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 UnityEngine;
|
||||||
|
|
||||||
namespace undead_universal_patch_il2cpp.Patches
|
namespace undead_universal_patch_il2cpp.Patches
|
||||||
{
|
{
|
||||||
@@ -24,6 +25,8 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
|
|
||||||
static readonly MethodInfo getHeaderMethod = requestType?.GetMethod("GetFirstHeaderValue");
|
static readonly MethodInfo getHeaderMethod = requestType?.GetMethod("GetFirstHeaderValue");
|
||||||
static readonly MethodInfo addHeaderMethod = requestType?.GetMethod("AddHeader");
|
static readonly MethodInfo addHeaderMethod = requestType?.GetMethod("AddHeader");
|
||||||
|
static readonly MethodInfo getFormFields = requestType?.GetMethod("GetFormFields");
|
||||||
|
static readonly PropertyInfo formImplProp = requestType?.GetProperty("FormImpl");
|
||||||
static readonly PropertyInfo methodTypeProp = requestType?.GetProperty("MethodType");
|
static readonly PropertyInfo methodTypeProp = requestType?.GetProperty("MethodType");
|
||||||
static readonly PropertyInfo uriProp = requestType?.GetProperty("Uri");
|
static readonly PropertyInfo uriProp = requestType?.GetProperty("Uri");
|
||||||
static readonly PropertyInfo customCertProp = requestType?.GetProperty("CustomCertificateVerifyer");
|
static readonly PropertyInfo customCertProp = requestType?.GetProperty("CustomCertificateVerifyer");
|
||||||
@@ -32,13 +35,13 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
getHeaderMethod,
|
getHeaderMethod,
|
||||||
addHeaderMethod,
|
addHeaderMethod,
|
||||||
methodTypeProp,
|
methodTypeProp,
|
||||||
|
getFormFields,
|
||||||
|
formImplProp,
|
||||||
uriProp,
|
uriProp,
|
||||||
customCertProp
|
customCertProp
|
||||||
]).Success;
|
]).Success;
|
||||||
|
|
||||||
static MethodBase TargetMethod() => patchResult.Method;
|
static MethodBase TargetMethod() => patchResult.Method;
|
||||||
|
|
||||||
[HarmonyPrefix]
|
|
||||||
static void Prefix(ref object request)
|
static void Prefix(ref object request)
|
||||||
{
|
{
|
||||||
if (PatchConfig.CertificatePatch.Value) customCertProp.GetSetMethod().Invoke(request, [null]);
|
if (PatchConfig.CertificatePatch.Value) customCertProp.GetSetMethod().Invoke(request, [null]);
|
||||||
@@ -61,6 +64,16 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
|
|
||||||
if (newUri.Host.Contains("ns.rec.net")) newUri = new Il2CppSystem.Uri(NameserverConfig.NewUrl.Value);
|
if (newUri.Host.Contains("ns.rec.net")) newUri = new Il2CppSystem.Uri(NameserverConfig.NewUrl.Value);
|
||||||
|
|
||||||
|
bool isAccCreate = newUri.PathAndQuery.Contains("account/create");
|
||||||
|
if (isAccCreate && SteamPlatform.AuthTicket != null)
|
||||||
|
{
|
||||||
|
HTTPFormBase form = (HTTPFormBase)formImplProp.GetValue(request, null);
|
||||||
|
|
||||||
|
form.AddField("x-steam-ticket", SteamPlatform.AuthTicket);
|
||||||
|
Util.ConditionalDebug("Added Steam ticket to create request");
|
||||||
|
}
|
||||||
|
else if (isAccCreate) UniversalPatchPlugin.Log.LogError("The Steam auth ticket has not yet been fetched, account creation might fail!");
|
||||||
|
|
||||||
// Finish request changes
|
// Finish request changes
|
||||||
|
|
||||||
string afterUrl = newUri.ToString();
|
string afterUrl = newUri.ToString();
|
||||||
@@ -73,9 +86,8 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
$" URL After : {(beforeUrl == afterUrl ? "(unmodified)" : afterUrl)}\n" +
|
$" URL After : {(beforeUrl == afterUrl ? "(unmodified)" : afterUrl)}\n" +
|
||||||
$" Method : {method}\n" +
|
$" Method : {method}\n" +
|
||||||
$" Content-Type : {contentType ?? "(not set)"}");
|
$" Content-Type : {contentType ?? "(not set)"}");
|
||||||
else UniversalPatchPlugin.Log.LogInfo("BestHTTPProxy Request Log\n" +
|
else UniversalPatchPlugin.Log.LogInfo("BestHTTPProxy Request\n" +
|
||||||
$" Before : {beforeUrl}\n" +
|
$" {method} {afterUrl}");
|
||||||
$" After : {afterUrl}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
29
Patches/Internals/DeviceIdBuilder.cs
Normal file
29
Patches/Internals/DeviceIdBuilder.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using HarmonyLib;
|
||||||
|
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||||
|
using undead_universal_patch_il2cpp.Core;
|
||||||
|
using undead_universal_patch_il2cpp.Core.Config;
|
||||||
|
|
||||||
|
namespace undead_universal_patch_il2cpp.Patches.Internals;
|
||||||
|
|
||||||
|
[HarmonyPatch]
|
||||||
|
public class DeviceIdBuilder
|
||||||
|
{
|
||||||
|
static PatchTypesResult typesResult = Util.ConfigPreparePatchTypes(
|
||||||
|
PatchConfig.ProtonDeviceIdFix,
|
||||||
|
"Proton quickfix for device ID errors",
|
||||||
|
"RecRoom.Utils.DeviceIdBuilder",
|
||||||
|
"CalculateOtherDeviceId"
|
||||||
|
);
|
||||||
|
|
||||||
|
static MethodBase TargetMethod() => typesResult.Method;
|
||||||
|
static bool Prepare() => typesResult.Success;
|
||||||
|
|
||||||
|
static bool Prefix(ref Il2CppStructArray<byte> __result)
|
||||||
|
{
|
||||||
|
Util.ConditionalDebug("Device ID patched");
|
||||||
|
__result = new Il2CppStructArray<byte>(Encoding.UTF8.GetBytes("Wine/Proton"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
30
Patches/Internals/LoginHelper.cs
Normal file
30
Patches/Internals/LoginHelper.cs
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
using BestHTTP.Forms;
|
||||||
|
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;
|
||||||
|
|
||||||
|
namespace undead_universal_patch_il2cpp.Patches.Internals;
|
||||||
|
|
||||||
|
[HarmonyPatch]
|
||||||
|
public class LoginHelperFieldsPatch
|
||||||
|
{
|
||||||
|
static PatchTypesResult typesResult = Util.PreparePatchTypes(
|
||||||
|
"Add patch hash to the login form",
|
||||||
|
"RecNet.Login",
|
||||||
|
"LoginHelper"
|
||||||
|
);
|
||||||
|
|
||||||
|
static MethodBase TargetMethod() => typesResult.Method;
|
||||||
|
static bool Prepare() => typesResult.Success;
|
||||||
|
|
||||||
|
static void Prefix(ref HTTPUrlEncodedForm loginParams)
|
||||||
|
{
|
||||||
|
loginParams.AddField("x-patch-plugin-hash", PluginHash.GetHash());
|
||||||
|
Util.ConditionalDebug("Added hash to login form");
|
||||||
|
}
|
||||||
|
}
|
||||||
30
Patches/Internals/OnLogout.cs
Normal file
30
Patches/Internals/OnLogout.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 undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
|
||||||
|
|
||||||
|
namespace undead_universal_patch_il2cpp.Patches.Internals;
|
||||||
|
|
||||||
|
[HarmonyPatch]
|
||||||
|
public class LogoutEvent
|
||||||
|
{
|
||||||
|
static PatchTypesResult typesResult = Util.PreparePatchTypes(
|
||||||
|
"RecNet logout event patch",
|
||||||
|
"RecNet.Login",
|
||||||
|
"OnLogout"
|
||||||
|
);
|
||||||
|
|
||||||
|
static MethodBase TargetMethod() => typesResult.Method;
|
||||||
|
static bool Prepare() => typesResult.Success;
|
||||||
|
|
||||||
|
static void Postfix()
|
||||||
|
{
|
||||||
|
Util.ConditionalDebug("Running onLogout actions");
|
||||||
|
foreach (var action in RecNetInteractions.onLogout) action();
|
||||||
|
}
|
||||||
|
}
|
||||||
29
Patches/Internals/PlatformManager.cs
Normal file
29
Patches/Internals/PlatformManager.cs
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
using HarmonyLib;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using undead_universal_patch_il2cpp.Core;
|
||||||
|
using undead_universal_patch_il2cpp.Core.Content.CustomRecNet;
|
||||||
|
|
||||||
|
namespace undead_universal_patch_il2cpp.Patches.Internals;
|
||||||
|
|
||||||
|
[HarmonyPatch]
|
||||||
|
public class SteamPlatformManagerEvent
|
||||||
|
{
|
||||||
|
static PatchTypesResult typesResult = Util.PreparePatchTypes(
|
||||||
|
"On SteamPlatformManager.Initialize",
|
||||||
|
"SteamPlatformManager",
|
||||||
|
"Initialize"
|
||||||
|
);
|
||||||
|
|
||||||
|
static MethodBase TargetMethod() => typesResult.Method;
|
||||||
|
static bool Prepare() => typesResult.Success;
|
||||||
|
|
||||||
|
static void Postfix()
|
||||||
|
{
|
||||||
|
UniversalPatchPlugin.Log.LogInfo("Running post-steam platform initialize actions");
|
||||||
|
foreach (var action in RecNetInteractions.onPlatformInitialize) action();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,19 +22,13 @@ public class AuthenticationEventPatch
|
|||||||
|
|
||||||
static MethodBase TargetMethod() => patchResult.Method;
|
static MethodBase TargetMethod() => patchResult.Method;
|
||||||
|
|
||||||
private static bool RanPostActions { get; set; } = false;
|
|
||||||
static void Postfix(ref string accessToken)
|
static void Postfix(ref string accessToken)
|
||||||
{
|
{
|
||||||
UniversalPatchPlugin.Log.LogInfo("Intercepted AccessToken");
|
UniversalPatchPlugin.Log.LogInfo("Intercepted AccessToken");
|
||||||
RecNetInteractions.AccessToken = accessToken;
|
RecNetInteractions.AccessToken = accessToken;
|
||||||
|
|
||||||
if (!RanPostActions)
|
UniversalPatchPlugin.Log.LogInfo("Running post-authentication actions");
|
||||||
{
|
|
||||||
bool value = (bool)hasAccessTokenProperty.GetValue(patchResult.Type);
|
|
||||||
if (value) UniversalPatchPlugin.Log.LogInfo("Running post-authentication actions");
|
|
||||||
foreach (var action in RecNetInteractions.postAuthenticationActions)
|
foreach (var action in RecNetInteractions.postAuthenticationActions)
|
||||||
action();
|
action();
|
||||||
}
|
}
|
||||||
else RanPostActions = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
27
Patches/Internals/RefreshTokenFix.cs
Normal file
27
Patches/Internals/RefreshTokenFix.cs
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
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 undead_universal_patch_il2cpp.Core.Config;
|
||||||
|
|
||||||
|
namespace undead_universal_patch_il2cpp.Patches.Internals;
|
||||||
|
|
||||||
|
[HarmonyPatch]
|
||||||
|
public class RefreshTokenFix
|
||||||
|
{
|
||||||
|
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
|
||||||
|
PatchConfig.RefreshTokenFix,
|
||||||
|
"Refresh token implementation fix for some servers",
|
||||||
|
"RecNet.Login",
|
||||||
|
"OnLocalAccountUpdated"
|
||||||
|
);
|
||||||
|
|
||||||
|
static MethodBase TargetMethod() => patchResult.Method;
|
||||||
|
static bool Prepare() => patchResult.Success;
|
||||||
|
|
||||||
|
static bool Prefix() => false;
|
||||||
|
}
|
||||||
@@ -10,22 +10,15 @@ namespace undead_universal_patch_il2cpp.Patches
|
|||||||
{
|
{
|
||||||
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
|
static PatchTypesResult patchResult = Util.ConfigPreparePatchTypes(
|
||||||
PatchConfig.RegistrationPatch,
|
PatchConfig.RegistrationPatch,
|
||||||
"Registration patch (to be vetted, might not work)",
|
"Registration patch",
|
||||||
"UnityEngine.PlayerPrefs",
|
"ProfileWatchUIFlow",
|
||||||
"GetInt"
|
"Button_Email"
|
||||||
);
|
);
|
||||||
|
|
||||||
static bool Prepare() => patchResult.Success;
|
static bool Prepare() => patchResult.Success;
|
||||||
|
|
||||||
static MethodInfo TargetMethod() => patchResult.Method;
|
static MethodInfo TargetMethod() => patchResult.Method;
|
||||||
|
|
||||||
static void Postfix(ref string key, ref int defaultValue, ref int __result)
|
static bool Prefix() => false;
|
||||||
{
|
|
||||||
if (key.StartsWith("IncompleteRegistration-"))
|
|
||||||
{
|
|
||||||
__result = 0;
|
|
||||||
UniversalPatchPlugin.Log.LogInfo("Detour'd IncompleteRegistration pref key");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -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.2.0")]
|
[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.il2cpp", "Undead Universal Patch", "3.1.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");
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
# Undead Universal Patch
|
## Undead Universal Patch
|
||||||
|
|
||||||
|
# Moved
|
||||||
|
Moved to https://gitea.proxnet.dev/GalvanicCorrosion/UndeadUniversalPatch
|
||||||
|
|
||||||
|
## Legacy Patch Plugin
|
||||||
|
|
||||||
Non-EAC, IL2CPP build patcher for Rec Room (Dec 2018\*-*Apr 3 2020)
|
Non-EAC, IL2CPP build patcher for Rec Room (Dec 2018\*-*Apr 3 2020)
|
||||||
|
|
||||||
|
|||||||
@@ -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.2.0</Version>
|
<Version>3.1.0</Version>
|
||||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
<RestoreAdditionalProjectSources>
|
<RestoreAdditionalProjectSources>
|
||||||
|
|||||||
Reference in New Issue
Block a user