From bb57ccd5bbabc094caf22576c708be84a29f47ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Fri, 30 May 2014 18:14:28 +0200 Subject: [PATCH 1/2] update MapRuleStatus after download fixes #5479 --- OpenRA.Game/Map/MapPreview.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Map/MapPreview.cs b/OpenRA.Game/Map/MapPreview.cs index 5207b1327d..36d14f66f7 100755 --- a/OpenRA.Game/Map/MapPreview.cs +++ b/OpenRA.Game/Map/MapPreview.cs @@ -132,13 +132,19 @@ namespace OpenRA { var r = FieldLoader.Load(yaml); - // Map is not useable by the current version - if (!r.downloading || r.requires_upgrade) + // Map download has been disabled server side + if (!r.downloading) { Status = MapStatus.Unavailable; return; } + // Map is not useable by the current version + if (r.requires_upgrade) + RuleStatus = MapRuleStatus.Invalid; + else + RuleStatus = MapRuleStatus.Cached; + Title = r.title; Type = r.map_type; Author = r.author; From 00662fe39151e1785dbbafb64992ad30bce6f9d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 1 Jun 2014 06:01:41 +0200 Subject: [PATCH 2/2] also do a local rule check after map download --- OpenRA.Game/Map/MapPreview.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Map/MapPreview.cs b/OpenRA.Game/Map/MapPreview.cs index 36d14f66f7..7e33da92d8 100755 --- a/OpenRA.Game/Map/MapPreview.cs +++ b/OpenRA.Game/Map/MapPreview.cs @@ -143,7 +143,7 @@ namespace OpenRA if (r.requires_upgrade) RuleStatus = MapRuleStatus.Invalid; else - RuleStatus = MapRuleStatus.Cached; + RuleStatus = MapRuleStatus.Unknown; Title = r.title; Type = r.map_type; @@ -217,7 +217,11 @@ namespace OpenRA } Log.Write("debug", "Downloaded map to '{0}'", mapPath); - Game.RunAfterTick(() => UpdateFromMap(new Map(mapPath), MapClassification.User)); + Game.RunAfterTick(() => + { + UpdateFromMap(new Map(mapPath), MapClassification.User); + CacheRules(); + }); }; download = new Download(mapUrl, mapPath, onDownloadProgress, onDownloadComplete);