Load Maps on Round Start, not Round Restart (#6930)
* Load Maps on Round Start, not Round Restart * Fix admin log test. It assumed maps/grids existed during pre-round, wihch is not a valid assumption anymore after this PR.
This commit is contained in:
committed by
GitHub
parent
01490d5989
commit
650b8b6600
@@ -234,8 +234,6 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
await server.WaitIdleAsync();
|
||||
|
||||
var sDatabase = server.ResolveDependency<IServerDbManager>();
|
||||
var sEntities = server.ResolveDependency<IEntityManager>();
|
||||
var sMaps = server.ResolveDependency<IMapManager>();
|
||||
var sSystems = server.ResolveDependency<IEntitySystemManager>();
|
||||
|
||||
var sAdminLogSystem = sSystems.GetEntitySystem<AdminLogSystem>();
|
||||
@@ -245,10 +243,7 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
|
||||
await server.WaitPost(() =>
|
||||
{
|
||||
var coordinates = GetMainEntityCoordinates(sMaps);
|
||||
var entity = sEntities.SpawnEntity(null, coordinates);
|
||||
|
||||
sAdminLogSystem.Add(LogType.Unknown, $"{entity} test log: {guid}");
|
||||
sAdminLogSystem.Add(LogType.Unknown, $"test log: {guid}");
|
||||
});
|
||||
|
||||
await server.WaitPost(() =>
|
||||
@@ -285,7 +280,6 @@ public sealed class AddTests : ContentIntegrationTest
|
||||
{
|
||||
var root = json.RootElement;
|
||||
|
||||
Assert.That(root.TryGetProperty("entity", out _), Is.True);
|
||||
Assert.That(root.TryGetProperty("guid", out _), Is.True);
|
||||
|
||||
json.Dispose();
|
||||
|
||||
@@ -190,6 +190,8 @@ namespace Content.Server.GameTicking
|
||||
|
||||
SendServerMessage(Loc.GetString("game-ticker-start-round"));
|
||||
|
||||
LoadMaps();
|
||||
|
||||
StartGamePresetRules();
|
||||
|
||||
RoundLengthMetric.Set(0);
|
||||
@@ -373,7 +375,6 @@ namespace Content.Server.GameTicking
|
||||
RunLevel = GameRunLevel.PreRoundLobby;
|
||||
LobbySong = _robustRandom.Pick(_lobbyMusicCollection.PickFiles).ToString();
|
||||
ResettingCleanup();
|
||||
LoadMaps();
|
||||
|
||||
if (!LobbyEnabled)
|
||||
{
|
||||
@@ -411,18 +412,18 @@ namespace Content.Server.GameTicking
|
||||
unCastData.ContentData()?.WipeMind();
|
||||
}
|
||||
|
||||
// Delete all entities.
|
||||
foreach (var entity in EntityManager.GetEntities().ToList())
|
||||
_startingRound = false;
|
||||
|
||||
_mapManager.Restart();
|
||||
|
||||
// Delete all remaining entities.
|
||||
foreach (var entity in EntityManager.GetEntities().ToArray())
|
||||
{
|
||||
// TODO: Maybe something less naive here?
|
||||
// FIXME: Actually, definitely.
|
||||
EntityManager.DeleteEntity(entity);
|
||||
}
|
||||
|
||||
_startingRound = false;
|
||||
|
||||
_mapManager.Restart();
|
||||
|
||||
_roleBanManager.Restart();
|
||||
|
||||
// Clear up any game rules.
|
||||
|
||||
Reference in New Issue
Block a user