Merge pull request #2823 from ihptru/auto-map-dl

Auto map downloading
This commit is contained in:
Matthias Mailänder
2013-04-01 09:11:25 -07:00
5 changed files with 45 additions and 3 deletions

View File

@@ -119,7 +119,12 @@ namespace OpenRA.Network
throw new InvalidOperationException("Server's mod ({0}) and yours ({1}) don't match".F(localMods.FirstOrDefault().ToString().Split('@')[0], request.Mods.FirstOrDefault().ToString().Split('@')[0]));
// Check that the map exists on the client
if (!Game.modData.AvailableMaps.ContainsKey(request.Map))
throw new InvalidOperationException("Missing map {0}".F(request.Map));
{
if (Game.Settings.Game.AllowDownloading)
Game.DownloadMap(request.Map);
else
throw new InvalidOperationException("Missing map {0}".F(request.Map));
}
var info = new Session.Client()
{