Linux fix w/ config. Might implement properly later.
This commit is contained in:
@@ -23,6 +23,7 @@ namespace undead_universal_patch_il2cpp.Core.Config
|
||||
public static ConfigEntry<bool> RegistrationPatch;
|
||||
public static ConfigEntry<bool> AFKPatch;
|
||||
public static ConfigEntry<bool> RefreshTokenFix;
|
||||
public static ConfigEntry<bool> ProtonDeviceIdFix;
|
||||
}
|
||||
public static class PatchConfigDefaults
|
||||
{
|
||||
@@ -33,6 +34,7 @@ namespace undead_universal_patch_il2cpp.Core.Config
|
||||
public static bool RegistrationPatch = false;
|
||||
public static bool AFKPatch = false;
|
||||
public static bool RefreshTokenFix = false;
|
||||
public static bool ProtonDeviceIdFix = false;
|
||||
}
|
||||
public static class ServerPatchesConfig
|
||||
{
|
||||
|
||||
@@ -95,6 +95,8 @@ public class Initialization
|
||||
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,
|
||||
"Modify the game's emote text with a configuration from the server.");
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user