mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Merge onlyforlogin and enabled in proxy settings
The 'enabled' setting can now be set to 'login' for enabling proxy only for logging in to the Minecraft account, and then connect to the server directly without proxy. Useful when Minecraft login is blocked on some network, but not Minecraft servers (port 25565) (original idea and enhancement by ZizzyDizzyMC)
This commit is contained in:
parent
e8a8ca4e7a
commit
29975da627
4 changed files with 15 additions and 17 deletions
|
|
@ -24,12 +24,15 @@ namespace MinecraftClient.Proxy
|
|||
/// <summary>
|
||||
/// Create a regular TcpClient or a proxied TcpClient according to the app Settings.
|
||||
/// </summary>
|
||||
/// <param name="host">Target host</param>
|
||||
/// <param name="port">Target port</param>
|
||||
/// <param name="login">True if the purpose is logging in to a Minecraft account</param>
|
||||
|
||||
public static TcpClient newTcpClient(string host, int port)
|
||||
public static TcpClient newTcpClient(string host, int port, bool login = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (Settings.ProxyEnabled)
|
||||
if (login ? Settings.ProxyEnabledLogin : Settings.ProxyEnabledIngame)
|
||||
{
|
||||
ProxyType innerProxytype = ProxyType.Http;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue