Exemple #1
0
        private void OnApplicationStart()
        {
            String lp    = "";
            bool   first = true;

            foreach (var lp2 in Environment.GetCommandLineArgs())
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    lp += " " + lp2;
                }
            }
            VRCModLogger.Log("Launch parameters:" + lp);

            ModPrefs.RegisterCategory("vrctools", "VRCTools");
            ModPrefs.RegisterPrefBool("vrctools", "remoteauthcheckasked", false, null, true);
            ModPrefs.RegisterPrefBool("vrctools", "remoteauthcheck", false, "Allow VRCModNetwork Auth");
            ModPrefs.RegisterPrefBool("vrctools", "avatarfavdownloadasked", false, null, true);
            ModPrefs.RegisterPrefBool("vrctools", "avatarfavdownload", false, "Enable AvatarFav Updater");

            ModPrefs.RegisterPrefBool("vrctools", "enablediscordrichpresence", true, "Enable Discord RichPresence");
            ModPrefs.RegisterPrefBool("vrctools", "enablestealerdetector", true, "Enable Stealer Detector");
            ModPrefs.RegisterPrefBool("vrctools", "enableramexploitpatch", true, "Enable RAMExploit Patch");
            ModPrefs.RegisterPrefBool("vrctools", "enabledebugconsole", false, "Enable Debug Console");
        }
Exemple #2
0
        private void OnApplicationStart()
        {
            string lp    = "";
            bool   first = true;

            foreach (var lp2 in Environment.GetCommandLineArgs())
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    lp += " " + lp2;
                }
            }
            VRCModLogger.Log("[VRCTools] Launch parameters:" + lp);

            ModPrefs.RegisterCategory("vrctools", "VRCTools");
            ModPrefs.RegisterPrefBool("vrctools", "avatarfavdownloadasked", false, null, true);
            ModPrefs.RegisterPrefBool("vrctools", "avatarfavdownload", false, "Enable AvatarFav Updater");

            ModPrefs.RegisterPrefBool("vrctools", "enablediscordrichpresence", true, "Enable Discord RichPresence");
            ModPrefs.RegisterPrefBool("vrctools", "enabledebugconsole", false, "Enable Debug Console");

            ModPrefs.RegisterPrefBool("vrctools", "allowdiscordjoinrequests", true, "Allow Discord join requests");
            ModPrefs.RegisterPrefBool("vrctools", "hidenameondiscord", true, "Hide your name on Discord");
        }
Exemple #3
0
        private void OnApplicationStart()
        {
            if (Application.platform == RuntimePlatform.WindowsPlayer)
            {
                string lp    = "";
                bool   first = true;
                foreach (var lp2 in Environment.GetCommandLineArgs())
                {
                    if (first)
                    {
                        first = false;
                    }
                    else
                    {
                        lp += " " + lp2;
                    }
                }
                VRCModLogger.Log("[VRCTools] Launch parameters:" + lp);
            }

            ModPrefs.RegisterCategory("vrctools", "VRCTools");
            ModPrefs.RegisterPrefBool("vrctools", "enabledebugconsole", false, "Enable Debug Console");

            Type vrcMenuUtilsAPI = null;

            usingVRCMenuUtils = AppDomain.CurrentDomain.GetAssemblies().Any(a =>
            {
                vrcMenuUtilsAPI = a.GetType("VRCMenuUtils.VRCMenuUtilsAPI");
                return(vrcMenuUtilsAPI != null);
            });

            VRCModLogger.Log("[VRCTools] Using VRCMenuUtils: " + usingVRCMenuUtils);

            if (usingVRCMenuUtils)
            {
                vrcMenuUtilsAPI.GetMethod("RunBeforeFlowManager").Invoke(null, new object[] { VRCToolsSetup() });
            }

            if (HarmonyLoaded())
            {
                VRCModLogger.Log("[VRCTools] Patching analytics");
                HarmonyInstance harmony = HarmonyInstance.Create("vrctools.analyticspatch");
                harmony.Patch(
                    typeof(AppDomain).GetMethod("GetAssemblies", BindingFlags.Public | BindingFlags.Instance),
                    postfix: new HarmonyMethod(typeof(VRCTools).GetMethod("GetAssembliesPostfix", BindingFlags.Static | BindingFlags.NonPublic)));
                harmony.Patch(
                    typeof(Analytics).GetMethods(BindingFlags.NonPublic | BindingFlags.Static).FirstOrDefault(m => m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType == typeof(string) && (string)m.Parse().First(i => i.OpCode == OpCodes.Ldstr).Argument == "-"),
                    prefix: new HarmonyMethod(typeof(VRCTools).GetMethod("GetMD5FromFilePrefix", BindingFlags.Static | BindingFlags.NonPublic)));
                VRCModLogger.Log("[VRCTools] Analytics patched.");
            }
        }
Exemple #4
0
        private void OnApplicationStart()
        {
            if (!ApiCredentials.Load())
            {
                VRCModLogger.Log("No credential founds");
            }
            else
            {
                VRCModLogger.Log("Credentials:\n - Token: " + ApiCredentials.GetAuthToken() + "\n - Provider: " + ApiCredentials.GetAuthTokenProvider() + "\n - UserId: " + ApiCredentials.GetAuthTokenProviderUserId());
            }


            String lp    = "";
            bool   first = true;

            foreach (var lp2 in Environment.GetCommandLineArgs())
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    lp += " " + lp2;
                }
            }
            VRCModLogger.Log("Launch parameters:" + lp);

            ModPrefs.RegisterCategory("vrctools", "VRCTools");
            ModPrefs.RegisterPrefBool("vrctools", "remoteauthcheckasked", false, null, true);
            ModPrefs.RegisterPrefBool("vrctools", "remoteauthcheck", false, "Allow VRCModNetwork Auth");
            ModPrefs.RegisterPrefBool("vrctools", "avatarfavdownloadasked", false, null, true);
            ModPrefs.RegisterPrefBool("vrctools", "avatarfavdownload", false, "Enable AvatarFav Updater");

            ModPrefs.RegisterPrefBool("vrctools", "enablediscordrichpresence", true, "Enable Discord RichPresence");
            ModPrefs.RegisterPrefBool("vrctools", "enabledebugconsole", false, "Enable Debug Console");

            ModPrefs.RegisterPrefBool("vrctools", "hasvrcmnwtoken", false, null, true);

            ModPrefs.RegisterPrefBool("vrctools", "allowdiscordjoinrequests", true, "Allow Discord join requests");

            //Reset the credentials to ask login again if this is the first time the user login to the VRCMNW
            if (!ModPrefs.GetBool("vrctools", "hasvrcmnwtoken"))
            {
                ApiCredentials.Clear();
            }
        }
Exemple #5
0
        private void OnApplicationStart()
        {
            if (Application.platform == RuntimePlatform.WindowsPlayer)
            {
                string lp    = "";
                bool   first = true;
                foreach (var lp2 in Environment.GetCommandLineArgs())
                {
                    if (first)
                    {
                        first = false;
                    }
                    else
                    {
                        lp += " " + lp2;
                    }
                }
                VRCModLogger.Log("[VRCTools] Launch parameters:" + lp);
            }

            ModPrefs.RegisterCategory("vrctools", "VRCTools");
            ModPrefs.RegisterPrefBool("vrctools", "enabledebugconsole", false, "Enable Debug Console");

            Type vrcMenuUtilsAPI = null;

            usingVRCMenuUtils = AppDomain.CurrentDomain.GetAssemblies().Any(a =>
            {
                vrcMenuUtilsAPI = a.GetType("VRCMenuUtils.VRCMenuUtilsAPI");
                return(vrcMenuUtilsAPI != null);
            });

            VRCModLogger.Log("[VRCTools] Using VRCMenuUtils: " + usingVRCMenuUtils);

            /*if (!usingVRCMenuUtils)
             * {
             *  SceneManager.sceneLoaded += (scene, mode) =>
             *  {
             *      if(scene.buildIndex == 0 && !Initialised)
             *          ModManager.StartCoroutine(VRCToolsSetup());
             *  };
             * }*/
            if (usingVRCMenuUtils)
            {
                vrcMenuUtilsAPI.GetMethod("RunBeforeFlowManager").Invoke(null, new object[] { VRCToolsSetup() });
            }
        }
