From cd29b7de8613dd4e1d90c70eb479f3e6e0cfd5f2 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Sat, 10 Jun 2017 14:55:36 -0400 Subject: [PATCH] Soulcatcher chat logging, and subtle logging for free Logs soulcatcher messages to the chat log so admins can review them, since that's kinda important, and gives subtle it's own logging format so you can tell it's a subtle and not just an emote. Also disables subtles while in the soulcatcher because apparently that was a thing. --- code/_helpers/logging_vr.dm | 11 ++++ .../mob/living/carbon/human/emote_vr.dm | 4 +- code/modules/mob/say_vr.dm | 2 +- .../nifsoft/software/13_soulcatcher.dm | 65 ++++++++++++++----- vorestation.dme | 1 + 5 files changed, 63 insertions(+), 20 deletions(-) create mode 100644 code/_helpers/logging_vr.dm diff --git a/code/_helpers/logging_vr.dm b/code/_helpers/logging_vr.dm new file mode 100644 index 0000000000..2f4c48acc6 --- /dev/null +++ b/code/_helpers/logging_vr.dm @@ -0,0 +1,11 @@ +/proc/log_nsay(text,inside) + if (config.log_say) + diary << "\[[time_stamp()]]NSAY (NIF:[inside]): [text][log_end]" + +/proc/log_nme(text,inside) + if (config.log_emote) + diary << "\[[time_stamp()]]NME (NIF:[inside]): [text][log_end]" + +/proc/log_subtle(text) + if (config.log_emote) + diary << "\[[time_stamp()]]SUBTLE: [text][log_end]" diff --git a/code/modules/mob/living/carbon/human/emote_vr.dm b/code/modules/mob/living/carbon/human/emote_vr.dm index 0deb824388..b001a4ca7b 100644 --- a/code/modules/mob/living/carbon/human/emote_vr.dm +++ b/code/modules/mob/living/carbon/human/emote_vr.dm @@ -26,7 +26,7 @@ return 1 var/nifmessage = sanitize(input("Type a message to say.","Speak into NIF") as text|null) if(nifmessage) - SC.say_into(nifmessage,src.real_name) + SC.say_into(nifmessage,src) return 1 if ("nme") @@ -42,7 +42,7 @@ return 1 var/nifmessage = sanitize(input("Type an action to perform.","Emote into NIF") as text|null) if(nifmessage) - SC.emote_into(nifmessage,src.real_name) + SC.emote_into(nifmessage,src) return 1 if ("flip") diff --git a/code/modules/mob/say_vr.dm b/code/modules/mob/say_vr.dm index bb2851184d..c0e7c6b9ce 100644 --- a/code/modules/mob/say_vr.dm +++ b/code/modules/mob/say_vr.dm @@ -41,7 +41,7 @@ return if (message) - log_emote("[name]/[key] : [message]") + log_subtle("[name]/[key] : [message]") var/list/vis = get_mobs_and_objs_in_view_fast(get_turf(src),1,2) //Turf, Range, and type 2 is emote var/list/vis_mobs = vis["mobs"] diff --git a/code/modules/nifsoft/software/13_soulcatcher.dm b/code/modules/nifsoft/software/13_soulcatcher.dm index 52fbe74f6a..10a51fc77b 100644 --- a/code/modules/nifsoft/software/13_soulcatcher.dm +++ b/code/modules/nifsoft/software/13_soulcatcher.dm @@ -64,17 +64,34 @@ inside_flavor = load return TRUE - proc/say_into(var/message, var/sender) - to_chat(nif.human,"\[\icon[nif.big_icon]NIF\] [sender] speaks, \"[message]\"") - for(var/brainmob in brainmobs) - var/mob/living/carbon/brain/caught_soul/CS = brainmob - to_chat(CS,"\[\icon[nif.big_icon]NIF\] [sender] speaks, \"[message]\"") + proc/notify_into(var/message) + var/sound = nif.good_sound + + to_chat(nif.human,"\[\icon[nif.big_icon]NIF\] Soulcatcher displays, \"[message]\"") + nif.human << sound - proc/emote_into(var/message, var/sender) - to_chat(nif.human,"\[\icon[nif.big_icon]NIF\] [sender] [message]") for(var/brainmob in brainmobs) var/mob/living/carbon/brain/caught_soul/CS = brainmob - to_chat(CS,"\[\icon[nif.big_icon]NIF\] [sender] [message]") + to_chat(CS,"\[\icon[nif.big_icon]NIF\] Soulcatcher displays, \"[message]\"") + brainmob << sound + + proc/say_into(var/message, var/mob/living/sender) + var/sender_name = sender.name + log_nsay("[sender_name]/[sender.key] : [message]",nif.human) + + to_chat(nif.human,"\[\icon[nif.big_icon]NIF\] [sender_name] speaks, \"[message]\"") + for(var/brainmob in brainmobs) + var/mob/living/carbon/brain/caught_soul/CS = brainmob + to_chat(CS,"\[\icon[nif.big_icon]NIF\] [sender_name] speaks, \"[message]\"") + + proc/emote_into(var/message, var/mob/living/sender) + var/sender_name = sender.name + log_nme("[sender_name]/[sender.key] : [message]",nif.human) + + to_chat(nif.human,"\[\icon[nif.big_icon]NIF\] [sender_name] [message]") + for(var/brainmob in brainmobs) + var/mob/living/carbon/brain/caught_soul/CS = brainmob + to_chat(CS,"\[\icon[nif.big_icon]NIF\] [sender_name] [message]") proc/show_settings(var/mob/living/carbon/human/H) set waitfor = FALSE @@ -121,13 +138,14 @@ proc/toggle_setting(var/flag) setting_flags ^= flag + var/notify_message //Special treatment switch(flag) if(NIF_SC_BACKUPS) if(setting_flags & NIF_SC_BACKUPS) - emote_into(" - Mind backup system enabled.","SOULCATCHER") + notify_message = "Mind backup system enabled." else - emote_into(" - Mind backup system disabled.","SOULCATCHER") + notify_message = "Mind backup system disabled." if(NIF_SC_CATCHING_ME) if(setting_flags & NIF_SC_CATCHING_ME) @@ -144,23 +162,26 @@ for(var/brain in brainmobs) var/mob/living/carbon/brain/caught_soul/brainmob = brain brainmob.ext_deaf = FALSE - emote_into(" - External audio input enabled.","SOULCATCHER") + notify_message = "External audio input enabled." else for(var/brain in brainmobs) var/mob/living/carbon/brain/caught_soul/brainmob = brain brainmob.ext_deaf = TRUE - emote_into(" - External audio input disabled.","SOULCATCHER") + notify_message = "External audio input disabled." if(NIF_SC_ALLOW_EYES) if(setting_flags & NIF_SC_ALLOW_EYES) for(var/brain in brainmobs) var/mob/living/carbon/brain/caught_soul/brainmob = brain brainmob.ext_blind = FALSE - emote_into(" - External video input enabled.","SOULCATCHER") + notify_message = "External video input enabled." else for(var/brain in brainmobs) var/mob/living/carbon/brain/caught_soul/brainmob = brain brainmob.ext_blind = TRUE - emote_into(" - External video input disabled.","SOULCATCHER") + notify_message = "External video input disabled." + + if(notify_message) + notify_into(notify_message) return TRUE @@ -207,7 +228,7 @@ send messages that only they can hear/see by 'say'ing either '*nsay' or '*nme'.") //Announce to host and other minds - emote_into(" - New mind loaded: [brainmob.name]","SOULCATCHER") + notify_into("New mind loaded: [brainmob.name]") return TRUE //////////////// @@ -274,10 +295,20 @@ return FALSE ..() +/mob/living/carbon/brain/caught_soul/me_verb_subtle() + set hidden = TRUE + + return FALSE + +/mob/living/carbon/brain/caught_soul/whisper() + set hidden = TRUE + + return FALSE + /mob/living/carbon/brain/caught_soul/say(var/message) if(parent_mob) return ..() if(silent) return FALSE - soulcatcher.say_into(message,src.name) + soulcatcher.say_into(message,src) /mob/living/carbon/brain/caught_soul/emote(var/act,var/m_type=1,var/message = null) if(parent_mob) return ..() @@ -299,7 +330,7 @@ /mob/living/carbon/brain/caught_soul/custom_emote(var/m_type, var/message) if(silent) return FALSE - soulcatcher.emote_into(message,src.name) + soulcatcher.emote_into(message,src) /mob/living/carbon/brain/caught_soul/resist() set name = "Resist" diff --git a/vorestation.dme b/vorestation.dme index 31eeacc2fb..45d2950691 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -65,6 +65,7 @@ #include "code\_helpers\icons_vr.dm" #include "code\_helpers\lists.dm" #include "code\_helpers\logging.dm" +#include "code\_helpers\logging_vr.dm" #include "code\_helpers\maths.dm" #include "code\_helpers\matrices.dm" #include "code\_helpers\mobs.dm"