refactor: mode handle supported server

This commit is contained in:
ChsBuffer
2020-12-15 18:23:40 +08:00
parent 23bcac0d5d
commit 39eb1b4eef
5 changed files with 31 additions and 15 deletions

View File

@@ -64,12 +64,20 @@ namespace Netch.Controllers
try
{
if (!await Task.Run(() => StartServer(server, mode, ref _serverController)))
if (!ModeHelper.SkipServerController(server, mode))
{
throw new StartFailedException();
}
if (!await Task.Run(() => StartServer(server, mode, ref _serverController)))
{
throw new StartFailedException();
}
StatusPortInfoText.UpdateShareLan();
StatusPortInfoText.UpdateShareLan();
}
else
{
_serverController = ServerHelper.GetUtilByTypeName(server.Type).GetController();
_serverController.Server = server;
}
if (!await StartMode(server, mode))
{
@@ -134,7 +142,7 @@ namespace Netch.Controllers
if (server is Socks5 socks5)
{
if (socks5.Auth() && !mode.SupportSocks5Auth)
if (socks5.Auth())
UsingPorts.Add(StatusPortInfoText.Socks5Port = controller.Socks5LocalPort());
}
else