Re-add /reco and /connect when connection is lost

This commit is contained in:
ORelio 2014-07-01 20:31:47 +02:00
parent cfb313fa01
commit 86efb38fa9

View file

@ -239,21 +239,24 @@ namespace MinecraftClient
/// <summary> /// <summary>
/// Pause the program, usually when an error or a kick occured, letting the user press Enter to quit OR type /reconnect /// Pause the program, usually when an error or a kick occured, letting the user press Enter to quit OR type /reconnect
/// </summary> /// </summary>
/// <returns>Return True if the user typed "/reconnect"</returns>
public static bool ReadLineReconnect() public static void ReadLineReconnect()
{ {
if (!Settings.exitOnFailure) if (!Settings.exitOnFailure)
{ {
string text = Console.ReadLine(); string text = Console.ReadLine().Trim();
if (text == "reco" || text == "reconnect" || text == "/reco" || text == "/reconnect") if (text.Length > 0 && (Settings.internalCmdChar == ' ' || text[0] == Settings.internalCmdChar))
{ {
Program.Restart(); if (Settings.internalCmdChar != ' ')
return true; text = text.Substring(1);
if (text.StartsWith("reco"))
new Commands.Reco().Run(null, Settings.expandVars(text));
if (text.StartsWith("connect"))
new Commands.Connect().Run(null, Settings.expandVars(text));
} }
else return false;
} }
else return false;
} }
/// <summary> /// <summary>