コード例 #1
0
        void RestartCoreWorker(Action next)
        {
            var finalConfig = configer.GetFinalConfig();

            if (finalConfig == null)
            {
                StopCoreThen(next);
                return;
            }

            coreServ.title = coreStates.GetTitle();
            coreServ.RestartCoreThen(
                finalConfig.ToString(),
                () =>
            {
                container.InvokeEventOnCoreStart();
                next?.Invoke();
            },
                Lib.Utils.GetEnvVarsFromConfig(finalConfig));
        }
コード例 #2
0
ファイル: CoreCtrl.cs プロジェクト: zxniuniu/V2RayGCon
        void RestartCoreWorker(Action next)
        {
            JObject cfg = configMgr.DecodeConfig(
                configer.GetConfig(),
                true,
                false,
                coreStates.IsInjectImport());

            if (cfg == null)
            {
                StopCoreThen(next);
                return;
            }

            if (!configMgr.ModifyInboundByCustomSetting(
                    ref cfg,
                    coreStates.GetCustomInbType(),
                    coreStates.GetInbIp(),
                    coreStates.GetInbPort()))
            {
                StopCoreThen(next);
                return;
            }

            configer.InjectSkipCnSitesConfigOnDemand(ref cfg);
            configer.InjectStatisticsConfigOnDemand(ref cfg);

            // debug
            var configStr = cfg.ToString(Formatting.Indented);

            coreServ.title = coreStates.GetTitle();
            coreServ.RestartCoreThen(
                cfg.ToString(),
                () =>
            {
                container.InvokeEventOnRequireNotifierUpdate();
                container.InvokeEventOnTrackCoreStart();
                next?.Invoke();
            },
                Lib.Utils.GetEnvVarsFromConfig(cfg));
        }
コード例 #3
0
        void RestartCoreWorker(Action next)
        {
            var finalConfig = configer.GetFinalConfig();

            if (finalConfig == null)
            {
                StopCoreThen(next);
                return;
            }

            v2rayCore.title = coreStates.GetTitle();
            v2rayCore.RestartCoreThen(
                finalConfig.ToString(),
                () =>
            {
                // Lib.V2Ray.Core will fire OnCoreStart
                // container.InvokeEventOnCoreStart();
                next?.Invoke();
            },
                Lib.Utils.GetEnvVarsFromConfig(finalConfig));
        }