fix errors

This commit is contained in:
D1GQ committed 2024-08-14 00:39:35 -05:00
1 parent 11f7dfeae0
commit be682e5b22
2 files changed
+35 -27

No files matched your search

+25 -22
View File
@@ -60,33 +60,36 @@ class AntiCheat
[HarmonyPostfix]
public static void Deserialize_Postfix(PlatformSpecificData __instance)
{
_ = new LateTask(() =>
{
var player = Main.AllPlayerControls.FirstOrDefault(pc => pc.GetClient().PlatformData == __instance);
if (player != null)
{
if (__instance.Platform is Platforms.StandaloneWin10 or Platforms.Xbox)
if (GameStates.IsLobby)
{
_ = new LateTask(() =>
{
if (__instance.XboxPlatformId.ToString().Length is < 10 or > 16)
var player = Main.AllPlayerControls.FirstOrDefault(pc => pc.GetClient().PlatformData == __instance);
if (player != null)
{
player.ReportPlayer(ReportReasons.Cheating_Hacking);
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
Logger.LogCheat($"{player.Data.PlayerName} Platform Spoofer: {__instance.XboxPlatformId}");
if (__instance.Platform is Platforms.StandaloneWin10 or Platforms.Xbox)
{
if (__instance.XboxPlatformId.ToString().Length is < 10 or > 16)
{
player.ReportPlayer(ReportReasons.Cheating_Hacking);
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
Logger.LogCheat($"{player.Data.PlayerName} Platform Spoofer: {__instance.XboxPlatformId}");
}
}
}
if (__instance.Platform is Platforms.Playstation)
{
if (__instance.PsnPlatformId.ToString().Length is < 14 or > 20)
{
player.ReportPlayer(ReportReasons.Cheating_Hacking);
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
Logger.LogCheat($"{player.Data.PlayerName} Platform Spoofer: {__instance.PsnPlatformId}");
if (__instance.Platform is Platforms.Playstation)
{
if (__instance.PsnPlatformId.ToString().Length is < 14 or > 20)
{
player.ReportPlayer(ReportReasons.Cheating_Hacking);
BetterNotificationManager.NotifyCheat(player, $"Platform Spoofer", newText: "Has been detected with a cheat");
Logger.LogCheat($"{player.Data.PlayerName} Platform Spoofer: {__instance.PsnPlatformId}");
}
}
}
}
}
}, 3.5f, shoudLog: false);
}, 3.5f, shoudLog: false);
}
}
}
+10 -5
View File
@@ -82,13 +82,18 @@ public class ClientPatch
[HarmonyPrefix]
public static bool SetColorBlindColor_Prefix(CosmeticsLayer __instance, [HarmonyArgument(0)] int color)
{
if (__instance.colorBlindText == null || !__instance.showColorBlindText)
try
{
return false;
if (__instance.colorBlindText == null || !__instance.showColorBlindText)
{
return false;
}
__instance.colorBlindText.text = __instance.GetColorBlindText();
__instance.colorBlindText.color = Palette.PlayerColors[color];
__instance.colorBlindText.transform.localPosition = new Vector3(0f, -1.5f, 0.4999f);
}
__instance.colorBlindText.text = __instance.GetColorBlindText();
__instance.colorBlindText.color = Palette.PlayerColors[color];
__instance.colorBlindText.transform.localPosition = new Vector3(0f, -1.5f, 0.4999f);
catch { }
return false;
}
}