コード例 #1
0
        void RestartCoreWorker(Action next)
        {
            JObject cfg = GetDecodedConfig(true, false, true);

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

            if (!OverwriteInboundSettings(
                    ref cfg,
                    overwriteInboundType,
                    this.inboundIP,
                    this.inboundPort))
            {
                StopCoreThen(next);
                return;
            }

            InjectSkipCnSiteSettingsIntoConfig(ref cfg);

            server.title = GetTitle();
            server.RestartCoreThen(
                cfg.ToString(),
                () =>
            {
                OnRequireNotifierUpdate?.Invoke(this, EventArgs.Empty);
                OnRequireKeepTrack?.Invoke(this, new VgcApis.Models.BoolEvent(true));
                next?.Invoke();
            },
                Lib.Utils.GetEnvVarsFromConfig(cfg));
        }
コード例 #2
0
ファイル: ServerCtrl.cs プロジェクト: hk318/V2RayGCon
        void RestartCoreWorker(Action next)
        {
            JObject cfg = GetDecodedConfig(true, false, true);

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

            if (!OverwriteInboundSettings(
                    ref cfg,
                    overwriteInboundType,
                    this.inboundIP,
                    this.inboundPort))
            {
                StopCoreThen(next);
                return;
            }

            InjectSkipCNSite(ref cfg);

            server.RestartCoreThen(
                cfg.ToString(),
                next,
                Lib.Utils.GetEnvVarsFromConfig(cfg));
        }