diff --git a/Projects/Server/Configuration/ServerConfiguration.cs b/Projects/Server/Configuration/ServerConfiguration.cs index e5d318996..15e44f823 100644 --- a/Projects/Server/Configuration/ServerConfiguration.cs +++ b/Projects/Server/Configuration/ServerConfiguration.cs @@ -271,6 +271,12 @@ public static class ServerConfiguration _settings.Listeners.AddRange(ServerConfigurationPrompts.GetListeners()); } + if (!_settings.Settings.ContainsKey("serverListing.serverName")) + { + updated = true; + _settings.Settings["serverListing.serverName"] = ServerConfigurationPrompts.GetServerName(); + } + // We have a known, current expansion, so we can deserialize it from Configuration if (!ExpansionInfo.LoadConfiguration(out var currentExpansion)) { diff --git a/Projects/Server/Configuration/ServerConfigurationPrompts.cs b/Projects/Server/Configuration/ServerConfigurationPrompts.cs index b1094211a..60eaadec0 100644 --- a/Projects/Server/Configuration/ServerConfigurationPrompts.cs +++ b/Projects/Server/Configuration/ServerConfigurationPrompts.cs @@ -7,81 +7,6 @@ namespace Server; public static class ServerConfigurationPrompts { - internal static bool GetIsClient7090() - { - if (UOClient.ServerClientVersion != null) - { - return UOClient.ServerClientVersion >= ClientVersion.Version7090; - } - - Console.WriteLine("Will you be using a client version 7.0.9.0 or newer?"); - - do - { - Console.Write("[y] or n> "); - var input = Console.ReadLine(); - if (string.IsNullOrWhiteSpace(input) || input.InsensitiveStartsWith("y")) - { - Utility.PushColor(ConsoleColor.Yellow); - Console.WriteLine("Client >= 7.0.9.0 chosen."); - Utility.PopColor(); - return true; - } - - if (input.InsensitiveStartsWith("n")) - { - Utility.PushColor(ConsoleColor.Yellow); - Console.WriteLine("Client < 7.0.9.0 chosen."); - Utility.PopColor(); - return false; - } - - Console.Write("Invalid option "); - Utility.PushColor(ConsoleColor.Red); - Console.Write(input); - Utility.PopColor(); - Console.WriteLine(". Press y for yes or n for no."); - } while (true); - } - - - internal static bool GetIsClientPre6000() - { - if (UOClient.ServerClientVersion != null) - { - return UOClient.ServerClientVersion < ClientVersion.Version6000; - } - - Console.WriteLine("Will you be using a client version older than 6.0.0.0?"); - - do - { - Console.Write("y or [n]> "); - var input = Console.ReadLine(); - if (string.IsNullOrWhiteSpace(input) || input.InsensitiveStartsWith("n")) - { - Utility.PushColor(ConsoleColor.Yellow); - Console.WriteLine("Client >= 6.0.0.0 chosen."); - Utility.PopColor(); - return false; - } - - if (input.InsensitiveStartsWith("y")) - { - Utility.PushColor(ConsoleColor.Yellow); - Console.WriteLine("Client < 6.0.0.0 chosen."); - Utility.PopColor(); - return true; - } - - Console.Write("Invalid option "); - Utility.PushColor(ConsoleColor.Red); - Console.Write(input); - Utility.PopColor(); - Console.WriteLine(". Press y for yes or n for no."); - } while (true); - } - internal static List GetDataDirectories() { Console.WriteLine("Please enter the absolute path to your ClassicUO or Ultima Online data:"); @@ -168,4 +93,31 @@ public static class ServerConfigurationPrompts } while (true); return ips; } + + internal static string GetServerName() + { + Console.WriteLine("Please enter the name of your shard:"); + + string serverName; + do + { + Console.Write("[ModernUO]> "); + serverName = Console.ReadLine(); + + if (string.IsNullOrWhiteSpace(serverName)) + { + serverName = "ModernUO"; + } + + break; + } while (true); + + Console.Write("Server name set to "); + Utility.PushColor(ConsoleColor.Green); + Console.Write(serverName); + Utility.PopColor(); + Console.WriteLine("."); + + return serverName; + } }