diff --git a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs index 50edd5ec71..c764544359 100644 --- a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs @@ -658,10 +658,6 @@ namespace OpenRA.Mods.Common.Server server.SendFluentMessage(TwoHumansRequired); else if (server.Map.Players.Players.Where(p => p.Value.Playable).All(p => !p.Value.AllowBots)) server.SendFluentMessage(MapBotsDisabled); - - var briefing = MissionBriefingOrDefault(server); - if (briefing != null) - server.SendMessage(briefing); } } @@ -1453,15 +1449,6 @@ namespace OpenRA.Mods.Common.Server return !validFactions.Contains(askedFaction) ? "Random" : askedFaction; } - static string MissionBriefingOrDefault(S server) - { - var missionData = server.Map.WorldActorInfo.TraitInfoOrDefault(); - if (missionData != null && !string.IsNullOrEmpty(missionData.Briefing)) - return missionData.Briefing.Replace("\\n", "\n"); - - return null; - } - public void ClientJoined(S server, Connection conn) { lock (server.LobbyInfo) @@ -1474,13 +1461,6 @@ namespace OpenRA.Mods.Common.Server // Validate whether color is allowed and get an alternative if it isn't if (client.Slot != null && !server.LobbyInfo.Slots[client.Slot].LockColor) client.Color = SanitizePlayerColor(server, client.Color, client.Index); - - // Report any custom map details - // HACK: this isn't the best place for this to live, but if we move it somewhere else - // then we need a larger hack to hook the map change event. - var briefing = MissionBriefingOrDefault(server); - if (briefing != null) - server.SendOrderTo(conn, "Message", briefing); } } diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index c84f8384d1..9de82c3e7c 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -611,7 +611,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (!mapAvailable && map.Status == MapStatus.Available) { mapAvailable = true; - orderManager.IssueOrder(Order.Command($"state {Session.ClientState.NotReady}")); + CurrentMapBecameAvailable(); } if (panel == PanelType.Options && OptionsTabDisabled()) @@ -665,6 +665,15 @@ namespace OpenRA.Mods.Common.Widgets.Logic } } + void CurrentMapBecameAvailable() + { + orderManager.IssueOrder(Order.Command($"state {Session.ClientState.NotReady}")); + + var missionData = map.WorldActorInfo.TraitInfoOrDefault(); + if (missionData != null && !string.IsNullOrEmpty(missionData.Briefing)) + TextNotificationsManager.AddSystemLine(missionData.Briefing.Replace("\\n", "\n")); + } + void UpdateCurrentMap() { mapStatus = orderManager.LobbyInfo.GlobalSettings.MapStatus; @@ -677,7 +686,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic // Tell the server that we have the map mapAvailable = map.Status == MapStatus.Available; if (mapAvailable) - orderManager.IssueOrder(Order.Command($"state {Session.ClientState.NotReady}")); + CurrentMapBecameAvailable(); // We don't have the map else if (map.Status != MapStatus.DownloadAvailable && Game.Settings.Game.AllowDownloading)