public override void Load()
        {
            configShowServer = Config.Bind("General", "Show Server", true, "Show the server you are in?");

            ClassInjector.RegisterTypeInIl2Cpp <Bootstrapper>();
            ClassInjector.RegisterTypeInIl2Cpp <DataGrabber>();
            ClassInjector.RegisterTypeInIl2Cpp <UIManager>();

            GameObject obj = new GameObject("Bootstrapper");

            obj.AddComponent <Bootstrapper>();
            Object.DontDestroyOnLoad(obj);

            Harmony harmony = new Harmony(GUID);

            var originalAwake = AccessTools.Method(typeof(CanvasScaler), "Update");
            var postAwake     = AccessTools.Method(typeof(Bootstrapper), "Update");

            harmony.Patch(originalAwake, postfix: new HarmonyMethod(postAwake));

            RpcManager.Init();
        }
Example #2
0
        public void Update()
        {
            if (elapsed >= updateRate)
            {
                if (guiManager == null)
                {
                    guiManager = FindObjectOfType <GuiManager>();
                }

                if (guiManager != null)
                {
                    if (guiManager.interactionPanel != null && guiManager.interactionPanel.headText != null)
                    {
                        portalName = guiManager.interactionPanel.headText.text;
                        string matched = Regex.Replace(portalName, @"[\(1234567890+\/\) ]", "");
                        if (Array.Exists(realmPortalNames, (name) => name == matched))
                        {
                            realmName = matched;
                        }
                    }
                }

                if (characterInfo == null)
                {
                    characterInfo = FindObjectOfType <CharacterInfo>();
                }

                if (characterInfo != null)
                {
                    accountName = characterInfo.accountName.GetParsedText();
                    location    = characterInfo.DPFDOFNIJHM.GMJGBNCMJDG;

                    if (location == "Realm of the Mad God")
                    {
                        location = realmName;
                    }
                    try {
                        className = characterInfo.characterIconLoader.CDPFBLIIEMA.FHEEIFDDCME.ANELECFAPHF;
                    }
                    catch { }
                }

                if (appManager == null)
                {
                    appManager = FindObjectOfType <ApplicationManager>();
                }

                if (appManager != null)
                {
                    var serverManager = appManager.CHMPDHDJEOA;

                    if (serverManager != null)
                    {
                        server = serverManager.JLLDPBAANCK().ANELECFAPHF;
                    }
                }

                RpcManager.UpdateStatus();
                elapsed = 0;
            }
            elapsed += Time.deltaTime;
        }
Example #3
0
 void OnApplicationQuit()
 {
     RpcManager.Close();
 }