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:
ORelio 2015-10-22 20:56:08 +02:00
parent e8a8ca4e7a
commit 29975da627
4 changed files with 15 additions and 17 deletions

View file

@ -111,14 +111,7 @@ namespace MinecraftClient
try
{
if (Settings.OnlyForLogin)
{
client = new TcpClient(host, port);
}
else
{
client = ProxyHandler.newTcpClient(host, port);
}
client = ProxyHandler.newTcpClient(host, port);
client.ReceiveBufferSize = 1024 * 1024;
handler = Protocol.ProtocolHandler.getProtocolHandler(client, protocolversion, this);
Console.WriteLine("Version is supported.\nLogging in...");