[+] Basic fix

pull/47/head
Clansty 2024-07-26 23:24:42 +08:00
parent 64f3a2db58
commit 0833cd8a9b
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
4 changed files with 36 additions and 13 deletions

1
AquaMai/.gitignore vendored
View File

@ -373,4 +373,5 @@ MigrationBackup/
Output
.idea
Libs/Assembly-CSharp.dll
Libs/AMDaemon.NET.dll
packages

View File

@ -275,6 +275,7 @@
<Compile Include="Cheat\UnlockUtage.cs" />
<Compile Include="Config.cs" />
<Compile Include="Fix\BasicFix.cs" />
<Compile Include="Fix\DisableReboot.cs" />
<Compile Include="Fix\FixCharaCrash.cs" />
<Compile Include="Fix\RemoveEncryption.cs" />
<Compile Include="Fix\SkipVersionCheck.cs" />
@ -283,7 +284,6 @@
<Compile Include="Main.cs" />
<Compile Include="UX\CustomVersionString.cs" />
<Compile Include="UX\DemoMaster.cs" />
<Compile Include="UX\DisableReboot.cs" />
<Compile Include="UX\ExtendTimer.cs" />
<Compile Include="UX\ImmediateSave.cs" />
<Compile Include="UX\LoadJacketPng.cs" />

View File

@ -3,15 +3,13 @@ using AMDaemon.Allnet;
using HarmonyLib;
using Manager;
using Manager.Operation;
using IniFile = MAI2System.IniFile;
using Network = AMDaemon.Network;
namespace AquaMai.Fix;
public class BasicFix
{
[HarmonyPrefix]
[HarmonyPatch(typeof(IniFile), "clear")]
[HarmonyPatch(typeof(MAI2System.IniFile), "clear")]
private static bool PreIniFileClear()
{
return false;
@ -26,7 +24,7 @@ public class BasicFix
}
[HarmonyPrefix]
[HarmonyPatch(typeof(Network), "IsLanAvailable", MethodType.Getter)]
[HarmonyPatch(typeof(AMDaemon.Network), "IsLanAvailable", MethodType.Getter)]
private static bool PreIsLanAvailable(ref bool __result)
{
__result = false;
@ -42,4 +40,12 @@ public class BasicFix
____operationData.ServerUri = Auth.GameServerUri;
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(Manager.Credit), "IsFreePlay")]
private static bool PreIsFreePlay(ref bool __result)
{
__result = true;
return false;
}
}

View File

@ -1,7 +1,7 @@
using HarmonyLib;
using Manager.Operation;
namespace AquaMai.UX
namespace AquaMai.Fix
{
public class DisableReboot
{
@ -13,7 +13,7 @@ namespace AquaMai.UX
__result = false;
return false;
}
// IsUnderServerMaintenance
[HarmonyPrefix]
[HarmonyPatch(typeof(MaintenanceTimer), "IsUnderServerMaintenance")]
@ -22,7 +22,7 @@ namespace AquaMai.UX
__result = false;
return false;
}
// RemainingMinutes
// Original: private int RemainingMinutes => (this._secServerMaintenance + 59) / 60;
[HarmonyPrefix]
@ -32,7 +32,7 @@ namespace AquaMai.UX
__result = 600;
return false;
}
// GetAutoRebootSec
[HarmonyPrefix]
[HarmonyPatch(typeof(MaintenanceTimer), "GetAutoRebootSec")]
@ -41,7 +41,7 @@ namespace AquaMai.UX
__result = 60 * 60 * 10;
return false;
}
// GetServerMaintenanceSec
[HarmonyPrefix]
[HarmonyPatch(typeof(MaintenanceTimer), "GetServerMaintenanceSec")]
@ -50,7 +50,7 @@ namespace AquaMai.UX
__result = 60 * 60 * 10;
return false;
}
// Execute
[HarmonyPrefix]
[HarmonyPatch(typeof(MaintenanceTimer), "Execute")]
@ -58,7 +58,7 @@ namespace AquaMai.UX
{
return false;
}
// UpdateTimes
[HarmonyPrefix]
[HarmonyPatch(typeof(MaintenanceTimer), "UpdateTimes")]
@ -66,5 +66,21 @@ namespace AquaMai.UX
{
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(ClosingTimer), "IsShowRemainingMinutes")]
public static bool IsShowRemainingMinutes(ref bool __result)
{
__result = false;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(ClosingTimer), "IsClosed")]
public static bool IsClosed(ref bool __result)
{
__result = false;
return false;
}
}
}
}