diff --git a/CCK.Debugger/Components/MenuHandlers/AvatarMenuHandler.cs b/CCK.Debugger/Components/MenuHandlers/AvatarMenuHandler.cs index d44f01a..759b89c 100644 --- a/CCK.Debugger/Components/MenuHandlers/AvatarMenuHandler.cs +++ b/CCK.Debugger/Components/MenuHandlers/AvatarMenuHandler.cs @@ -15,8 +15,7 @@ static AvatarMenuHandler() { // Todo: Allow to inspect other people's avatars if they give permission // Todo: Waiting for bios - List players = new(); - //List players = CVRPlayerManager.Instance.NetworkPlayers; + var players = CCKDebugger.TestMode ? CVRPlayerManager.Instance.NetworkPlayers : new List(); bool IsValid(CVRPlayerEntity entity) { if (entity?.PuppetMaster == null) return false; diff --git a/CCK.Debugger/Main.cs b/CCK.Debugger/Main.cs index 3408ed3..e537e0d 100644 --- a/CCK.Debugger/Main.cs +++ b/CCK.Debugger/Main.cs @@ -13,8 +13,27 @@ namespace CCK.Debugger; public class CCKDebugger : MelonMod { + internal static bool TestMode; + private const string _assetPath = "Assets/Prefabs/CCKDebuggerMenu.prefab"; + public override void OnApplicationStart() { + + // Check if it is in debug mode (to test functionalities that are waiting for bios to be enabled) + // Keeping it hard-ish to enable so people don't abuse it + foreach (var commandLineArg in Environment.GetCommandLineArgs()) { + if (!commandLineArg.StartsWith("--cck-debugger-test=")) continue; + var input = commandLineArg.Split(new[] { "=" }, StringSplitOptions.None)[1]; + using System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create(); + var inputBytes = System.Text.Encoding.ASCII.GetBytes(input); + var hashBytes = md5.ComputeHash(inputBytes); + var sb = new System.Text.StringBuilder(); + foreach (var t in hashBytes) sb.Append(t.ToString("X2")); + TestMode = sb.ToString().Equals("738A9A4AD5E2F8AB10E702D44C189FA8"); + if (TestMode) MelonLogger.Msg("Test Mode is ENABLED!"); + } + } + [HarmonyPatch] private class HarmonyPatches {