From 4c915ce8feebefa8b2a25a56a80db35cdea8ddd1 Mon Sep 17 00:00:00 2001 From: Igor Popov Date: Sun, 1 Jul 2012 16:52:32 +0400 Subject: [PATCH] dedicated: configurable MOTD --- OpenRA.Game/GameRules/Settings.cs | 2 ++ OpenRA.Game/Network/Session.cs | 1 + OpenRA.Game/Server/Server.cs | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/GameRules/Settings.cs b/OpenRA.Game/GameRules/Settings.cs index 800d206a5c..4099ab8e89 100644 --- a/OpenRA.Game/GameRules/Settings.cs +++ b/OpenRA.Game/GameRules/Settings.cs @@ -36,6 +36,7 @@ namespace OpenRA.GameRules public int TimeOut = 0; public bool Dedicated = false; public bool DedicatedLoop = true; + public string DedicatedMOTD = null; public ServerSettings() { } @@ -53,6 +54,7 @@ namespace OpenRA.GameRules TimeOut = other.TimeOut; Dedicated = other.Dedicated; DedicatedLoop = other.DedicatedLoop; + DedicatedMOTD = other.DedicatedMOTD; } } diff --git a/OpenRA.Game/Network/Session.cs b/OpenRA.Game/Network/Session.cs index 305b92a49f..cd198867ed 100644 --- a/OpenRA.Game/Network/Session.cs +++ b/OpenRA.Game/Network/Session.cs @@ -78,6 +78,7 @@ namespace OpenRA.Network public bool LockTeams = true; // don't allow team changes after game start. public bool AllowCheats = false; public bool Dedicated; + public string DedicatedMOTD; } public Session(string[] mods) diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index e771399732..9e0b07e122 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -119,6 +119,7 @@ namespace OpenRA.Server lobbyInfo.GlobalSettings.ServerName = settings.Name; lobbyInfo.GlobalSettings.Ban = settings.Ban; lobbyInfo.GlobalSettings.Dedicated = settings.Dedicated; + lobbyInfo.GlobalSettings.DedicatedMOTD = settings.DedicatedMOTD; foreach (var t in ServerTraits.WithInterface()) t.ServerStarted(this); @@ -330,7 +331,8 @@ namespace OpenRA.Server if ( lobbyInfo.GlobalSettings.Dedicated ) { - SendChatTo(newConn, "You have joined the dedicated server!"); + if (lobbyInfo.GlobalSettings.DedicatedMOTD != null) + SendChatTo(newConn, lobbyInfo.GlobalSettings.DedicatedMOTD); if (client.IsAdmin) SendChatTo(newConn, " You are admin now!"); else