Add "Syndicate Puddle-Jumper" blueprint for admins to spawn in (#5273)
* Add "Syndicate Puddle-Jumper" blueprint for admins to spawn in Serves as a way to let admins cause nukies. * Unit test to make sure that maps remain loadable
This commit is contained in:
@@ -2,8 +2,10 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using Robust.Server.Maps;
|
||||||
using Robust.Shared.ContentPack;
|
using Robust.Shared.ContentPack;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
using Robust.Shared.Map;
|
||||||
using YamlDotNet.RepresentationModel;
|
using YamlDotNet.RepresentationModel;
|
||||||
|
|
||||||
namespace Content.IntegrationTests.Tests
|
namespace Content.IntegrationTests.Tests
|
||||||
@@ -55,5 +57,41 @@ namespace Content.IntegrationTests.Tests
|
|||||||
Assert.False(postMapInit, $"Map {map.Filename} was saved postmapinit");
|
Assert.False(postMapInit, $"Map {map.Filename} was saved postmapinit");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task MapsLoadableTest()
|
||||||
|
{
|
||||||
|
var server = StartServer();
|
||||||
|
|
||||||
|
await server.WaitIdleAsync();
|
||||||
|
|
||||||
|
var mapLoader = server.ResolveDependency<IMapLoader>();
|
||||||
|
var mapManager = server.ResolveDependency<IMapManager>();
|
||||||
|
var resourceManager = server.ResolveDependency<IResourceManager>();
|
||||||
|
var mapFolder = new ResourcePath("/Maps");
|
||||||
|
var maps = resourceManager
|
||||||
|
.ContentFindFiles(mapFolder)
|
||||||
|
.Where(filePath => filePath.Extension == "yml" && !filePath.Filename.StartsWith("."))
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
foreach (var map in maps)
|
||||||
|
{
|
||||||
|
var rootedPath = map.ToRootedPath();
|
||||||
|
|
||||||
|
// ReSharper disable once RedundantLogicalConditionalExpressionOperand
|
||||||
|
if (SkipTestMaps && rootedPath.ToString().StartsWith(TestMapsPath))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
server.Post(() =>
|
||||||
|
{
|
||||||
|
var mapId = mapManager.CreateMap();
|
||||||
|
mapLoader.LoadMap(mapId, rootedPath.ToString());
|
||||||
|
mapManager.DeleteMap(mapId);
|
||||||
|
});
|
||||||
|
await server.WaitIdleAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1735
Resources/Maps/syndipuddle.yml
Normal file
1735
Resources/Maps/syndipuddle.yml
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user