diff --git a/MinecraftClient/Protocol/ProtocolHandler.cs b/MinecraftClient/Protocol/ProtocolHandler.cs index cbf1b1cd90..dab7324933 100644 --- a/MinecraftClient/Protocol/ProtocolHandler.cs +++ b/MinecraftClient/Protocol/ProtocolHandler.cs @@ -637,9 +637,24 @@ private static LoginResult YggdrasiLogin(string user, string pass, out SessionTo ConsoleIO.WriteLine(Translations.mcc_avaliable_profiles + availableProfiles); - ConsoleIO.WriteLine(Translations.mcc_select_profile); - string selectedProfileName = ConsoleIO.ReadLine(); + string selectedProfileName; + + if (Config.Main.General.AuthUser == "") + { + ConsoleIO.WriteLine(Translations.mcc_select_profile); + selectedProfileName = ConsoleIO.ReadLine(); + } + else + { + selectedProfileName = Config.Main.General.AuthUser; + + } + ConsoleIO.WriteLine(Translations.mcc_selected_profile + " " + selectedProfileName); + + // ConsoleIO.WriteLine(Translations.mcc_select_profile); + // string selectedProfileName = ConsoleIO.ReadLine(); + // ConsoleIO.WriteLine(Translations.mcc_selected_profile + " " + selectedProfileName); Json.JSONData? selectedProfile = null; foreach (Json.JSONData profile in loginResponse.Properties["availableProfiles"] .DataArray) diff --git a/MinecraftClient/Resources/ConfigComments/ConfigComments.Designer.cs b/MinecraftClient/Resources/ConfigComments/ConfigComments.Designer.cs index 65bb9a0b6d..4dcf11cd45 100644 --- a/MinecraftClient/Resources/ConfigComments/ConfigComments.Designer.cs +++ b/MinecraftClient/Resources/ConfigComments/ConfigComments.Designer.cs @@ -1748,6 +1748,15 @@ internal static string Main_General_AuthlibServer { } } + /// + /// Looks up a localized string similar to Yggdrasil authlib multi-user selection.. + /// + internal static string Main_General_AuthlibUser { + get { + return ResourceManager.GetString("Main.General.AuthlibUser", resourceCulture); + } + } + /// /// Looks up a localized string similar to The address of the game server, "Host" can be filled in with domain name or IP address. (The "Port" field can be deleted, it will be resolved automatically). /// diff --git a/MinecraftClient/Resources/ConfigComments/ConfigComments.resx b/MinecraftClient/Resources/ConfigComments/ConfigComments.resx index ca44031449..5908d88c40 100644 --- a/MinecraftClient/Resources/ConfigComments/ConfigComments.resx +++ b/MinecraftClient/Resources/ConfigComments/ConfigComments.resx @@ -855,4 +855,7 @@ If the connection to the Minecraft game server is blocked by the firewall, set E Set to false to opt-out of Sentry error logging. + + Yggdrasil authlib multi-user selection. + \ No newline at end of file diff --git a/MinecraftClient/Settings.cs b/MinecraftClient/Settings.cs index d8d564c9bd..1461413ae1 100644 --- a/MinecraftClient/Settings.cs +++ b/MinecraftClient/Settings.cs @@ -496,6 +496,9 @@ public class GeneralConfig public LoginMethod Method = LoginMethod.mcc; [TomlInlineComment("$Main.General.AuthlibServer$")] public AuthlibServer AuthServer = new(string.Empty); + + [TomlInlineComment("$Main.General.AuthlibUser$")] + public string AuthUser = ""; public enum LoginType { mojang, microsoft,yggdrasil };