]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix client-side log spam (#16222)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Mon, 8 May 2023 00:37:46 +0000 (12:37 +1200)
committerGitHub <noreply@github.com>
Mon, 8 May 2023 00:37:46 +0000 (10:37 +1000)
Content.Shared/Anomaly/SharedAnomalySystem.cs

index 1ca13acc964290725e1fea0b31cd5b7a009346a8..79b07c6d46401654411d5e8d4eb85f183b5f3458 100644 (file)
@@ -130,7 +130,8 @@ public abstract class SharedAnomalySystem : EntitySystem
         var variation = Random.NextFloat(-component.PulseVariation, component.PulseVariation) + 1;
         component.NextPulseTime = Timing.CurTime + GetPulseLength(component) * variation;
 
-        _sawmill.Info($"Performing anomaly pulse. Entity: {ToPrettyString(uid)}");
+        if (_net.IsServer)
+            _sawmill.Info($"Performing anomaly pulse. Entity: {ToPrettyString(uid)}");
 
         // if we are above the growth threshold, then grow before the pulse
         if (component.Stability > component.GrowthThreshold)
@@ -164,7 +165,8 @@ public abstract class SharedAnomalySystem : EntitySystem
             return;
 
         Log.Add(LogType.Anomaly, LogImpact.High, $"Anomaly {ToPrettyString(uid)} began to go supercritical.");
-        _sawmill.Info($"Anomaly is going supercritical. Entity: {ToPrettyString(uid)}");
+        if (_net.IsServer)
+            _sawmill.Info($"Anomaly is going supercritical. Entity: {ToPrettyString(uid)}");
 
         var super = EnsureComp<AnomalySupercriticalComponent>(uid);
         super.EndTime = Timing.CurTime + super.SupercriticalDuration;
@@ -189,7 +191,9 @@ public abstract class SharedAnomalySystem : EntitySystem
 
         Audio.PlayPvs(component.SupercriticalSound, uid);
 
-        _sawmill.Info($"Raising supercritical event. Entity: {ToPrettyString(uid)}");
+        if (_net.IsServer)
+            _sawmill.Info($"Raising supercritical event. Entity: {ToPrettyString(uid)}");
+
         var ev = new AnomalySupercriticalEvent();
         RaiseLocalEvent(uid, ref ev);
 
@@ -205,7 +209,8 @@ public abstract class SharedAnomalySystem : EntitySystem
     public void EndAnomaly(EntityUid uid, AnomalyComponent? component = null, bool supercritical = false)
     {
         // Logging before resolve, in case the anomaly has deleted itself.
-        _sawmill.Info($"Ending anomaly. Entity: {ToPrettyString(uid)}");
+        if (_net.IsServer)
+            _sawmill.Info($"Ending anomaly. Entity: {ToPrettyString(uid)}");
         Log.Add(LogType.Anomaly, LogImpact.Extreme, $"Anomaly {ToPrettyString(uid)} went supercritical.");
 
         if (!Resolve(uid, ref component))