diff --git a/Netch/Servers/Shadowsocks/SSController.cs b/Netch/Servers/Shadowsocks/SSController.cs index b24379ad..cc72f0f4 100644 --- a/Netch/Servers/Shadowsocks/SSController.cs +++ b/Netch/Servers/Shadowsocks/SSController.cs @@ -15,15 +15,13 @@ namespace Netch.Servers.Shadowsocks public ushort? Socks5LocalPort { get; set; } public string LocalAddress { get; set; } - private Mode _savedMode; public bool DllFlag; public bool Start(in Server s, in Mode mode) { - _savedMode = mode; Server = s; var server = (Shadowsocks) s; - DllFlag = Global.Settings.BootShadowsocksFromDLL && (_savedMode.Type == 0 || _savedMode.Type == 1 || _savedMode.Type == 2); + DllFlag = Global.Settings.BootShadowsocksFromDLL && mode.Type is 0 or 1 or 2 && !server.HasPlugin(); //从DLL启动Shaowsocks if (DllFlag) @@ -82,7 +80,6 @@ namespace Netch.Servers.Shadowsocks ShadowsocksDLL.Stop(); else StopInstance(); - _savedMode = null; } private class ShadowsocksDLL diff --git a/Netch/Servers/Shadowsocks/Shadowsocks.cs b/Netch/Servers/Shadowsocks/Shadowsocks.cs index 1c7cc98a..d44dcede 100644 --- a/Netch/Servers/Shadowsocks/Shadowsocks.cs +++ b/Netch/Servers/Shadowsocks/Shadowsocks.cs @@ -29,6 +29,8 @@ namespace Netch.Servers.Shadowsocks { Type = "SS"; } + + public bool HasPlugin() => string.IsNullOrWhiteSpace(Plugin) && string.IsNullOrWhiteSpace(PluginOption); } public static class SSGlobal