From 86efb38fa9ad7ef48d1520b7e00c1e875d210fa0 Mon Sep 17 00:00:00 2001 From: ORelio Date: Tue, 1 Jul 2014 20:31:47 +0200 Subject: [PATCH] Re-add /reco and /connect when connection is lost --- MinecraftClient/Program.cs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/MinecraftClient/Program.cs b/MinecraftClient/Program.cs index da77f645..2971d9bd 100644 --- a/MinecraftClient/Program.cs +++ b/MinecraftClient/Program.cs @@ -239,21 +239,24 @@ namespace MinecraftClient /// /// Pause the program, usually when an error or a kick occured, letting the user press Enter to quit OR type /reconnect /// - /// Return True if the user typed "/reconnect" - public static bool ReadLineReconnect() + public static void ReadLineReconnect() { if (!Settings.exitOnFailure) { - string text = Console.ReadLine(); - if (text == "reco" || text == "reconnect" || text == "/reco" || text == "/reconnect") + string text = Console.ReadLine().Trim(); + if (text.Length > 0 && (Settings.internalCmdChar == ' ' || text[0] == Settings.internalCmdChar)) { - Program.Restart(); - return true; + if (Settings.internalCmdChar != ' ') + 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; } ///