Пример #1
0
        static void ProcessArgsCustomLoader(string[] args)
        {
            for (int i = 0; i < args.Length; i++)
            {
                string arg = args[i];
                switch (arg)
                {
                case "-autoStart":
                    Globals.AutoStartCustomLoader = true;
                    break;

                case "-noGui":
                    Globals.NoGui = true;
                    break;

                case "-hookDllPath":
                    if (i + 1 < args.Length)
                    {
                        if (!m_CustomLoaderHadHookDllPath)
                        {
                            GlobalConfig.Instance.Settings.CustomLoader.InjectDlls.Clear();

                            m_CustomLoaderHadHookDllPath = true;
                        }

                        CfgInjectDll dll = new CfgInjectDll();

                        dll.Path = args[i + 1];
                        i++;

                        GlobalConfig.Instance.Settings.CustomLoader.InjectDlls.Add(dll);
                    }
                    break;

                case "-programPath":
                    if (i + 1 < args.Length)
                    {
                        GlobalConfig.Instance.Settings.CustomLoader.ProgramPath = args[i + 1];
                        i++;
                    }
                    break;

                case "-cmdLine":
                    if (i + 1 < args.Length)
                    {
                        GlobalConfig.Instance.Settings.CustomLoader.CmdLine = args[i + 1];
                        i++;
                    }
                    break;
                }
            }

            // backup potential config changes:
            GlobalConfig.Instance.BackUp();
        }
Пример #2
0
        internal void OnDeserialized()
        {
            if (null != this.HookDllPath)
            {
                CfgInjectDll cfgInjectDll = new CfgInjectDll();
                cfgInjectDll.Path = this.HookDllPath;

                this.InjectDlls.Add(cfgInjectDll);

                this.HookDllPath = null;
            }
        }