Merge pull request #4822 from Mailaender/map-test

Added checks for all map.yaml with Travis
This commit is contained in:
Paul Chote
2014-03-14 23:01:26 +13:00
4 changed files with 44 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
#region Copyright & License Information #region Copyright & License Information
/* /*
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS) * Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made * This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License * available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information, * as published by the Free Software Foundation. For more information,
@@ -370,6 +370,7 @@ namespace OpenRA
modData = new ModData(mod); modData = new ModData(mod);
Renderer.InitializeFonts(modData.Manifest); Renderer.InitializeFonts(modData.Manifest);
modData.InitializeLoaders(); modData.InitializeLoaders();
modData.LoadMaps();
PerfHistory.items["render"].hasNormalTick = false; PerfHistory.items["render"].hasNormalTick = false;
PerfHistory.items["batches"].hasNormalTick = false; PerfHistory.items["batches"].hasNormalTick = false;
@@ -400,7 +401,7 @@ namespace OpenRA
if (Settings.Server.DedicatedLoop) if (Settings.Server.DedicatedLoop)
{ {
Console.WriteLine("Starting a new server instance..."); Console.WriteLine("Starting a new server instance...");
modData.InitializeLoaders(); modData.LoadMaps();
continue; continue;
} }

View File

@@ -76,8 +76,6 @@ namespace OpenRA
SpriteLoader = new SpriteLoader(new string[0], SheetBuilder); SpriteLoader = new SpriteLoader(new string[0], SheetBuilder);
VoxelLoader = new VoxelLoader(); VoxelLoader = new VoxelLoader();
CursorProvider.Initialize(Manifest.Cursors); CursorProvider.Initialize(Manifest.Cursors);
AvailableMaps = FindMaps();
} }
public IEnumerable<string> Languages { get; private set; } public IEnumerable<string> Languages { get; private set; }
@@ -121,6 +119,11 @@ namespace OpenRA
FieldLoader.Translations = translations; FieldLoader.Translations = translations;
} }
public void LoadMaps()
{
AvailableMaps = FindMaps();
}
public Map PrepareMap(string uid) public Map PrepareMap(string uid)
{ {
LoadScreen.Display(); LoadScreen.Display();

View File

@@ -52,8 +52,26 @@ namespace OpenRA.Lint
AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly; AppDomain.CurrentDomain.AssemblyResolve += FileSystem.ResolveAssembly;
Game.modData = new ModData(mod); Game.modData = new ModData(mod);
var testMap = string.IsNullOrEmpty(map) ? new Map() : new Map(map); var maps = new Map[] { new Map() };
if (verbose && !string.IsNullOrEmpty(map)) if (!string.IsNullOrEmpty(map))
maps = new Map[] { new Map(map) };
else
{
Game.modData.LoadMaps();
maps = Game.modData.AvailableMaps.Values.ToArray();
}
foreach (var testMap in maps)
{
if (testMap.Rules.Count < 1)
{
if (verbose)
Console.WriteLine("No custom rules detected. Omitting Map: {0}".F(testMap.Title));
continue;
}
if (verbose)
Console.WriteLine("Map: {0}".F(testMap.Title)); Console.WriteLine("Map: {0}".F(testMap.Title));
Rules.LoadRules(Game.modData.Manifest, testMap); Rules.LoadRules(Game.modData.Manifest, testMap);
@@ -75,6 +93,7 @@ namespace OpenRA.Lint
EmitError("Failed with exception: {0}".F(e)); EmitError("Failed with exception: {0}".F(e));
} }
} }
}
if (errors > 0) if (errors > 0)
{ {

View File

@@ -903,12 +903,9 @@ Rules:
Ticks: 1 Ticks: 1
HealIfBelow: 101% HealIfBelow: 101%
DamageCooldown: 0 DamageCooldown: 0
Armament:
Weapon: CrateNuke
LocalOffset: 0,0,171
AttackFrontal:
Explodes: Explodes:
DemoTruck: Weapon: CrateNuke
EmptyWeapon: CrateNuke
BodyOrientation: BodyOrientation:
T17: T17:
Health: Health: