Support downloading updates via command.

This commit is contained in:
BruceChen 2022-12-01 22:55:48 +08:00
parent 3713fa2dbe
commit 28827b720a
10 changed files with 2463 additions and 1974 deletions

View file

@ -17,6 +17,9 @@ namespace MinecraftClient.Proxy
[TomlDoNotInlineObject]
public class Configs
{
[TomlInlineComment("$Proxy.Enabled_Update$")]
public bool Enabled_Update = false;
[TomlInlineComment("$Proxy.Enabled_Login$")]
public bool Enabled_Login = false;
@ -79,7 +82,7 @@ namespace MinecraftClient.Proxy
case Configs.ProxyType.SOCKS5: innerProxytype = ProxyType.Socks5; break;
}
if (Config.Username != "" && Config.Password != "")
if (!string.IsNullOrWhiteSpace(Config.Username)&& !string.IsNullOrWhiteSpace(Config.Password))
proxy = factory.CreateProxyClient(innerProxytype, Config.Server.Host, Config.Server.Port, Config.Username, Config.Password);
else
proxy = factory.CreateProxyClient(innerProxytype, Config.Server.Host, Config.Server.Port);