Merge pull request #5497 from Mailaender/map-rule-status-after-download

Fixed automatic map upload not refreshing map rule status
This commit is contained in:
Paul Chote
2014-06-01 18:29:39 +12:00

View File

@@ -132,13 +132,19 @@ namespace OpenRA
{ {
var r = FieldLoader.Load<RemoteMapData>(yaml); var r = FieldLoader.Load<RemoteMapData>(yaml);
// Map is not useable by the current version // Map download has been disabled server side
if (!r.downloading || r.requires_upgrade) if (!r.downloading)
{ {
Status = MapStatus.Unavailable; Status = MapStatus.Unavailable;
return; return;
} }
// Map is not useable by the current version
if (r.requires_upgrade)
RuleStatus = MapRuleStatus.Invalid;
else
RuleStatus = MapRuleStatus.Unknown;
Title = r.title; Title = r.title;
Type = r.map_type; Type = r.map_type;
Author = r.author; Author = r.author;
@@ -211,7 +217,11 @@ namespace OpenRA
} }
Log.Write("debug", "Downloaded map to '{0}'", mapPath); 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); download = new Download(mapUrl, mapPath, onDownloadProgress, onDownloadComplete);