From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 29 Nov 2023 03:39:16 +0000 (+1100) Subject: Disable artifact spam on roundend (#21970) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=783879921bf603e5fc26f2ce408c6071eb3893de;p=space-station-14.git Disable artifact spam on roundend (#21970) * Disable artifact spam on roundend I think part of the issue was the enormous amount of logspam but at any rate this turns it off. * Also this * And these --- diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs index e6f937236d..af1f74dde8 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.Nodes.cs @@ -10,10 +10,6 @@ namespace Content.Server.Xenoarchaeology.XenoArtifacts; public sealed partial class ArtifactSystem { - [Dependency] private readonly IPrototypeManager _prototype = default!; - [Dependency] private readonly IComponentFactory _componentFactory = default!; - [Dependency] private readonly ISerializationManager _serialization = default!; - private const int MaxEdgesPerNode = 4; private readonly HashSet _usedNodeIds = new(); diff --git a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs index b8b2fba9d3..a7948aa7ff 100644 --- a/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs +++ b/Content.Server/Xenoarchaeology/XenoArtifacts/ArtifactSystem.cs @@ -12,28 +12,27 @@ using JetBrains.Annotations; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Configuration; +using Robust.Shared.Prototypes; using Robust.Shared.Random; +using Robust.Shared.Serialization.Manager; using Robust.Shared.Timing; namespace Content.Server.Xenoarchaeology.XenoArtifacts; public sealed partial class ArtifactSystem : EntitySystem { + [Dependency] private readonly IComponentFactory _componentFactory = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly ISerializationManager _serialization = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; - [Dependency] private readonly IConfigurationManager _configurationManager = default!; - - private ISawmill _sawmill = default!; public override void Initialize() { base.Initialize(); - _sawmill = Logger.GetSawmill("artifact"); - SubscribeLocalEvent(GetPrice); - SubscribeLocalEvent(OnRoundEnd); InitializeCommands(); InitializeActions(); @@ -202,8 +201,8 @@ public sealed partial class ArtifactSystem : EntitySystem var currentNode = GetNodeFromId(component.CurrentNodeId.Value, component); var allNodes = currentNode.Edges; - _sawmill.Debug($"our node: {currentNode.Id}"); - _sawmill.Debug($"other nodes: {string.Join(", ", allNodes)}"); + Log.Debug($"our node: {currentNode.Id}"); + Log.Debug($"other nodes: {string.Join(", ", allNodes)}"); if (TryComp(uid, out var bias) && TryComp(bias.Provider, out var trav) && @@ -226,14 +225,14 @@ public sealed partial class ArtifactSystem : EntitySystem } var undiscoveredNodes = allNodes.Where(x => !GetNodeFromId(x, component).Discovered).ToList(); - _sawmill.Debug($"Undiscovered nodes: {string.Join(", ", undiscoveredNodes)}"); + Log.Debug($"Undiscovered nodes: {string.Join(", ", undiscoveredNodes)}"); var newNode = _random.Pick(allNodes); if (undiscoveredNodes.Any() && _random.Prob(0.75f)) { newNode = _random.Pick(undiscoveredNodes); } - _sawmill.Debug($"Going to node {newNode}"); + Log.Debug($"Going to node {newNode}"); return GetNodeFromId(newNode, component); } @@ -294,22 +293,4 @@ public sealed partial class ArtifactSystem : EntitySystem { return allNodes.First(n => n.Depth == 0); } - - /// - /// Make shit go ape on round-end - /// - private void OnRoundEnd(RoundEndTextAppendEvent ev) - { - var RoundEndTimer = _configurationManager.GetCVar(CCVars.ArtifactRoundEndTimer); - if (RoundEndTimer > 0) - { - var query = EntityQueryEnumerator(); - while (query.MoveNext(out var ent, out var artifactComp)) - { - artifactComp.CooldownTime = TimeSpan.Zero; - var timerTrigger = EnsureComp(ent); - timerTrigger.ActivationRate = TimeSpan.FromSeconds(RoundEndTimer); //HAHAHAHAHAHAHAHAHAH -emo - } - } - } } diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 4e614f4f7a..a8adbe4873 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -327,12 +327,6 @@ namespace Content.Shared.CCVar public static readonly CVarDef GameAlertLevelChangeDelay = CVarDef.Create("game.alert_level_change_delay", 30, CVar.SERVERONLY); - /// - /// How many times per second artifacts when the round is over. - /// If set to 0, they won't activate (on a timer) when the round ends. - /// - public static readonly CVarDef ArtifactRoundEndTimer = CVarDef.Create("game.artifact_round_end_timer", 0.5f, CVar.NOTIFY | CVar.REPLICATED); - /// /// The time in seconds that the server should wait before restarting the round. /// Defaults to 2 minutes.