From 07fe774a471eba1c491e6843d5bd58962f568f43 Mon Sep 17 00:00:00 2001 From: Drathek <76988376+Drulikar@users.noreply.github.com> Date: Wed, 29 May 2024 10:19:40 -0700 Subject: [PATCH] Reduce chem smoke logging spam (#6345) # About the pull request Smoke reactions are now a niche admin log, and somewhat spam reduced by storing the last event in a static var. The reason why I say somewhat is because say two different people spray at the same time the last event will swap between both people each cloud. Now the hour/minute, area, chem, and user are used to create a siganture. # Explain why it's good for the game Chem smoke is now commonly used in rounds so its better to keep information sent to admins more relevant rather than spammed. # Testing Photographs and Procedure
Screenshots & Videos Second log was after a minute elapsed (which makes the signature unique again) ![image](https://github.com/cmss13-devs/cmss13/assets/76988376/eaac12d5-01ee-4679-9c67-ddc8597409b6)
# Changelog :cl: Drathek admin: Logging for chem smoke is now niche logged and less spammy /:cl: --- code/game/objects/effects/effect_system/chemsmoke.dm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/code/game/objects/effects/effect_system/chemsmoke.dm b/code/game/objects/effects/effect_system/chemsmoke.dm index 702760333ccc..10c0bc7acd22 100644 --- a/code/game/objects/effects/effect_system/chemsmoke.dm +++ b/code/game/objects/effects/effect_system/chemsmoke.dm @@ -27,7 +27,7 @@ var/list/targetTurfs var/list/wallList var/density - + var/static/last_reaction_signature /datum/effect_system/smoke_spread/chem/New() ..() @@ -80,14 +80,19 @@ contained = "\[[contained]\]" var/area/A = get_area(location) + var/reaction_signature = "[time2text(world.timeofday, "hh:mm")]: ([A.name])[contained] by [carry.my_atom.fingerprintslast]" + if(last_reaction_signature == reaction_signature) + return + last_reaction_signature = reaction_signature + var/where = "[A.name]|[location.x], [location.y]" var/whereLink = "[where]" if(carry.my_atom.fingerprintslast) - message_admins("A chemical smoke reaction has taken place in ([whereLink])[contained]. Last associated key is [carry.my_atom.fingerprintslast].") + msg_admin_niche("A chemical smoke reaction has taken place in ([whereLink])[contained]. Last associated key is [carry.my_atom.fingerprintslast].") log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last associated key is [carry.my_atom.fingerprintslast].") else - message_admins("A chemical smoke reaction has taken place in ([whereLink]). No associated key.") + msg_admin_niche("A chemical smoke reaction has taken place in ([whereLink])[contained]. No associated key.") log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.")