From 9073249fe41fd22b389c656e3d93860d1b11f0ba Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 20 May 2018 09:35:37 +0000 Subject: [PATCH] Fix player connection notifications. New player notifications are now never reported to the joining player, and always reported in the dedicated server output. --- OpenRA.Game/Server/Server.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index e317e37f2b..24b29695d8 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -378,8 +378,8 @@ namespace OpenRA.Server Log.Write("server", "{0} ({1}) has joined the game.", client.Name, newConn.Socket.RemoteEndPoint); - if (LobbyInfo.NonBotClients.Count() > 1) - SendMessage("{0} has joined the game.".F(client.Name)); + // Report to all other players + SendMessage("{0} has joined the game.".F(client.Name), newConn); // Send initial ping SendOrderTo(newConn, "Ping", Game.RunTime.ToString(CultureInfo.InvariantCulture)); @@ -470,9 +470,9 @@ namespace OpenRA.Server DispatchOrdersToClient(conn, 0, 0, new ServerOrder(order, data).Serialize()); } - public void SendMessage(string text) + public void SendMessage(string text, Connection conn = null) { - DispatchOrdersToClients(null, 0, new ServerOrder("Message", text).Serialize()); + DispatchOrdersToClients(conn, 0, new ServerOrder("Message", text).Serialize()); if (Dedicated) Console.WriteLine("[{0}] {1}".F(DateTime.Now.ToString(Settings.TimestampFormat), text));