예제 #1
0
        private IEnumerator VRCToolsSetup()
        {
            yield return(VRCUiManagerUtils.WaitForUiManagerInit());

            yield return(DependenciesDownloader.CheckDownloadFiles());

            yield return(VRCModLoaderUpdater.CheckVRCModLoaderHash());

            if (ModPrefs.GetBool("vrctools", "enablediscordrichpresence"))
            {
                DiscordManager.Init();
            }
            yield return(CheckForPermissions());

            if (ModPrefs.GetBool("vrctools", "enableramexploitpatch"))
            {
                RamExploitPatcher.Patch();
            }
            VRCModNetworkStatus.Setup();
            ModConfigPage.Setup();
            ModdedUsersManager.Init();
            if (ModPrefs.GetBool("vrctools", "enablestealerdetector"))
            {
                AvatarStealerChecker.Setup();
            }


            VRCFlowManagerUtils.EnableVRCFlowManager();

            initialising = false;
            Initialised  = true;
        }
예제 #2
0
파일: VRCTools.cs 프로젝트: jb1361/VRCTools
        private IEnumerator VRCToolsSetup()
        {
            VRCModLogger.Log("[VRCTools] Waiting for UI Manager...");
            yield return(VRCUiManagerUtils.WaitForUiManagerInit());

            VRCModLogger.Log("[VRCTools] UIManager initialised ! Resuming setup");

            VRCModLogger.Log("[VRCTools] CheckDownloadFiles");
            yield return(DependenciesDownloader.CheckDownloadFiles());

            VRCModLogger.Log("[VRCTools] CheckVRCModLoaderHash");
            yield return(VRCModLoaderUpdater.CheckVRCModLoaderHash());

            if (ModPrefs.GetBool("vrctools", "enablediscordrichpresence"))
            {
                VRCModLogger.Log("[VRCTools] DiscordManager Init");
                DiscordManager.Init();
            }
            VRCModLogger.Log("[VRCTools] CheckForPermissions");
            yield return(CheckForPermissions());

            VRCModLogger.Log("[VRCTools] VRCModNetworkStatus Setup");
            VRCModNetworkStatus.Setup();
            VRCModLogger.Log("[VRCTools] ModConfigPage Setup");
            ModConfigPage.Setup();
            VRCModLogger.Log("[VRCTools] ModdedUsersManager Init");
            ModdedUsersManager.Init();

            VRCModLogger.Log("[VRCTools] Init done !");

            VRCFlowManagerUtils.EnableVRCFlowManager();

            initialising = false;
            Initialised  = true;
        }
예제 #3
0
        private IEnumerator VRCToolsSetup()
        {
            initialising = true;
            VRCModLogger.Log("[VRCTools] Initialising VRCTools");
            try
            {
                OculusUtils.ApplyPatches();
            }
            catch (Exception e)
            {
                VRCModLogger.Log("[VRCTools] Error while applying Oculus patches: " + e);
            }
            yield return(VRCUiManagerUtils.WaitForUiManagerInit());

            VRCModLogger.Log("[VRCTools] Overwriting login button event");
            VRCUiPageAuthentication[] authpages = Resources.FindObjectsOfTypeAll <VRCUiPageAuthentication>();
            VRCUiPageAuthentication   loginPage = authpages.First((page) => page.gameObject.name == "LoginUserPass");

            if (loginPage != null)
            {
                Button loginButton = loginPage.transform.Find("ButtonDone (1)")?.GetComponent <Button>();
                if (loginButton != null)
                {
                    ButtonClickedEvent bce = loginButton.onClick;
                    loginButton.onClick = new ButtonClickedEvent();
                    loginButton.onClick.AddListener(() => {
                        VRCModNetworkManager.SetCredentials(GetTextFromUiInputField(loginPage.loginUserName) + ":" + GetTextFromUiInputField(loginPage.loginPassword));
                        bce?.Invoke();
                    });
                }
                else
                {
                    VRCModLogger.Log("[VRCTools] Unable to find login button in login page");
                }
            }
            else
            {
                VRCModLogger.Log("[VRCTools] Unable to find login page");
            }

            yield return(DependenciesDownloader.CheckDownloadFiles());

            yield return(VRCModLoaderUpdater.CheckVRCModLoaderHash());

            if (ModPrefs.GetBool("vrctools", "enablediscordrichpresence"))
            {
                DiscordManager.Init();
            }

            yield return(AvatarFavUpdater.CheckForAvatarFavUpdate());

            VRCModNetworkStatus.Setup();
            ModConfigPage.Setup();
            ModdedUsersManager.Init();

            /*
             * if (ApiCredentials.Load())
             * {
             *  VRCModLogger.Log("ApiCredentials.GetAuthTokenProviderUserId() => " + ApiCredentials.());
             *  if (!SecurePlayerPrefs.HasKey("vrcmnw_token_" + ApiCredentials.GetAuthTokenProviderUserId()))
             *  {
             *      ApiCredentials.Clear();
             *  }
             * }
             */
            ApiCredentials.Clear();


            VRCModLogger.Log("[VRCTools] Init done !");

            VRCUiPopupManagerUtils.GetVRCUiPopupManager().HideCurrentPopup();

            VRCFlowManagerUtils.EnableVRCFlowManager();

            initialising = false;
            Initialised  = true;

            VRCModNetworkManager.ConnectAsync();
        }
