From fa6aa107c8884c06bad63d4f4ce10898f9c808af Mon Sep 17 00:00:00 2001 From: ORelio Date: Thu, 16 Jan 2014 19:33:48 +0100 Subject: [PATCH] Fixed username added several times with autorelog - If using autorelog bot, " - Username" was added each time the app was restarting - To fix this, added a ConsoleTitle setting which is re-used when restarting --- MinecraftClient/Program.cs | 5 +++-- MinecraftClient/Settings.cs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/MinecraftClient/Program.cs b/MinecraftClient/Program.cs index c4f424a9..b0d5e0db 100644 --- a/MinecraftClient/Program.cs +++ b/MinecraftClient/Program.cs @@ -23,7 +23,6 @@ namespace MinecraftClient static void Main(string[] args) { - Console.Title = "Minecraft Console Client"; Console.WriteLine("Console Client for MC 1.7.2 to 1.7.4 - v" + Version + " - By ORelio & Contributors"); //Basic Input/Output ? @@ -148,6 +147,8 @@ namespace MinecraftClient } else Settings.WriteDefaultSettings("MinecraftClient.ini"); + Console.Title = Settings.ConsoleTitle; + //Asking the user to type in missing data such as Username and Password if (Settings.Login == "") @@ -199,7 +200,7 @@ namespace MinecraftClient } if (result == MinecraftCom.LoginResult.Success) { - Console.Title += " - " + Settings.Username; + Console.Title = Settings.ConsoleTitle + " - " + Settings.Username; Console.WriteLine("Success. (session ID: " + sessionID + ')'); if (Settings.ServerIP == "") diff --git a/MinecraftClient/Settings.cs b/MinecraftClient/Settings.cs index 87bedeef..0ae80c53 100644 --- a/MinecraftClient/Settings.cs +++ b/MinecraftClient/Settings.cs @@ -21,6 +21,7 @@ namespace MinecraftClient public static string Password = ""; public static string ServerIP = ""; public static string SingleCommand = ""; + public static string ConsoleTitle = "Minecraft Console Client"; //Other Settings public static string TranslationsFile_FromMCDir = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\.minecraft\assets\virtual\legacy\lang\en_GB.lang"; @@ -121,7 +122,7 @@ namespace MinecraftClient case "singlecommand": SingleCommand = argValue; break; case "translationsfile": TranslationsFile = argValue; break; case "botownersfile": Bots_OwnersFile = argValue; break; - case "consoletitle": Console.Title = argValue; break; + case "consoletitle": ConsoleTitle = argValue; break; } break;