[F] Crash with the new modified SDEZ145 DLL with deleted methods

This commit is contained in:
Clansty 2024-09-17 02:48:07 +08:00
parent 5ee7add355
commit 9598ac5a50
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
4 changed files with 32 additions and 16 deletions

View File

@ -293,6 +293,7 @@
<Compile Include="Fix\DisableReboot.cs" /> <Compile Include="Fix\DisableReboot.cs" />
<Compile Include="Fix\ExtendNotesPool.cs" /> <Compile Include="Fix\ExtendNotesPool.cs" />
<Compile Include="Fix\FixCharaCrash.cs" /> <Compile Include="Fix\FixCharaCrash.cs" />
<Compile Include="Fix\FixCheckAuth.cs" />
<Compile Include="Fix\ForceAsServer.cs" /> <Compile Include="Fix\ForceAsServer.cs" />
<Compile Include="Fix\ForceFreePlay.cs" /> <Compile Include="Fix\ForceFreePlay.cs" />
<Compile Include="Fix\ForcePaidPlay.cs" /> <Compile Include="Fix\ForcePaidPlay.cs" />

View File

@ -1,7 +1,5 @@
using AMDaemon.Allnet; using HarmonyLib;
using HarmonyLib;
using Manager; using Manager;
using Manager.Operation;
using Monitor.MusicSelect.ChainList; using Monitor.MusicSelect.ChainList;
using Net; using Net;
using UnityEngine; using UnityEngine;
@ -17,16 +15,6 @@ public class BasicFix
return false; return false;
} }
[HarmonyPostfix]
[HarmonyPatch(typeof(OperationManager), "CheckAuth_Proc")]
private static void PostCheckAuthProc(ref OperationData ____operationData)
{
if (Auth.GameServerUri.StartsWith("http://") || Auth.GameServerUri.StartsWith("https://"))
{
____operationData.ServerUri = Auth.GameServerUri;
}
}
[HarmonyPrefix] [HarmonyPrefix]
[HarmonyPatch(typeof(DebugInput), "GetKey")] [HarmonyPatch(typeof(DebugInput), "GetKey")]
private static bool GetKey(ref bool __result, KeyCode name) private static bool GetKey(ref bool __result, KeyCode name)

View File

@ -0,0 +1,19 @@
using AMDaemon.Allnet;
using HarmonyLib;
using Manager;
using Manager.Operation;
namespace AquaMai.Fix;
public class FixCheckAuth
{
[HarmonyPostfix]
[HarmonyPatch(typeof(OperationManager), "CheckAuth_Proc")]
private static void PostCheckAuthProc(ref OperationData ____operationData)
{
if (Auth.GameServerUri.StartsWith("http://") || Auth.GameServerUri.StartsWith("https://"))
{
____operationData.ServerUri = Auth.GameServerUri;
}
}
}

View File

@ -24,10 +24,17 @@ namespace AquaMai
private void Patch(Type type) private void Patch(Type type)
{ {
MelonLogger.Msg($"> Patching {type}"); MelonLogger.Msg($"> Patching {type}");
HarmonyInstance.PatchAll(type); try
foreach (var nested in type.GetNestedTypes())
{ {
Patch(nested); HarmonyInstance.PatchAll(type);
foreach (var nested in type.GetNestedTypes())
{
Patch(nested);
}
}
catch (Exception e)
{
MelonLogger.Error($"Failed to patch {type}: {e}");
} }
} }
@ -96,6 +103,7 @@ namespace AquaMai
Patch(typeof(BasicFix)); Patch(typeof(BasicFix));
Patch(typeof(DisableReboot)); Patch(typeof(DisableReboot));
Patch(typeof(ExtendNotesPool)); Patch(typeof(ExtendNotesPool));
Patch(typeof(FixCheckAuth));
// UX // UX
Patch(typeof(CustomVersionString)); Patch(typeof(CustomVersionString));
Patch(typeof(CustomPlaceName)); Patch(typeof(CustomPlaceName));