Merge pull request #99 from ZizzyDizzyMC/Indev

Ability to use proxy only for minecraft login
This commit is contained in:
ORelio 2015-10-18 18:04:50 +02:00
commit a5bf62bc94
2 changed files with 11 additions and 2 deletions

View file

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

View file

@ -35,6 +35,7 @@ namespace MinecraftClient
public static Proxy.ProxyHandler.Type proxyType = Proxy.ProxyHandler.Type.HTTP; public static Proxy.ProxyHandler.Type proxyType = Proxy.ProxyHandler.Type.HTTP;
public static string ProxyUsername = ""; public static string ProxyUsername = "";
public static string ProxyPassword = ""; public static string ProxyPassword = "";
public static bool OnlyForLogin = false;
//Other Settings //Other Settings
public static string TranslationsFile_FromMCDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\.minecraft\assets\objects\9e\9e2fdc43fc1c7024ff5922b998fadb2971a64ee0"; //MC 1.7.4 en_GB.lang public static string TranslationsFile_FromMCDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\.minecraft\assets\objects\9e\9e2fdc43fc1c7024ff5922b998fadb2971a64ee0"; //MC 1.7.4 en_GB.lang
@ -305,7 +306,6 @@ namespace MinecraftClient
case "enabled": RemoteCtrl_Enabled = str2bool(argValue); break; case "enabled": RemoteCtrl_Enabled = str2bool(argValue); break;
case "autotpaccept": RemoteCtrl_AutoTpaccept = str2bool(argValue); break; case "autotpaccept": RemoteCtrl_AutoTpaccept = str2bool(argValue); break;
case "tpaccepteveryone": RemoteCtrl_AutoTpaccept_Everyone = str2bool(argValue); break; case "tpaccepteveryone": RemoteCtrl_AutoTpaccept_Everyone = str2bool(argValue); break;
case "herochatmessagesenabled": Hero_Chat_Messages_Enabled = str2bool(argValue); break;
} }
break; break;
@ -323,6 +323,7 @@ namespace MinecraftClient
switch (argName.ToLower()) switch (argName.ToLower())
{ {
case "enabled": ProxyEnabled = str2bool(argValue); break; case "enabled": ProxyEnabled = str2bool(argValue); break;
case "onlyforlogin": OnlyForLogin = str2bool(argValue); break;
case "type": case "type":
argValue = argValue.ToLower(); argValue = argValue.ToLower();
if (argValue == "http") { proxyType = Proxy.ProxyHandler.Type.HTTP; } if (argValue == "http") { proxyType = Proxy.ProxyHandler.Type.HTTP; }
@ -419,6 +420,7 @@ namespace MinecraftClient
+ "server=0.0.0.0:0000\r\n" + "server=0.0.0.0:0000\r\n"
+ "username=\r\n" + "username=\r\n"
+ "password=\r\n" + "password=\r\n"
+ "onlyforlogin=false # Change this to \"true\" if you only want to use a proxy for login."
+ "\r\n" + "\r\n"
+ "#Bot Settings\r\n" + "#Bot Settings\r\n"
+ "\r\n" + "\r\n"