[+] Make ForceAsServer and ForceFreePlay individual components
Build AquaMai / build (SDEZ141) (push) Has been cancelled Details
Build AquaMai / build (SDGA145) (push) Has been cancelled Details

pull/52/head
Clansty 2024-08-22 20:17:26 +08:00
parent ffe3843747
commit d58fe84439
No known key found for this signature in database
GPG Key ID: 3A6BE8BAF2EDE134
7 changed files with 47 additions and 26 deletions

View File

@ -284,6 +284,8 @@
<Compile Include="Fix\BasicFix.cs" />
<Compile Include="Fix\DisableReboot.cs" />
<Compile Include="Fix\FixCharaCrash.cs" />
<Compile Include="Fix\ForceAsServer.cs" />
<Compile Include="Fix\ForceFreePlay.cs" />
<Compile Include="Fix\RemoveEncryption.cs" />
<Compile Include="Fix\SkipVersionCheck.cs" />
<Compile Include="Performance\ImproveLoadSpeed.cs" />

View File

@ -55,3 +55,5 @@ ImproveLoadSpeed=true
# Allow login with higher data version
SkipVersionCheck=true
RemoveEncryption=true
ForceAsServer=true
ForceFreePlay=true

View File

@ -70,3 +70,6 @@ SkipVersionCheck=true
# 开了这个选项之后就不会加密连接了,同时也会移除不同版本的客户端可能会对 API 接口加的后缀
# 正常情况下,请保持这个选项开启
RemoveEncryption=true
# 如果要配置店内招募的话,应该要把这个关闭
ForceAsServer=true
ForceFreePlay=true

View File

@ -46,6 +46,8 @@ namespace AquaMai
{
public bool SkipVersionCheck { get; set; }
public bool RemoveEncryption { get; set; }
public bool ForceAsServer { get; set; } = true;
public bool ForceFreePlay { get; set; } = true;
}
}
}

View File

@ -1,5 +1,4 @@
using AMDaemon;
using AMDaemon.Allnet;
using AMDaemon.Allnet;
using HarmonyLib;
using Manager;
using Manager.Operation;
@ -17,22 +16,6 @@ public class BasicFix
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(LanInstall), "IsServer", MethodType.Getter)]
private static bool PreIsServer(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(AMDaemon.Network), "IsLanAvailable", MethodType.Getter)]
private static bool PreIsLanAvailable(ref bool __result)
{
__result = false;
return false;
}
[HarmonyPostfix]
[HarmonyPatch(typeof(OperationManager), "CheckAuth_Proc")]
private static void PostCheckAuthProc(ref OperationData ____operationData)
@ -43,14 +26,6 @@ public class BasicFix
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(Manager.Credit), "IsFreePlay")]
private static bool PreIsFreePlay(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(DebugInput), "GetKey")]
private static bool GetKey(ref bool __result, KeyCode name)

View File

@ -0,0 +1,23 @@
using AMDaemon;
using HarmonyLib;
namespace AquaMai.Fix;
public class ForceAsServer
{
[HarmonyPrefix]
[HarmonyPatch(typeof(LanInstall), "IsServer", MethodType.Getter)]
private static bool PreIsServer(ref bool __result)
{
__result = true;
return false;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(Network), "IsLanAvailable", MethodType.Getter)]
private static bool PreIsLanAvailable(ref bool __result)
{
__result = false;
return false;
}
}

View File

@ -0,0 +1,14 @@
using HarmonyLib;
namespace AquaMai.Fix;
public class ForceFreePlay
{
[HarmonyPrefix]
[HarmonyPatch(typeof(Manager.Credit), "IsFreePlay")]
private static bool PreIsFreePlay(ref bool __result)
{
__result = true;
return false;
}
}