JSON Logging Refactor (#18252)

* First pass

* fixes

* more fixes

* num2hex length changes

* pass 2

* fixed warning

* looc log fix

* .

* update tgui

* .

* .

* .

* .

* perttier

* cleanup

* .

* .

* fix token

* no

* .

* .

* .

* ,

* modsay eventsay

* .

---------

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
Selis
2025-09-11 17:28:20 +02:00
committed by GitHub
co-authored by Kashargul
parent 67fa43bd5a
commit b0f0f4685f
403 changed files with 4013 additions and 2309 deletions
+1 -1
View File
@@ -901,7 +901,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
return 0
var/msg = tgui_input_text(src, "Message:", "Spectral Whisper", "", MAX_MESSAGE_LEN)
if(msg)
log_say("(SPECWHISP to [key_name(M)]): [msg]", src)
log_talk("(SPECWHISP to [key_name(M)]): [msg]", LOG_WHISPER)
to_chat(M, span_warning(" You hear a strange, unidentifiable voice in your head... [span_purple("[msg]")]"))
to_chat(src, span_warning(" You said: '[msg]' to [M]."))
else
+2 -2
View File
@@ -4,7 +4,7 @@
if(!message)
return
log_ghostsay(message, src)
log_talk("(GHOST SAY) [message]", LOG_SAY)
if (client)
if(message)
@@ -20,7 +20,7 @@
if(!message)
return
log_ghostemote(message, src)
log_message("(GHOST EMOTE) [message]", LOG_EMOTE)
if(client)
if(message)
+1 -1
View File
@@ -30,7 +30,7 @@
input = encode_html_emphasis(input)
if(input)
log_ghostemote(input, src)
log_message("(GHOST EMOTE) [input]", LOG_EMOTE)
if(!invisibility) //If the ghost is made visible by admins or cult. And to see if the ghost has toggled its own visibility, as well. -Mech
visible_message(span_deadsay(span_bold("[src]") + " [input]"))
else
+1 -1
View File
@@ -144,7 +144,7 @@
// But in practice, it's just a way for a language to override all other languages and bypass hear_say
// which is exactly what sign language does.
/datum/language/sign/broadcast(var/mob/living/speaker, var/message, var/speaker_mask)
log_say("(SIGN) [message]", speaker)
speaker.log_talk("(SIGN) [message]", LOG_SAY)
var/verb_to_use = pick(signlang_verb)
speaker.say_signlang(message, verb_to_use, verb_to_use, src)
+2 -2
View File
@@ -128,7 +128,7 @@
return (copytext(message, length(message)) == "!") ? 2 : 1
/datum/language/proc/broadcast(var/mob/living/speaker,var/message,var/speaker_mask)
log_say("(HIVE) [message]", speaker)
speaker.log_talk("(HIVE) [message]", LOG_SAY)
add_verb(speaker, /mob/proc/adjust_hive_range)
@@ -226,7 +226,7 @@
/mob/proc/can_speak(datum/language/speaking)
//Prevents someone from speaking a null language.
if(!speaking)
log_debug("[src] attempted to speak a null language.")
log_runtime("[src] attempted to speak a null language.")
return 0
if(speaking == GLOB.all_languages["Noise"])
+3 -3
View File
@@ -96,7 +96,7 @@
flags = WHITELISTED | SIGNLANG | NO_STUTTER //nonverbal define was not needed here, and i need to use it ~Layne
/datum/language/tajsign/broadcast(var/mob/living/speaker, var/message, var/speaker_mask)
log_say("(SIGN) [message]", speaker)
speaker.log_talk("(SIGN) [message]", LOG_SAY)
var/verb_to_use = pick(signlang_verb)
speaker.say_signlang(message, verb_to_use, verb_to_use, src)
@@ -127,8 +127,8 @@
syllables = list("qr","qrr","xuq","qil","quum","xuqm","vol","xrim","zaoo","qu-uu","qix","qoo","zix")
/datum/language/skrell/get_random_name(var/gender)
var/list/first_names = file2list('strings/names/first_name_skrell.txt')
var/list/last_names = file2list('strings/names/last_name_skrell.txt')
var/list/first_names = world.file2list('strings/names/first_name_skrell.txt')
var/list/last_names = world.file2list('strings/names/last_name_skrell.txt')
return "[pick(first_names)] [pick(last_names)]"
/datum/language/human
+1 -1
View File
@@ -159,7 +159,7 @@
flags = WHITELISTED
/datum/language/echosong/broadcast(var/mob/living/speaker, var/message, var/speaker_mask)
log_say("(INAUDIBLE) [message]", speaker)
speaker.log_talk("(INAUDIBLE) [message]", LOG_SAY)
speaker.say_signlang(format_message(message), pick(signlang_verb), pick(signlang_verb_understood), src, 2)
/datum/language/unathi
@@ -983,7 +983,7 @@
else
target.show_message(span_filter_say("[span_blue("You hear a voice that seems to echo around the room: [say]")]"))
src.show_message(span_filter_say("[span_blue("You project your mind into [target.real_name]: [say]")]"))
log_say("(TPATH to [key_name(target)]) [say]",src)
log_talk("(TPATH to [key_name(target)]) [say]", LOG_SAY)
for(var/mob/observer/dead/G in GLOB.mob_list)
G.show_message(span_filter_say(span_italics("Telepathic message from " + span_bold("[src]") + " to " + span_bold("[target]") + ": [say]")))
@@ -512,7 +512,7 @@ This function restores all organs.
/mob/living/carbon/human/apply_damage(var/damage = 0, var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/soaked = 0, var/sharp = FALSE, var/edge = FALSE, var/obj/used_weapon = null, var/projectile = FALSE)
SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMAGE, damage, damagetype, def_zone, blocked, soaked, sharp, edge, used_weapon, projectile)
if(GLOB.Debug2)
to_world_log("## DEBUG: human/apply_damage() was called on [src], with [damage] damage, an armor value of [blocked], and a soak value of [soaked].")
log_world("## DEBUG: human/apply_damage() was called on [src], with [damage] damage, an armor value of [blocked], and a soak value of [soaked].")
var/obj/item/organ/external/organ = null
if(isorgan(def_zone))
organ = def_zone
@@ -595,7 +595,7 @@ This function restores all organs.
damage -= soaked
if(GLOB.Debug2)
to_world_log("## DEBUG: [src] was hit for [damage].")
log_world("## DEBUG: [src] was hit for [damage].")
switch(damagetype)
if(BRUTE)
@@ -104,7 +104,7 @@
to_chat(src, span_filter_notice("Not even a [src.species.name] can speak to the dead."))
return
log_say("(COMMUNE to [key_name(M)]) [text]",src)
log_talk("(COMMUNE to [key_name(M)]) [text]", LOG_SAY)
to_chat(M, span_filter_say("[span_blue("Like lead slabs crashing into the ocean, alien thoughts drop into your mind: [text]")]"))
if(ishuman(M))
@@ -121,7 +121,7 @@
var/msg = tgui_input_text(src, "Message:", "Psychic Whisper", "", MAX_MESSAGE_LEN)
if(msg)
log_say("(PWHISPER to [key_name(M)]) [msg]", src)
log_talk("(PWHISPER to [key_name(M)]) [msg]", LOG_WHISPER)
to_chat(M, span_filter_say("[span_green("You hear a strange, alien voice in your head... <i>[msg]</i>")]"))
to_chat(src, span_filter_say("[span_green("You said: \"[msg]\" to [M]")]"))
return
@@ -1066,18 +1066,15 @@
adjust_nutrition(-2)
var/recovery_amt = max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
//to_world("Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
// log_debug("Cold. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
bodytemperature += recovery_amt
else if(species.cold_level_1 <= bodytemperature && bodytemperature <= species.heat_level_1)
var/recovery_amt = body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR
//to_world("Norm. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
// log_debug("Norm. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
bodytemperature += recovery_amt
else if(bodytemperature > species.heat_level_1) //360.15 is 310.15 + 50, the temperature where you start to feel effects.
//We totally need a sweat system cause it totally makes sense...~
var/recovery_amt = min((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), -BODYTEMP_AUTORECOVERY_MINIMUM) //We're dealing with negative numbers
//to_world("Hot. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
// log_debug("Hot. Difference = [body_temperature_difference]. Recovering [recovery_amt]")
bodytemperature += recovery_amt
//This proc returns a number made up of the flags for body parts which you are protected on. (such as HEAD, UPPER_TORSO, LOWER_TORSO, etc. See setup.dm for the full list)
@@ -441,18 +441,14 @@
return
var/mob/living/M = src
log_debug("polymorph start")
if(!istype(M))
log_debug("polymorph istype")
return
if(M.stat) //We can let it undo the TF, because the person will be dead, but otherwise things get weird.
log_debug("polymorph stat")
to_chat(src, span_warning("You can't do that in your condition."))
return
if(M.health <= 10) //We can let it undo the TF, because the person will be dead, but otherwise things get weird.
log_debug("polymorph injured")
to_chat(src, span_warning("You are too injured to transform into a beast."))
return
@@ -467,15 +463,12 @@
spawn(10)
src.overlays -= coolanimation
log_debug("polymorph not dead")
var/mob/living/new_mob = spawn_beast_mob(beast_options[chosen_beast])
new_mob.faction = M.faction
if(new_mob && isliving(new_mob))
species.lleill_energy -= energy_cost
log_debug("polymorph new_mob")
for(var/obj/belly/B as anything in new_mob.vore_organs)
log_debug("polymorph new_mob belly")
new_mob.vore_organs -= B
qdel(B)
new_mob.vore_organs = list()
@@ -489,18 +482,14 @@
M.copy_vore_prefs_to_mob(new_mob)
new_mob.vore_selected = M.vore_selected
if(ishuman(M))
log_debug("polymorph ishuman part2")
var/mob/living/carbon/human/H = M
if(ishuman(new_mob))
log_debug("polymorph ishuman(newmob)")
var/mob/living/carbon/human/N = new_mob
N.gender = H.gender
N.identifying_gender = H.identifying_gender
else
log_debug("polymorph gender else")
new_mob.gender = H.gender
else
log_debug("polymorph gender else 2")
new_mob.gender = M.gender
if(ishuman(new_mob))
var/mob/living/carbon/human/N = new_mob
@@ -528,13 +517,9 @@
/mob/living/carbon/human/proc/spawn_beast_mob(var/chosen_beast)
log_debug("polymorph proc spawn mob")
var/tf_type = chosen_beast
log_debug("polymorph [tf_type]")
if(!ispath(tf_type))
log_debug("polymorph tf_type fail")
return
log_debug("polymorph tf_type pass")
var/new_mob = new tf_type(src.loc)
return new_mob
@@ -650,18 +635,14 @@
return
var/mob/living/M = src
log_debug("polymorph start")
if(!istype(M))
log_debug("polymorph istype")
return
if(M.stat) //We can let it undo the TF, because the person will be dead, but otherwise things get weird.
log_debug("polymorph stat")
to_chat(src, span_warning("You can't do that in your condition."))
return
if(M.health <= 10) //We can let it undo the TF, because the person will be dead, but otherwise things get weird.
log_debug("polymorph injured")
to_chat(src, span_warning("You are too injured to transform into a beast."))
return
@@ -676,15 +657,12 @@
spawn(10)
src.overlays -= coolanimation
log_debug("polymorph not dead")
var/mob/living/simple_mob/new_mob = spawn_beast_mob(beast_options[chosen_beast])
new_mob.faction = M.faction
if(new_mob && isliving(new_mob))
species.lleill_energy -= energy_cost
log_debug("polymorph new_mob")
for(var/obj/belly/B as anything in new_mob.vore_organs)
log_debug("polymorph new_mob belly")
new_mob.vore_organs -= B
qdel(B)
new_mob.vore_organs = list()
@@ -701,18 +679,14 @@
M.copy_vore_prefs_to_mob(new_mob)
new_mob.vore_selected = M.vore_selected
if(ishuman(M))
log_debug("polymorph ishuman part2")
var/mob/living/carbon/human/H = M
if(ishuman(new_mob))
log_debug("polymorph ishuman(newmob)")
var/mob/living/carbon/human/N = new_mob
N.gender = H.gender
N.identifying_gender = H.identifying_gender
else
log_debug("polymorph gender else")
new_mob.gender = H.gender
else
log_debug("polymorph gender else 2")
new_mob.gender = M.gender
if(ishuman(new_mob))
var/mob/living/carbon/human/N = new_mob
@@ -490,7 +490,7 @@
var/organ_type = has_organ[organ_tag]
var/obj/item/organ/O = new organ_type(H,1)
if(organ_tag != O.organ_tag)
warning("[O.type] has a default organ tag \"[O.organ_tag]\" that differs from the species' organ tag \"[organ_tag]\". Updating organ_tag to match.")
WARNING("[O.type] has a default organ tag \"[O.organ_tag]\" that differs from the species' organ tag \"[organ_tag]\". Updating organ_tag to match.")
O.organ_tag = organ_tag
H.internal_organs_by_name[organ_tag] = O
@@ -96,7 +96,7 @@
update_icon()
if(!humanform) // If we somehow have a blob with no human, lets just clean up.
log_debug("Cleaning up blob with no prommie!")
log_runtime("Cleaning up blob with no prommie!")
qdel(src)
return
@@ -134,13 +134,13 @@
/datum/trait/positive/melee_attack
name = "Special Attack: Sharp Melee" // Trait Organization for easier browsing. TODO: Proper categorization of 'health/ability/resist/etc'
desc = "Provides sharp melee attacks that do slightly more damage."
desc = "Provides sharp melee attacks which can inflict bleeding."
cost = 1
var_changes = list("unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp))
/datum/trait/positive/melee_attack_fangs
name = "Special Attack: Sharp Melee & Numbing Fangs" // Trait Organization for easier browsing. TODO: Proper categorization of 'health/ability/resist/etc'
desc = "Provides sharp melee attacks that do slightly more damage, along with fangs that makes the person bit unable to feel their body or pain."
desc = "Provides sharp melee attacks which can inflict bleeding, along with fangs that makes the person bit unable to feel their body or pain."
cost = 2
var_changes = list("unarmed_types" = list(/datum/unarmed_attack/stomp, /datum/unarmed_attack/kick, /datum/unarmed_attack/claws, /datum/unarmed_attack/bite/sharp, /datum/unarmed_attack/bite/sharp/numbing))
+2 -2
View File
@@ -11,7 +11,7 @@
/mob/living/proc/apply_damage(var/damage = 0, var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/soaked = 0, var/sharp = FALSE, var/edge = FALSE, var/obj/used_weapon = null, var/projectile = 0)
SEND_SIGNAL(src, COMSIG_MOB_APPLY_DAMAGE, damage, damagetype, def_zone, blocked, soaked, sharp, edge, used_weapon, projectile)
if(GLOB.Debug2)
to_world_log("## DEBUG: apply_damage() was called on [src], with [damage] damage, and an armor value of [blocked].")
log_world("## DEBUG: apply_damage() was called on [src], with [damage] damage, and an armor value of [blocked].")
if(!damage || (blocked >= 100))
return 0
for(var/datum/modifier/M in modifiers) //MODIFIER STUFF. It's best to do this RIGHT before armor is calculated, so it's done here! This is the 'forcefield' defence.
@@ -144,7 +144,7 @@
/mob/living/proc/apply_effect(var/effect = 0,var/effecttype = STUN, var/blocked = 0, var/check_protection = 1)
if(GLOB.Debug2)
to_world_log("## DEBUG: apply_effect() was called. The type of effect is [effecttype]. Blocked by [blocked].")
log_world("## DEBUG: apply_effect() was called. The type of effect is [effecttype]. Blocked by [blocked].")
if(!effect || (blocked >= 100))
return 0
blocked = (100-blocked)/100
+3 -3
View File
@@ -13,7 +13,7 @@
*/
/mob/living/proc/run_armor_check(var/def_zone = null, var/attack_flag = "melee", var/armour_pen = 0, var/absorb_text = null, var/soften_text = null)
if(GLOB.Debug2)
to_world_log("## DEBUG: getarmor() was called.")
log_world("## DEBUG: getarmor() was called.")
if(armour_pen >= 100)
return 0 //might as well just skip the processing
@@ -23,7 +23,7 @@
var/armor_variance_range = round(armor * 0.25) //Armor's effectiveness has a +25%/-25% variance.
var/armor_variance = rand(-armor_variance_range, armor_variance_range) //Get a random number between -25% and +25% of the armor's base value
if(GLOB.Debug2)
to_world_log("## DEBUG: The range of armor variance is [armor_variance_range]. The variance picked by RNG is [armor_variance].")
log_world("## DEBUG: The range of armor variance is [armor_variance_range]. The variance picked by RNG is [armor_variance].")
armor = min(armor + armor_variance, 100) //Now we calcuate damage using the new armor percentage.
armor = max(armor - armour_pen, 0) //Armor pen makes armor less effective.
@@ -39,7 +39,7 @@
else
to_chat(src, span_danger("Your armor softens the blow!"))
if(GLOB.Debug2)
to_world_log("## DEBUG: Armor when [src] was attacked was [armor].")
log_world("## DEBUG: Armor when [src] was attacked was [armor].")
return armor
/*
+2 -2
View File
@@ -424,12 +424,12 @@ var/list/channel_to_radio_key = list()
blooploop(message, extrarange = -6, volume = 25, sound_preference = /datum/preference/toggle/whisper_sounds)
// playsound(T, pick(voice_sounds_list), 25, TRUE, extrarange = -6, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/preference/toggle/whisper_sounds)
log_whisper(message, src)
log_talk(message, LOG_WHISPER)
else
if(do_sound && message)
blooploop(message, volume = 75)
// playsound(T, pick(voice_sounds_list), 75, TRUE, falloff = 1 , is_global = TRUE, frequency = ourfreq, ignore_walls = FALSE, preference = /datum/preference/toggle/say_sounds)
log_say(message, src)
log_talk(message, LOG_SAY)
return 1
/*************************************************************************/
+1 -1
View File
@@ -43,7 +43,7 @@
if(!research)
if(!errored)
errored = 1
error("malf_process() called on AI without research datum. Report this.")
log_world("## ERROR malf_process() called on AI without research datum. Report this.")
message_admins("ERROR: malf_process() called on AI without research datum. If admin modified one of the AI's vars revert the change and don't modify variables directly, instead use ProcCall or admin panels.")
spawn(1200)
errored = 0
@@ -458,7 +458,7 @@
return
card.screen_msg = message
var/logmsg = "(CARD SCREEN)[message]"
log_say(logmsg,src)
log_talk(logmsg, LOG_SAY)
to_chat(src, span_filter_say(span_cult("You print a message to your screen, \"[message]\"")))
if(isliving(card.loc))
var/mob/living/L = card.loc
@@ -26,7 +26,7 @@ GLOBAL_LIST_EMPTY(default_pai_software)
var/datum/pai_software/P = new type()
if(GLOB.pai_software_by_key[P.id])
var/datum/pai_software/O = GLOB.pai_software_by_key[P.id]
to_world(span_warning("pAI software module [P.name] has the same key as [O.name]!"))
to_chat(world, span_warning("pAI software module [P.name] has the same key as [O.name]!"))
r = 0
continue
GLOB.pai_software_by_key[P.id] = P
+2 -2
View File
@@ -57,7 +57,7 @@
//For holopads only. Usable by AI.
/mob/living/silicon/ai/proc/holopad_talk(list/message_pieces, verb)
log_say("(HPAD) [multilingual_to_message(message_pieces)]",src)
log_talk("(HPAD) [multilingual_to_message(message_pieces)]", LOG_SAY)
var/obj/machinery/hologram/holopad/T = src.holo
if(T && T.masters[src])//If there is a hologram and its master is the user.
@@ -108,7 +108,7 @@
if(O)
O.see_emote(src, message)
log_emote("(HPAD) [message]", src)
log_message("(HPAD) [message]", LOG_EMOTE)
else //This shouldn't occur, but better safe then sorry.
to_chat(src, span_filter_notice("No holopad connected."))
@@ -491,7 +491,7 @@
var/mob/living/simple_mob/vore/overmap/stardog/m = s.parent
log_subtle(message,L)
L.log_message("(SUBTLE) [message]", LOG_EMOTE)
message = span_emote_subtle(span_bold("[L]") + " " + span_italics("[message]"))
message = span_bold("(From the back of \the [m]) ") + message
message = encode_html_emphasis(message)
@@ -707,7 +707,7 @@
if(!spawnstuff)
return
if(!valid_flora.len)
to_world_log("[src] does not have a set valid flora list!")
log_mapping("[src] does not have a set valid flora list!")
return TRUE
var/obj/F
@@ -723,7 +723,7 @@
if(!spawnstuff)
return
if(!valid_mobs.len)
to_world_log("[src] does not have a set valid mobs list!")
log_mapping("[src] does not have a set valid mobs list!")
return TRUE
var/mob/M
@@ -750,7 +750,7 @@
if(!spawnstuff)
return
if(!valid_mobs.len)
to_world_log("[src] does not have a set valid mobs list!")
log_mapping("[src] does not have a set valid mobs list!")
return
if(!prob(mob_chance))
@@ -769,7 +769,7 @@
if(!spawnstuff)
return
if(!valid_flora.len)
to_world_log("[src] does not have a set valid flora list!")
log_mapping("[src] does not have a set valid flora list!")
return
var/obj/F
@@ -787,7 +787,7 @@
if(treasure_chance <= 0)
return
if(!valid_treasure.len)
to_world_log("[src] does not have a set valid treasure list!")
log_mapping("[src] does not have a set valid treasure list!")
return
var/obj/F
@@ -1156,7 +1156,7 @@
to_chat(L, span_warning("You can't do that here."))
return
log_subtle(message,L)
L.log_message("(SUBTLE) [message]", LOG_EMOTE)
message = span_emote_subtle(span_bold("[L]") + " " + span_italics("[message]"))
message = span_bold("(From within \the [s]) ") + message
message = encode_html_emphasis(message)
@@ -17,7 +17,7 @@
message = sanitize(message)
if (!message)
return
log_say(message,src)
log_talk(message, LOG_SAY)
if (stat == 2)
return say_dead(message)
@@ -447,18 +447,14 @@
var/mob/living/M = src
log_debug("polymorph start")
if(!istype(M))
log_debug("polymorph istype")
return
if(M.stat) //We can let it undo the TF, because the person will be dead, but otherwise things get weird.
log_debug("polymorph stat")
to_chat(src, span_warning("You can't do that in your condition."))
return
if(M.health <= 10) //We can let it undo the TF, because the person will be dead, but otherwise things get weird.
log_debug("polymorph injured")
to_chat(src, span_warning("You are too injured to transform into a beast."))
return
@@ -473,14 +469,11 @@
spawn(10)
src.overlays -= coolanimation
log_debug("polymorph not dead")
var/mob/living/new_mob = spawn_polymorph_mob(beast_options[chosen_beast])
new_mob.faction = M.faction
if(new_mob && isliving(new_mob))
log_debug("polymorph new_mob")
for(var/obj/belly/B as anything in new_mob.vore_organs)
log_debug("polymorph new_mob belly")
new_mob.vore_organs -= B
qdel(B)
new_mob.vore_organs = list()
@@ -493,18 +486,14 @@
M.copy_vore_prefs_to_mob(new_mob)
new_mob.vore_selected = M.vore_selected
if(ishuman(M))
log_debug("polymorph ishuman part2")
var/mob/living/carbon/human/H = M
if(ishuman(new_mob))
log_debug("polymorph ishuman(newmob)")
var/mob/living/carbon/human/N = new_mob
N.gender = H.gender
N.identifying_gender = H.identifying_gender
else
log_debug("polymorph gender else")
new_mob.gender = H.gender
else
log_debug("polymorph gender else 2")
new_mob.gender = M.gender
if(ishuman(new_mob))
var/mob/living/carbon/human/N = new_mob
@@ -530,13 +519,9 @@
new_mob.visible_message("<b>\The [src]</b> has transformed into \the [chosen_beast]!")
/mob/living/proc/spawn_polymorph_mob(var/chosen_beast)
log_debug("polymorph proc spawn mob")
var/tf_type = chosen_beast
log_debug("polymorph [tf_type]")
if(!ispath(tf_type))
log_debug("polymorph tf_type fail")
return
log_debug("polymorph tf_type pass")
var/new_mob = new tf_type(get_turf(src))
return new_mob
+19 -7
View File
@@ -1,9 +1,6 @@
//handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying
/mob/proc/update_Login_details()
//Multikey checks and logging
lastKnownIP = client.address
computer_id = client.computer_id
log_access_in(client)
if(CONFIG_GET(flag/log_access))
for(var/mob/M in GLOB.player_list)
if(M == src) continue
@@ -19,15 +16,21 @@
if(matches)
if(M.client)
message_admins("[span_red(span_bold("Notice:"))] [span_blue("[key_name_admin(src)] has the same [matches] as [key_name_admin(M)].")]", 1)
log_adminwarn("Notice: [key_name(src)] has the same [matches] as [key_name(M)].")
log_admin_private("Notice: [key_name(src)] has the same [matches] as [key_name(M)].")
else
message_admins("[span_red(span_bold("Notice:"))] [span_blue("[key_name_admin(src)] has the same [matches] as [key_name_admin(M)] (no longer logged in). ")]", 1)
log_adminwarn("Notice: [key_name(src)] has the same [matches] as [key_name(M)] (no longer logged in).")
log_admin_private("Notice: [key_name(src)] has the same [matches] as [key_name(M)] (no longer logged in).")
/mob/Login()
persistent_ckey = client.ckey
if(!client)
return FALSE
client.persistent_client.set_mob(src)
GLOB.player_list |= src
lastKnownIP = client.address
computer_id = client.computer_id
log_access("Mob Login: [key_name(src)] was assigned to a [type] ([tag])")
update_Login_details()
world.update_status()
@@ -82,9 +85,18 @@
if(cloaked && cloaked_selfimage)
client.images += cloaked_selfimage
client.init_verbs()
if(client)
for(var/datum/action/A as anything in persistent_client.player_actions)
A.Grant(src)
for(var/datum/callback/CB as anything in persistent_client.post_login_callbacks)
CB.Invoke()
log_mob_tag("TAG: [tag] NEW OWNER: [key_name(src)]")
SEND_SIGNAL(src, COMSIG_MOB_CLIENT_LOGIN, client)
SEND_SIGNAL(client, COMSIG_CLIENT_MOB_LOGIN, src)
client.init_verbs()
set_listening(LISTENING_PLAYER)
GLOB.tickets.ClientLogin(client, TRUE)
+1 -1
View File
@@ -4,7 +4,7 @@
GLOB.player_list -= src
disconnect_time = world.realtime //VOREStation Addition: logging when we disappear.
update_client_z(null)
log_access_out(src)
log_access("Mob Logout: [key_name(src)]")
unset_machine()
var/datum/admins/is_admin = GLOB.admin_datums[src.ckey]
+6
View File
@@ -1,4 +1,9 @@
/mob/Destroy()//This makes sure that mobs withGLOB.clients/keys are not just deleted from the game.
if(client)
stack_trace("Mob with client has been deleted.")
persistent_client?.set_mob(null)
SSmobs.currentrun -= src
GLOB.mob_list -= src
GLOB.dead_mob_list -= src
@@ -79,6 +84,7 @@
set_focus(src) // VOREStation Add - Key Handling
update_transform() // Some mobs may start bigger or smaller than normal.
. = ..()
log_mob_tag("TAG: [tag] CREATED: [key_name(src)] \[[type]\]")
//return QDEL_HINT_HARDDEL_NOW Just keep track of mob references. They delete SO much faster now.
/mob/show_message(msg, type, alt, alt_type)
+15 -3
View File
@@ -1,3 +1,11 @@
/**
* The mob, usually meant to be a creature of some type
*
* Has a client attached that is a living person (most of the time), although I have to admit
* sometimes it's hard to tell they're sentient
*
* Has a lot of the creature game world logic, such as health etc
*/
/mob
density = TRUE
layer = MOB_LAYER
@@ -6,6 +14,10 @@
blocks_emissive = EMISSIVE_BLOCK_GENERIC
///when this be added to vis_contents of something it inherit something.plane, important for visualisation of mob in openspace.
vis_flags = VIS_INHERIT_PLANE
/// It's like a client, but persists! Persistent clients will stick to a mob until the client in question is logged into a different mob.
var/datum/persistent_client/persistent_client
var/datum/mind/mind
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
@@ -51,7 +63,10 @@
var/use_me = 1 //Allows all mobs to use the me verb by default, will have to manually specify they cannot
var/damageoverlaytemp = 0
var/computer_id = null
var/list/logging = list()
var/already_placed = 0.0
var/obj/machinery/machine = null
var/other_mobs = null
@@ -250,6 +265,3 @@
var/custom_footstep = FOOTSTEP_MOB_SHOE
VAR_PRIVATE/is_motion_tracking = FALSE // Prevent multiple unsubs and resubs, also used to check if the vis layer is enabled, use has_motiontracking() to get externally.
VAR_PRIVATE/wants_to_see_motion_echos = TRUE
/// a ckey that persists client logout / ghosting, replaced when a client inhabits the mob
var/persistent_ckey
+1 -1
View File
@@ -173,7 +173,7 @@
// We're in the middle of another move we've already decided to do
if(moving)
log_debug("Client [src] attempted to move while moving=[moving]")
// to_chat(world, "Client [src] attempted to move while moving=[moving]")
return 0
// We're still cooling down from the last move
+1 -1
View File
@@ -146,7 +146,7 @@
handle_server_news()
return TRUE
if("give_feedback")
if(!SSsqlite.can_submit_feedback(GLOB.directory[persistent_ckey]))
if(!SSsqlite.can_submit_feedback(GLOB.persistent_clients_by_ckey[ckey]))
return
if(client.feedback_form)
-3
View File
@@ -11,9 +11,6 @@
mind.active = 1
mind.current = src
if(client)
persistent_ckey = client.ckey
loc = null
sight |= SEE_TURFS
+1 -1
View File
@@ -17,6 +17,6 @@
return
/mob/new_player/proc/disable_lobby_browser()
var/client/exiting_client = GLOB.directory[persistent_ckey]
var/client/exiting_client = GLOB.persistent_clients_by_ckey[ckey]
if(exiting_client)
winset(exiting_client, "lobby_browser", "is-disabled=true;is-visible=false")
+1 -1
View File
@@ -3,7 +3,7 @@
var/datum/job/J = SSjob.get_job(rank)
if(!J)
log_debug("Couldn't find job: [rank] for spawn_checks_vr, panic-returning that it's fine to spawn.")
NOTICE("Couldn't find job: [rank] for spawn_checks_vr, panic-returning that it's fine to spawn.")
return TRUE
//No Flavor Text
+4 -4
View File
@@ -74,7 +74,7 @@
input = message
if(input)
log_subtle(message,src)
src.log_message("(SUBTLE) [message]", LOG_EMOTE)
message = span_emote_subtle(span_bold("[src]") + " " + span_italics("[input]"))
if(src.absorbed && isbelly(src.loc))
var/obj/belly/B = src.loc
@@ -357,7 +357,7 @@
G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle))
if(client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) || check_rights_for(G.client, R_HOLDER))
to_chat(G, span_psay("[formatted_name] thinks, \"[message]\""))
log_say(message,M)
M.log_talk("(PSAY) [message]", LOG_SAY)
else //There wasn't anyone to send the message to, pred or prey, so let's just say it instead and correct our psay just in case.
M.forced_psay = FALSE
M.say(message)
@@ -463,7 +463,7 @@
G.client?.prefs?.read_preference(/datum/preference/toggle/ghost_see_whisubtle))
if(client?.prefs?.read_preference(/datum/preference/toggle/whisubtle_vis) || check_rights_for(G.client, R_HOLDER))
to_chat(G, span_pemote("[formatted_name] [message]"))
log_say(message,M)
M.log_talk(message, LOG_SAY)
else //There wasn't anyone to send the message to, pred or prey, so let's just emote it instead and correct our psay just in case.
M.forced_psay = FALSE
M.me_verb(message)
@@ -510,7 +510,7 @@
if(M.stat == UNCONSCIOUS || M.sleeping > 0)
continue
to_chat(M, span_filter_say("[isobserver(M) ? "[message] ([ghost_follow_link(src, M)])" : message]"))
log_emote(message, src)
log_message(message, LOG_EMOTE)
/mob/verb/select_speech_bubble()
set name = "Select Speech Bubble"