]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add more global audio debugging yipee (#22050)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Fri, 1 Dec 2023 05:42:33 +0000 (16:42 +1100)
committerGitHub <noreply@github.com>
Fri, 1 Dec 2023 05:42:33 +0000 (16:42 +1100)
Content.Server/Administration/Commands/PlayGlobalSoundCommand.cs

index 9155bc005c26c8ba88eb1a54b628b778c015e336..b983a8f00ca5730770ee3a06dba88b8ec15eb8c2 100644 (file)
@@ -12,6 +12,7 @@ using Robust.Shared.ContentPack;
 using Robust.Shared.Player;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Spawners;
+using Robust.Shared.Timing;
 using Timer = Robust.Shared.Timing.Timer;
 
 namespace Content.Server.Administration.Commands;
@@ -64,6 +65,8 @@ public sealed class PlayGlobalAudioCommand : IConsoleCommand
         shell.WriteLine($"Audio global: {audio?.Component.Global}");
         shell.WriteLine($"Audio paused: {entManager.IsPaused(audio?.Entity)}");
         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")
         {
@@ -71,6 +74,11 @@ public sealed class PlayGlobalAudioCommand : IConsoleCommand
             entManager.RemoveComponent<TimedDespawnComponent>(ent);
             Timer.Spawn(600000, () => entManager.DeleteEntity(ent));
         }
+        else
+        {
+            var WEH = entManager.GetComponent<TimedDespawnComponent>(audio.Value.Entity);
+            WEH.Lifetime = 20f;
+        }
     }
 }