2021-07-04 18:11:52 +02:00
|
|
|
|
using Content.Server.Administration;
|
|
|
|
|
|
using Content.Server.Power.EntitySystems;
|
|
|
|
|
|
using Content.Shared.Administration;
|
|
|
|
|
|
using Robust.Shared.Console;
|
|
|
|
|
|
|
2025-06-29 21:41:55 -04:00
|
|
|
|
namespace Content.Server.Power.Commands;
|
2024-05-12 17:34:52 -07:00
|
|
|
|
|
2025-06-29 21:41:55 -04:00
|
|
|
|
[AdminCommand(AdminFlags.Debug)]
|
|
|
|
|
|
public sealed class PowerStatCommand : LocalizedEntityCommands
|
|
|
|
|
|
{
|
|
|
|
|
|
[Dependency] private readonly PowerNetSystem _powerNet = default!;
|
2021-07-04 18:11:52 +02:00
|
|
|
|
|
2025-06-29 21:41:55 -04:00
|
|
|
|
public override string Command => "powerstat";
|
2021-07-04 18:11:52 +02:00
|
|
|
|
|
2025-06-29 21:41:55 -04:00
|
|
|
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
|
|
|
|
{
|
|
|
|
|
|
var stats = _powerNet.GetStatistics();
|
|
|
|
|
|
shell.WriteLine(Loc.GetString("cmd-powerstat-output",
|
|
|
|
|
|
("networks", stats.CountNetworks),
|
|
|
|
|
|
("loads", stats.CountLoads),
|
|
|
|
|
|
("supplies", stats.CountSupplies),
|
|
|
|
|
|
("batteries", stats.CountBatteries)));
|
2021-07-04 18:11:52 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|