Add more global audio debugging yipee (#22050)
This commit is contained in:
@@ -12,6 +12,7 @@ using Robust.Shared.ContentPack;
|
|||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Spawners;
|
using Robust.Shared.Spawners;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
using Timer = Robust.Shared.Timing.Timer;
|
using Timer = Robust.Shared.Timing.Timer;
|
||||||
|
|
||||||
namespace Content.Server.Administration.Commands;
|
namespace Content.Server.Administration.Commands;
|
||||||
@@ -64,6 +65,8 @@ public sealed class PlayGlobalAudioCommand : IConsoleCommand
|
|||||||
shell.WriteLine($"Audio global: {audio?.Component.Global}");
|
shell.WriteLine($"Audio global: {audio?.Component.Global}");
|
||||||
shell.WriteLine($"Audio paused: {entManager.IsPaused(audio?.Entity)}");
|
shell.WriteLine($"Audio paused: {entManager.IsPaused(audio?.Entity)}");
|
||||||
shell.WriteLine($"Audio lifetime: {entManager.GetComponent<TimedDespawnComponent>(audio!.Value.Entity).Lifetime}");
|
shell.WriteLine($"Audio lifetime: {entManager.GetComponent<TimedDespawnComponent>(audio!.Value.Entity).Lifetime}");
|
||||||
|
shell.WriteLine($"Can get state: {entManager.CanGetComponentState(entManager.EventBus, audio.Value.Component, shell.Player!)}");
|
||||||
|
shell.WriteLine($"Session specific: {entManager.GetComponent<MetaDataComponent>(audio.Value.Entity).SessionSpecific}");
|
||||||
|
|
||||||
if (args.Length > 1 && args[1] == "true")
|
if (args.Length > 1 && args[1] == "true")
|
||||||
{
|
{
|
||||||
@@ -71,6 +74,11 @@ public sealed class PlayGlobalAudioCommand : IConsoleCommand
|
|||||||
entManager.RemoveComponent<TimedDespawnComponent>(ent);
|
entManager.RemoveComponent<TimedDespawnComponent>(ent);
|
||||||
Timer.Spawn(600000, () => entManager.DeleteEntity(ent));
|
Timer.Spawn(600000, () => entManager.DeleteEntity(ent));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var WEH = entManager.GetComponent<TimedDespawnComponent>(audio.Value.Entity);
|
||||||
|
WEH.Lifetime = 20f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user