2024-07-09 18:11:06 +08:00
|
|
|
|
using AMDaemon;
|
|
|
|
|
using AMDaemon.Allnet;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using Manager;
|
|
|
|
|
using Manager.Operation;
|
2024-08-04 12:27:09 +08:00
|
|
|
|
using Net;
|
2024-07-27 05:47:45 +08:00
|
|
|
|
using UnityEngine;
|
2024-07-09 18:11:06 +08:00
|
|
|
|
|
|
|
|
|
namespace AquaMai.Fix;
|
|
|
|
|
|
|
|
|
|
public class BasicFix
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPrefix]
|
2024-07-26 23:24:42 +08:00
|
|
|
|
[HarmonyPatch(typeof(MAI2System.IniFile), "clear")]
|
2024-07-09 18:11:06 +08:00
|
|
|
|
private static bool PreIniFileClear()
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(LanInstall), "IsServer", MethodType.Getter)]
|
|
|
|
|
private static bool PreIsServer(ref bool __result)
|
|
|
|
|
{
|
|
|
|
|
__result = true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
2024-07-26 23:24:42 +08:00
|
|
|
|
[HarmonyPatch(typeof(AMDaemon.Network), "IsLanAvailable", MethodType.Getter)]
|
2024-07-09 18:11:06 +08:00
|
|
|
|
private static bool PreIsLanAvailable(ref bool __result)
|
|
|
|
|
{
|
|
|
|
|
__result = 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;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-07-26 23:24:42 +08:00
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(Manager.Credit), "IsFreePlay")]
|
|
|
|
|
private static bool PreIsFreePlay(ref bool __result)
|
|
|
|
|
{
|
|
|
|
|
__result = true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-07-27 05:47:45 +08:00
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(DebugInput), "GetKey")]
|
|
|
|
|
private static bool GetKey(ref bool __result, KeyCode name)
|
|
|
|
|
{
|
|
|
|
|
__result = UnityEngine.Input.GetKey(name);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(DebugInput), "GetKeyDown")]
|
|
|
|
|
private static bool GetKeyDown(ref bool __result, KeyCode name)
|
|
|
|
|
{
|
|
|
|
|
__result = UnityEngine.Input.GetKeyDown(name);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(DebugInput), "GetMouseButton")]
|
|
|
|
|
private static bool GetMouseButton(ref bool __result, int button)
|
|
|
|
|
{
|
|
|
|
|
__result = UnityEngine.Input.GetMouseButton(button);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(DebugInput), "GetMouseButtonDown")]
|
|
|
|
|
private static bool GetMouseButtonDown(ref bool __result, int button)
|
|
|
|
|
{
|
|
|
|
|
__result = UnityEngine.Input.GetMouseButtonDown(button);
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-08-04 12:27:09 +08:00
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(NetHttpClient), "CheckServerHash")]
|
|
|
|
|
private static bool CheckServerHash(ref bool __result)
|
|
|
|
|
{
|
|
|
|
|
__result = true;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-08-05 20:37:07 +08:00
|
|
|
|
|
|
|
|
|
[HarmonyPrefix]
|
|
|
|
|
[HarmonyPatch(typeof(GameManager), "CalcSpecialNum")]
|
|
|
|
|
private static bool CalcSpecialNum(ref int __result)
|
|
|
|
|
{
|
|
|
|
|
__result = 1024;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-07-09 18:11:06 +08:00
|
|
|
|
}
|