Esempio n. 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));
        }
Esempio n. 2
0
 void InvokeEventOnRequireNotifierUpdate(string text)
 {
     try
     {
         OnRequireNotifierUpdate?.Invoke(this, new Model.Data.StrEvent(text));
     }
     catch { }
 }
Esempio n. 3
0
 public void StopCoreThen(Action next = null)
 {
     Task.Factory.StartNew(() => server.StopCoreThen(
                               () =>
     {
         OnRequireNotifierUpdate?.Invoke(this, EventArgs.Empty);
         OnRequireKeepTrack?.Invoke(this, new VgcApis.Models.BoolEvent(false));
         next?.Invoke();
     }));
 }