예제 #4
0
파일: VRCTools.cs 프로젝트: rubybb/VRCTools
        private IEnumerator VRCToolsSetup()
        {
            VRCModLogger.Log("[VRCTools] Waiting for UI Manager...");
            yield return(VRCUiManagerUtils.WaitForUiManagerInit());

            VRCModLogger.Log("[VRCTools] UIManager initialised ! Resuming setup");

            VRCModLogger.Log("[VRCTools] Overwriting login button event");
            VRCUiPageAuthentication[] authpages = Resources.FindObjectsOfTypeAll <VRCUiPageAuthentication>();
            VRCUiPageAuthentication   loginPage = authpages.First((page) => page.gameObject.name == "LoginUserPass");

            if (loginPage != null)
            {
                Button loginButton = loginPage.transform.Find("ButtonDone (1)")?.GetComponent <Button>();
                if (loginButton != null)
                {
                    ButtonClickedEvent bce = loginButton.onClick;
                    loginButton.onClick = new ButtonClickedEvent();
                    loginButton.onClick.AddListener(() => {
                        VRCModNetworkManager.SetCredentials(GetTextFromUiInputField(loginPage.loginUserName) + ":" + GetTextFromUiInputField(loginPage.loginPassword));
                        bce?.Invoke();
                    });
                }
                else
                {
                    VRCModLogger.Log("[VRCTools] Unable to find login button in login page");
                }
            }
            else
            {
                VRCModLogger.Log("[VRCTools] Unable to find login page");
            }

            VRCModLogger.Log("[VRCTools] CheckDownloadFiles");
            yield return(DependenciesDownloader.CheckDownloadFiles());

            VRCModLogger.Log("[VRCTools] CheckVRCModLoaderHash");
            yield return(VRCModLoaderUpdater.CheckVRCModLoaderHash());

            if (ModPrefs.GetBool("vrctools", "enablediscordrichpresence"))
            {
                VRCModLogger.Log("[VRCTools] DiscordManager Init");
                DiscordManager.Init();
            }
            VRCModLogger.Log("[VRCTools] CheckForPermissions");
            yield return(CheckForPermissions());

            VRCModLogger.Log("[VRCTools] VRCModNetworkStatus Setup");
            VRCModNetworkStatus.Setup();
            VRCModLogger.Log("[VRCTools] ModConfigPage Setup");
            ModConfigPage.Setup();
            VRCModLogger.Log("[VRCTools] ModdedUsersManager Init");
            ModdedUsersManager.Init();

            VRCUiManagerUtils.OnPageShown += (page) => {
                VRCModLogger.Log("[VRCTools] OnPageShown: " + page.screenType + " " + (string.IsNullOrEmpty(page.displayName) ? "" : page.displayName + " ") + "(" + page.GetType() + ")");
            };

            VRCModLogger.Log("[VRCTools] Init done !");

            VRCFlowManagerUtils.EnableVRCFlowManager();

            initialising = false;
            Initialised  = true;

            //DebugUtils.PrintHierarchy(VRCUiManagerUtils.GetVRCUiManager().transform.root, 0);
        }