Admin spring cleaning (#36190)
* Cleanup warnings in administration * Job command cleanup * Reverting already implemented changes
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.GameTicking;
|
using Content.Server.GameTicking;
|
||||||
using Content.Server.Ghost;
|
using Content.Server.Ghost;
|
||||||
using Content.Server.Mind;
|
using Content.Server.Mind;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ namespace Content.Server.Administration.Commands;
|
|||||||
[AdminCommand(AdminFlags.Admin)]
|
[AdminCommand(AdminFlags.Admin)]
|
||||||
public sealed class ForceGhostCommand : LocalizedEntityCommands
|
public sealed class ForceGhostCommand : LocalizedEntityCommands
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntityManager _entityManager = default!;
|
|
||||||
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||||
[Dependency] private readonly SharedMindSystem _mind = default!;
|
[Dependency] private readonly SharedMindSystem _mind = default!;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using Content.Shared.Station.Components;
|
using Content.Shared.Station.Components;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
using Robust.Shared.Map.Components;
|
using Robust.Shared.Map.Components;
|
||||||
@@ -72,6 +72,6 @@ public readonly struct SerializableEntityCoordinates
|
|||||||
EntityUid = coordinates.EntityId;
|
EntityUid = coordinates.EntityId;
|
||||||
X = coordinates.X;
|
X = coordinates.X;
|
||||||
Y = coordinates.Y;
|
Y = coordinates.Y;
|
||||||
MapUid = coordinates.GetMapUid(entityManager);
|
MapUid = entityManager.System<SharedTransformSystem>().GetMap(coordinates);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,8 @@ using System.Reflection;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Content.Server.Chat.Managers;
|
using Content.Server.Chat.Managers;
|
||||||
using Content.Server.Database;
|
using Content.Server.Database;
|
||||||
using Content.Server.Players;
|
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.CCVar;
|
using Content.Shared.CCVar;
|
||||||
using Content.Shared.Info;
|
|
||||||
using Content.Shared.Players;
|
using Content.Shared.Players;
|
||||||
using Robust.Server.Console;
|
using Robust.Server.Console;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
@@ -108,7 +106,7 @@ namespace Content.Server.Administration.Managers
|
|||||||
// The DB function handles this scenario fine, but it's worth noting.
|
// The DB function handles this scenario fine, but it's worth noting.
|
||||||
await _dbManager.UpdateAdminDeadminnedAsync(player.UserId, newState);
|
await _dbManager.UpdateAdminDeadminnedAsync(player.UserId, newState);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
_sawmill.Error("Failed to save deadmin state to database for {Admin}", player.UserId);
|
_sawmill.Error("Failed to save deadmin state to database for {Admin}", player.UserId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -421,7 +421,7 @@ public sealed partial class AdminVerbSystem
|
|||||||
{
|
{
|
||||||
var xform = Transform(args.Target);
|
var xform = Transform(args.Target);
|
||||||
var fixtures = Comp<FixturesComponent>(args.Target);
|
var fixtures = Comp<FixturesComponent>(args.Target);
|
||||||
_transformSystem.Unanchor(args.Target); // Just in case.
|
_transformSystem.Unanchor(args.Target, xform); // Just in case.
|
||||||
_physics.SetBodyType(args.Target, BodyType.Dynamic, manager: fixtures, body: physics);
|
_physics.SetBodyType(args.Target, BodyType.Dynamic, manager: fixtures, body: physics);
|
||||||
_physics.SetBodyStatus(args.Target, physics, BodyStatus.InAir);
|
_physics.SetBodyStatus(args.Target, physics, BodyStatus.InAir);
|
||||||
_physics.WakeBody(args.Target, manager: fixtures, body: physics);
|
_physics.WakeBody(args.Target, manager: fixtures, body: physics);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.Tag;
|
using Content.Shared.Tag;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
@@ -29,10 +29,10 @@ public sealed class TagCommand : ToolshedCommand
|
|||||||
public IEnumerable<EntityUid> With(
|
public IEnumerable<EntityUid> With(
|
||||||
[CommandInvocationContext] IInvocationContext ctx,
|
[CommandInvocationContext] IInvocationContext ctx,
|
||||||
[PipedArgument] IEnumerable<EntityUid> entities,
|
[PipedArgument] IEnumerable<EntityUid> entities,
|
||||||
[CommandArgument] ValueRef<string, Prototype<TagPrototype>> tag)
|
[CommandArgument] ProtoId<TagPrototype> tag)
|
||||||
{
|
{
|
||||||
_tag ??= GetSys<TagSystem>();
|
_tag ??= GetSys<TagSystem>();
|
||||||
return entities.Where(e => _tag.HasTag(e, tag.Evaluate(ctx)!));
|
return entities.Where(e => _tag.HasTag(e, tag!));
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandImplementation("add")]
|
[CommandImplementation("add")]
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Content.Server.Administration;
|
using Content.Server.Administration;
|
||||||
using Content.Server.Station.Systems;
|
using Content.Server.Station.Systems;
|
||||||
using Content.Shared.Administration;
|
using Content.Shared.Administration;
|
||||||
using Content.Shared.Roles;
|
using Content.Shared.Roles;
|
||||||
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Toolshed;
|
using Robust.Shared.Toolshed;
|
||||||
using Robust.Shared.Toolshed.Syntax;
|
using Robust.Shared.Toolshed.Syntax;
|
||||||
using Robust.Shared.Toolshed.TypeParsers;
|
using Robust.Shared.Toolshed.TypeParsers;
|
||||||
@@ -30,15 +31,15 @@ public sealed class JobsCommand : ToolshedCommand
|
|||||||
=> stations.SelectMany(Jobs);
|
=> stations.SelectMany(Jobs);
|
||||||
|
|
||||||
[CommandImplementation("job")]
|
[CommandImplementation("job")]
|
||||||
public JobSlotRef Job([PipedArgument] EntityUid station, Prototype<JobPrototype> job)
|
public JobSlotRef Job([PipedArgument] EntityUid station, ProtoId<JobPrototype> job)
|
||||||
{
|
{
|
||||||
_jobs ??= GetSys<StationJobsSystem>();
|
_jobs ??= GetSys<StationJobsSystem>();
|
||||||
|
|
||||||
return new JobSlotRef(job.Value.ID, station, _jobs, EntityManager);
|
return new JobSlotRef(job.Id, station, _jobs, EntityManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
[CommandImplementation("job")]
|
[CommandImplementation("job")]
|
||||||
public IEnumerable<JobSlotRef> Job([PipedArgument] IEnumerable<EntityUid> stations, Prototype<JobPrototype> job)
|
public IEnumerable<JobSlotRef> Job([PipedArgument] IEnumerable<EntityUid> stations, ProtoId<JobPrototype> job)
|
||||||
=> stations.Select(x => Job(x, job));
|
=> stations.Select(x => Job(x, job));
|
||||||
|
|
||||||
[CommandImplementation("isinfinite")]
|
[CommandImplementation("isinfinite")]
|
||||||
|
|||||||
Reference in New Issue
Block a user