Show current cheat data

This commit is contained in:
D1GQ committed 2024-11-20 15:27:49 -06:00
1 parent cb5dfad8fb
commit 4f48b14d44
5 files changed
+19 -19

No files matched your search

+3 -8
View File
@@ -1,5 +1,6 @@
using BetterAmongUs.Helpers;
using BetterAmongUs.Managers;
using BetterAmongUs.Modules;
namespace BetterAmongUs.Commands;
@@ -15,13 +16,7 @@ public class RemovePlayerCommand : BaseCommand
new StringArgument(this),
});
identifierArgument.suggestion = "{Identifier}";
identifierArgument.GetArgSuggestions = () =>
{
return Main.AllPlayerControls
.Select(pc => pc.Data.FriendCode)
.Concat(Main.AllPlayerControls.Select(pc => pc.GetHashPuid()))
.ToArray();
};
identifierArgument.GetArgSuggestions = AntiCheat.GatherAllData;
}
private readonly Lazy<BaseArgument[]> _arguments;
public override BaseArgument[]? Arguments => _arguments.Value;
@@ -35,7 +30,7 @@ public class RemovePlayerCommand : BaseCommand
}
else
{
Utils.AddChatPrivate($"{identifierArgument.Arg}\nCould not find player data from identifier");
Utils.AddChatPrivate($"{identifierArgument.Arg} Could not find player data from identifier");
}
}
}
+1 -1
View File
@@ -197,7 +197,7 @@ static class PlayerControlHelper
// Get true position
public static Vector2 GetCustomPosition(this PlayerControl player) => new(player.transform.position.x, player.transform.position.y);
// Check if player is a dev
public static bool IsDev(this PlayerControl player) => player != null && Main.DevUser.Contains($"{Utils.GetHashPuid(player)}+{player.Data.FriendCode}");
public static bool IsDev(this PlayerControl player) => player.BetterData().MyUserData.IsDev();
// Check if player is alive
public static bool IsAlive(this PlayerControl player) => player?.Data != null && !player.Data.IsDead;
// Check if player is in a vent
+14
View File
@@ -16,6 +16,20 @@ class AntiCheat
public static Dictionary<string, string> KNData = []; // HashPuid, FriendCode
private static bool IsEnabled = true;
public static string[] GatherAllData()
{
return PlayerData.Keys
.Concat(PlayerData.Values)
.Concat(SickoData.Values)
.Concat(AUMData.Values)
.Concat(KNData.Values)
.Concat(SickoData.Keys)
.Concat(AUMData.Keys)
.Concat(KNData.Keys)
.ToHashSet()
.ToArray();
}
public static void Update()
{
if (GameState.IsHost && GameState.IsInGame)
+1 -1
View File
@@ -6,7 +6,7 @@ namespace BetterAmongUs.Modules;
public static class GameState
{
/**********Check Game Status***********/
public static bool IsDev => EOSManager.Instance?.userId != null && Main.DevUser.Contains($"{Utils.GetHashStr(EOSManager.Instance.userId.ToString())}+{EOSManager.Instance.friendCode}");
public static bool IsDev => Main.MyData.IsDev();
public static bool InGame => Main.AllPlayerControls.Any();
public static bool IsNormalGame => GameOptionsManager.Instance.CurrentGameOptions.GameMode is GameModes.Normal or GameModes.NormalFools;
public static bool IsHideNSeek => GameOptionsManager.Instance != null && GameOptionsManager.Instance.CurrentGameOptions.GameMode is GameModes.HideNSeek or GameModes.SeekFools;
-9
View File
@@ -109,11 +109,6 @@ public class Main : BasePlugin
"2024.6.18",
];
public static string[] DevUser =
[
"J4sxGDREO5bjLvzvMkv059g+7wpNg7PbyWa9vLVWQkw=",
];
public static PlayerControl[] AllPlayerControls => PlayerControl.AllPlayerControls.ToArray().Where(pc => pc != null).ToArray();
public static PlayerControl[] AllAlivePlayerControls => AllPlayerControls.ToArray().Where(pc => pc.IsAlive()).ToArray();
public static DeadBody[] AllDeadBodys => UnityEngine.Object.FindObjectsOfType<DeadBody>().ToArray();
@@ -186,10 +181,6 @@ public class Main : BasePlugin
File.WriteAllText(Path.Combine(BetterDataManager.filePathFolder, "better-log.txt"), "");
BetterAmongUs.Logger.Log("Better Among Us successfully loaded!");
// Set up debug menu
for (int i = 0; i < DevUser.Length; i++)
DevUser[i] = Encryptor.Decrypt(DevUser[i]);
#if DEBUG
ClassInjector.RegisterTypeInIl2Cpp<DebugMenu>();
ClassInjector.RegisterTypeInIl2Cpp<Resources.Coroutines.Component>();