Skip to content

Commit

Permalink
[F] 段位认定 crash
Browse files Browse the repository at this point in the history
close #14
  • Loading branch information
clansty committed Jan 23, 2025
1 parent a43999b commit 162e95b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 24 deletions.
32 changes: 13 additions & 19 deletions AquaMai.Mods/Fix/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ namespace AquaMai.Mods.Fix;
[ConfigSection(exampleHidden: true, defaultOn: true)]
public class Common
{
[ConfigEntry]
private readonly static bool preventIniFileClear = true;
[ConfigEntry] private readonly static bool preventIniFileClear = true;

[EnableIf(nameof(preventIniFileClear))]
[HarmonyPrefix]
Expand All @@ -28,8 +27,7 @@ private static bool PreIniFileClear()
return false;
}

[ConfigEntry]
private readonly static bool fixDebugInput = true;
[ConfigEntry] private readonly static bool fixDebugInput = true;

[EnableIf(nameof(fixDebugInput))]
[HarmonyPrefix]
Expand Down Expand Up @@ -67,8 +65,7 @@ private static bool GetMouseButtonDown(ref bool __result, int button)
return false;
}

[ConfigEntry]
private readonly static bool bypassCakeHashCheck = true;
[ConfigEntry] private readonly static bool bypassCakeHashCheck = true;

[EnableIf(nameof(bypassCakeHashCheck))]
[HarmonyPostfix]
Expand All @@ -83,8 +80,7 @@ private static void OnNetHttpClientConstructor(NetHttpClient __instance)
}
}

[ConfigEntry]
private readonly static bool restoreCertificateValidation = true;
[ConfigEntry] private readonly static bool restoreCertificateValidation = true;

[EnableIf(nameof(restoreCertificateValidation))]
[HarmonyPostfix]
Expand All @@ -95,8 +91,7 @@ private static void OnNetHttpClientCreate()
ServicePointManager.ServerCertificateValidationCallback = null;
}

[ConfigEntry]
private readonly static bool forceNonTarget = true;
[ConfigEntry] private readonly static bool forceNonTarget = true;

[EnableIf(nameof(forceNonTarget))]
[HarmonyPrefix]
Expand All @@ -108,8 +103,7 @@ private static bool PreIsTarget(ref bool __result)
return false;
}

[ConfigEntry]
private readonly static bool forceIgnoreError = true;
[ConfigEntry] private readonly static bool forceIgnoreError = true;

[EnableIf(nameof(forceIgnoreError))]
[HarmonyPrefix]
Expand All @@ -120,8 +114,7 @@ private static bool PreIsIgnoreError(ref bool __result)
return false;
}

[ConfigEntry]
private readonly static bool bypassSpecialNumCheck = true;
[ConfigEntry] private readonly static bool bypassSpecialNumCheck = true;

public static void OnAfterPatch(HarmonyLib.Harmony h)
{
Expand All @@ -143,15 +136,15 @@ private static bool CalcSpecialNum(ref int __result)
}
}

[ConfigEntry]
private readonly static bool enableAllEvent = true;
[ConfigEntry] private readonly static bool enableAllEvent = true;

[EnableIf(nameof(enableAllEvent))]
[HarmonyPrefix]
[HarmonyPatch(typeof(EventManager), "IsOpenEvent")]
private static bool EnableAllEvent(ref bool __result)
private static bool EnableAllEvent(ref bool __result, int eventId)
{
__result = true;
if (eventId > 0)
__result = true;
return false;
}

Expand All @@ -171,7 +164,8 @@ inst.operand is FieldInfo field &&
// Failed to find the target instruction, abort.
return instList;
}

// Remove all instructions before the target instruction.
return instList.Skip(onceDispIndex);
}
}
}
5 changes: 0 additions & 5 deletions AquaMai.Mods/GameSystem/HidInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ private static void HidInputThread()
if (report2P.Status == HidDeviceData.ReadStatus.Success)
inputBuf2P = report2P.Data;
}

#if DEBUG
MelonLogger.Msg("[HidInput] 1P: " + string.Join(",", inputBuf1P));
#endif
// Thread.Sleep(10); // Sleep for a short time to avoid CPU overload
}
}

Expand Down

0 comments on commit 162e95b

Please sign in to comment.