Exemple #6
0
        void OnApplicationStart()
        {
            ExtendedLogger.Log("Loading VRCExtended...");

            // Setup config
            ModPrefs.RegisterCategory("vrcextended", "VRCExtended");

            // VRCExtended
            ModPrefs.RegisterPrefBool("vrcextended", "useDTFormat", false, "Use American format");
            ModPrefs.RegisterPrefBool("vrcextended", "fpsManagement", false, "FPS management");
            ModPrefs.RegisterPrefBool("vrcextended", "unlimitedFPS", false, "Unlimited FPS");

            // Exploits
            ModPrefs.RegisterPrefBool("vrcextended", "askUsePortal", true, "Ask to use portal");
            ModPrefs.RegisterPrefBool("vrcextended", "disablePortal", false, "Disable portals");
            ModPrefs.RegisterPrefBool("vrcextended", "antiCrasher", false, "Prevent crashers");
#if DEBUG
            ModPrefs.RegisterPrefBool("vrcextended", "avatarLimiter", false, "Avatar limiter"); // TODO
#else
            ModPrefs.RegisterPrefBool("vrcextended", "avatarLimiter", false, "Avatar limiter", true);
#endif

            // Avatar
            ModPrefs.RegisterPrefBool("vrcextended", "localColliders", false, "Local colliders");
            ModPrefs.RegisterPrefBool("vrcextended", "multiLocalColliders", false, "Others have local colliders");
            ModPrefs.RegisterPrefBool("vrcextended", "selfLocalColliders", true, "Others can touch you");
            ModPrefs.RegisterPrefBool("vrcextended", "targetHandColliders", true, "Target only hand colliders");
            ModPrefs.RegisterPrefBool("vrcextended", "fakeColliders", false, "Add fake colliders to self");
            ModPrefs.RegisterPrefBool("vrcextended", "fakeCollidersOthers", false, "Add fake colliders to others");
            ModPrefs.RegisterPrefBool("vrcextended", "ignoreInsideColliders", true, "Ignore pull colliders");
#if DEBUG
            ModPrefs.RegisterPrefBool("vrcextended", "smartColliders", false, "Use smart colliders"); // TODO
#else
            ModPrefs.RegisterPrefBool("vrcextended", "smartColliders", false, "Use smart colliders", true);
#endif

            // Players
#if DEBUG
            ModPrefs.RegisterPrefBool("vrcextended", "userSpecificVolume", false, "User specific volumes");
#else
            ModPrefs.RegisterPrefBool("vrcextended", "userSpecificVolume", false, "User specific volumes", true); // Can't get this shit to work
#endif

            // Grab the previous data
            p_anticrash             = ModPrefs.GetBool("vrcextended", "antiCrasher");
            p_localcolliders        = ModPrefs.GetBool("vrcextended", "localColliders");
            p_multilocalcolliders   = ModPrefs.GetBool("vrcextended", "multiLocalColliders");
            p_selflocalcolliders    = ModPrefs.GetBool("vrcextended", "selfLocalColliders");
            p_targetHandColliders   = ModPrefs.GetBool("vrcextended", "targetHandColliders");
            p_fakeColliders         = ModPrefs.GetBool("vrcextended", "fakeColliders");
            p_fakeCollidersOthers   = ModPrefs.GetBool("vrcextended", "fakeCollidersOthers");
            p_smartColliders        = ModPrefs.GetBool("vrcextended", "smartColliders");
            p_ignoreInsideColliders = ModPrefs.GetBool("vrcextended", "ignoreInsideColliders");
            p_unlimitedFPS          = ModPrefs.GetBool("vrcextended", "unlimitedFPS");

            // Add scripts
            ScriptObject = new GameObject();
            ScriptObject.AddComponent <PauseDetection>();
            GameObject.DontDestroyOnLoad(ScriptObject);

            // Get AntiCrasher config
            if (File.Exists("antiCrash.json"))
            {
                try
                {
                    if (JsonConvert.DeserializeObject <AntiCrasherConfig>(File.ReadAllText("antiCrash.json")).CheckBackwardsCompatibility())
                    {
                        File.WriteAllText("antiCrash.json", JsonConvert.SerializeObject(AntiCrasherConfig.Instance, Formatting.Indented));
                        ExtendedLogger.Log("Saved AntiCrasher config!");
                    }
                    ExtendedLogger.Log("Loaded AntiCrasher config!");
                }
                catch (Exception ex)
                {
                    ExtendedLogger.LogError("Failed to read/parse AntiCrasher config! Using default values...", ex);

                    AntiCrasherConfig.CreateDefault();
                }
            }
            else
            {
                AntiCrasherConfig.CreateDefault();
                ExtendedLogger.Log("Loaded default AntiCrasher config!");
            }
            if (ModManager.Mods.Any(a => a.Name == "QuitFix" && a.Author == "Herp Derpinstine") && !File.Exists("antiCrash.json"))
            {
                File.WriteAllText("antiCrash.json", JsonConvert.SerializeObject(AntiCrasherConfig.Instance, Formatting.Indented));
                ExtendedLogger.Log("Saved AntiCrasher config!");
            }

            // Get VolumeControl config
            VolumeControl.Setup();

            // Run patches
            Patch_PortalInternal.Setup();
            Patch_PageUserInfo.Setup();

            // Run coroutines
            ModManager.StartCoroutine(WaitForUIManager());
            if (ModPrefs.GetBool("vrcextended", "antiCrasher") && AntiCrasherConfig.Instance.UseOnlineBlacklist == true)
            {
                ModManager.StartCoroutine(LoadShaderBlacklist());
            }

            ExtendedLogger.Log("Loaded VRCExtended!");
        }