From 0dc939e0e864313c9ff9623892a56dde1357217e Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Fri, 18 Mar 2016 17:55:12 +0000 Subject: [PATCH] Notify the server after installing a map. --- OpenRA.Game/Map/MapPreview.cs | 3 ++- .../Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Map/MapPreview.cs b/OpenRA.Game/Map/MapPreview.cs index 53fa57d851..d56c880548 100644 --- a/OpenRA.Game/Map/MapPreview.cs +++ b/OpenRA.Game/Map/MapPreview.cs @@ -314,7 +314,7 @@ namespace OpenRA }); } - public void Install() + public void Install(Action onSuccess) { if (Status != MapStatus.DownloadAvailable || !Game.Settings.Game.AllowDownloading) return; @@ -372,6 +372,7 @@ namespace OpenRA { var package = modData.ModFiles.OpenPackage(mapFilename, mapInstallPackage); UpdateFromMap(package, mapInstallPackage, MapClassification.User, null, GridType); + onSuccess(); }); }; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs index 7b9775bcc4..0adcd35579 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyMapPreviewLogic.cs @@ -99,7 +99,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic var install = download.GetOrNull("MAP_INSTALL"); if (install != null) { - install.OnClick = () => lobby.Map.Install(); + install.OnClick = () => lobby.Map.Install( + () => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady)))); install.IsHighlighted = () => installHighlighted; } } @@ -160,7 +161,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic retry.OnClick = () => { if (lobby.Map.Status == MapStatus.DownloadError) - lobby.Map.Install(); + lobby.Map.Install(() => orderManager.IssueOrder(Order.Command("state {0}".F(Session.ClientState.NotReady)))); else if (lobby.Map.Status == MapStatus.Unavailable) modData.MapCache.QueryRemoteMapDetails(new[] { lobby.Map.Uid }); };