namespace Content.Server.Administration.Commands;
[AdminCommand(AdminFlags.Server)]
-public sealed class PersistenceSave : IConsoleCommand
+public sealed class PersistenceSave : LocalizedEntityCommands
{
[Dependency] private readonly IConfigurationManager _config = default!;
[Dependency] private readonly IEntitySystemManager _system = default!;
- [Dependency] private readonly IMapManager _map = default!;
+ [Dependency] private readonly SharedMapSystem _map = default!;
- public string Command => "persistencesave";
- public string Description => "Saves server data to a persistence file to be loaded later.";
- public string Help => "persistencesave [mapId] [filePath - default: game.map (CCVar) ]";
+ public override string Command => "persistencesave";
+ public override string Description => "Saves server data to a persistence file to be loaded later.";
+ public override string Help => "persistencesave [mapId] [filePath - default: game.map (CCVar) ]";
- public void Execute(IConsoleShell shell, string argStr, string[] args)
+ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length < 1 || args.Length > 2)
{
/// </remarks>
private void LoadMaps()
{
- if (_mapManager.MapExists(DefaultMap))
+ if (_map.MapExists(DefaultMap))
return;
AddGamePresetRules();
}
_metaData.SetEntityName(mapUid, proto.MapName);
- var g = new List<EntityUid> {grid.Value.Owner};
+ var g = new List<EntityUid> { grid.Value.Owner };
RaiseLocalEvent(new PostGameMapLoad(proto, mapId, g, stationName));
return g;
}
}
_metaData.SetEntityName(mapUid, proto.MapName);
- var g = new List<EntityUid> {grid.Value.Owner};
+ var g = new List<EntityUid> { grid.Value.Owner };
RaiseLocalEvent(new PostGameMapLoad(proto, mapId, g, stationName));
return g;
}
throw new Exception($"Failed to load game-map grid {ev.GameMap.ID}");
}
- var g = new List<EntityUid> {grid.Value.Owner};
+ var g = new List<EntityUid> { grid.Value.Owner };
// TODO MAP LOADING use a new event?
RaiseLocalEvent(new PostGameMapLoad(proto, targetMap, g, stationName));
return g;
HumanoidCharacterProfile profile;
if (_prefsManager.TryGetCachedPreferences(userId, out var preferences))
{
- profile = (HumanoidCharacterProfile) preferences.SelectedCharacter;
+ profile = (HumanoidCharacterProfile)preferences.SelectedCharacter;
}
else
{
var mapId = new MapId(mapInt);
- if (!MapManager.MapExists(mapId))
+ if (!_mapSystem.MapExists(mapId))
return;
if (!_mapSystem.TryGetMap(mapId, out var mapUid))
/// <summary>
/// Component for tracking active trigger timers. A timers can activated by some other component, e.g. <see cref="OnUseTimerTriggerComponent"/>.
/// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent]
public sealed partial class ActiveTimerTriggerComponent : Component
{
[DataField] public float TimeRemaining;
/// <summary>
/// Partner-component for adding discounts functionality to StoreSystem using StoreDiscountSystem.
/// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent]
public sealed partial class StoreDiscountComponent : Component
{
/// <summary>