diff --git a/Server/Messages/MotdRequest.cs b/Server/Messages/MotdRequest.cs index 2556304f..3df70ea0 100644 --- a/Server/Messages/MotdRequest.cs +++ b/Server/Messages/MotdRequest.cs @@ -16,8 +16,14 @@ private static void SendMotdReply(ClientObject client) ServerMessage newMessage = new ServerMessage(); newMessage.type = ServerMessageType.MOTD_REPLY; + Random random = new Random(); + + List randomBodies = Settings.settingsStore.randomBodies; + string randomBody = randomBodies[random.Next(randomBodies.Count)]; + string newMotd = Settings.settingsStore.serverMotd; newMotd = newMotd.Replace("%name%", client.playerName); + newMotd = newMotd.Replace("%randombody%", randomBody); newMotd = newMotd.Replace(@"\n", Environment.NewLine); using (MessageWriter mw = new MessageWriter()) diff --git a/Server/Settings.cs b/Server/Settings.cs index 4b5fd735..819853d2 100644 --- a/Server/Settings.cs +++ b/Server/Settings.cs @@ -90,6 +90,8 @@ public class SettingsStore public string consoleIdentifier = "Server"; [Description("Specify the server's MOTD (message of the day).")] public string serverMotd = "Welcome, %name%!"; + [Description("List of bodies used for %randombody% in the server MOTD.")] + public List randomBodies = ["Moho", "Eve", "Gilly", "Mün", "Minmus", "Duna", "Ike", "Jool", "Laythe", "Vall", "Tylo", "Bop", "Pol", "Eeloo"]; [Description("Specify the amount of days a screenshot should be considered as expired and deleted. 0 = Disabled")] public double expireScreenshots = 0; [Description("Specify whether to enable compression. Decreases bandwidth usage but increases CPU usage. 0 = Disabled")] @@ -99,4 +101,4 @@ public class SettingsStore [Description("Specify the minimum distance in which vessels can interact with eachother at the launch pad and runway")] public float safetyBubbleDistance = 100.0f; } -} \ No newline at end of file +}