Refactor map loading & saving
This commit is contained in:
@@ -3,10 +3,10 @@ using Content.Server.Administration;
|
||||
using Content.Shared.Administration;
|
||||
using Content.Shared.CCVar;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Maps;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.EntitySerialization.Systems;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
@@ -23,7 +23,7 @@ public sealed class MappingSystem : EntitySystem
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IResourceManager _resMan = default!;
|
||||
[Dependency] private readonly MapLoaderSystem _map = default!;
|
||||
[Dependency] private readonly MapLoaderSystem _loader = default!;
|
||||
|
||||
// Not a comp because I don't want to deal with this getting saved onto maps ever
|
||||
/// <summary>
|
||||
@@ -78,7 +78,7 @@ public sealed class MappingSystem : EntitySystem
|
||||
var path = Path.Combine(saveDir, $"{DateTime.Now.ToString("yyyy-M-dd_HH.mm.ss")}-AUTO.yml");
|
||||
_currentlyAutosaving[map] = (CalculateNextTime(), name);
|
||||
Log.Info($"Autosaving map {name} ({map}) to {path}. Next save in {ReadableTimeLeft(map)} seconds.");
|
||||
_map.SaveMap(map, path);
|
||||
_loader.SaveMap(map, path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user