From df26483e6761463581e3e808bf6626959ba1f505 Mon Sep 17 00:00:00 2001 From: tigercat2000 Date: Wed, 25 Apr 2018 16:35:02 -0700 Subject: [PATCH 1/2] Fix runtime logs & Remove a bunch of painful admin notifications --- code/__HELPERS/_logging.dm | 2 +- code/_onclick/item_attack.dm | 2 +- code/game/gamemodes/game_mode.dm | 3 +-- code/game/world.dm | 2 +- code/modules/martial_arts/martial.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 1 + .../mob/living/carbon/human/human_attackhand.dm | 10 ++++------ code/modules/mob/living/living_defense.dm | 2 +- code/modules/mob/mob_grab.dm | 3 ++- 9 files changed, 13 insertions(+), 14 deletions(-) diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index cbc514d7232..0ed5dd944db 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -125,7 +125,7 @@ WRITE_LOG(GLOB.world_game_log, "WORLD: [html_decode(text)][log_end]") /proc/log_runtime_txt(text) // different from /tg/'s log_runtime because our error handler has a log_runtime proc already that does other stuff - GLOB.world_runtime_log << text + WRITE_LOG(GLOB.world_runtime_log, text) /proc/log_config(text) WRITE_LOG(GLOB.config_error_log, text) diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index ab794b23b18..6a658886f83 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -66,7 +66,7 @@ user.do_attack_animation(M) M.attacked_by(src, user, def_zone) - add_attack_logs(user, M, "attacked with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])", admin_notify = (force > 0)) + add_attack_logs(user, M, "Attacked with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYPE: [uppertext(damtype)])", admin_notify = (force > 0 && damtype != STAMINA)) add_fingerprint(user) diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 76e81c234e4..1a8d8cde680 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -107,8 +107,7 @@ tries_left = 5 //reset our tries since we found a new chump //make sure we have chumps before we try misinforming them. if we don't make a note of it. if(!chumps.len) - message_admins("Game mode failed to find ANY chumps. Possible causes: no one is opposed/skeptical, or FalseIncarnate can't code.") - log_admin("Game mode failed to find ANY chumps. Possible causes: no one is opposed/skeptical, or FalseIncarnate can't code.") + log_debug("Game mode failed to find ANY chumps. This is likely due to the server being in extreme low-pop with no one set to opposed or skeptical.") return 0 //we've got chumps! misinform them! for(var/mob/living/carbon/human/chump in chumps) diff --git a/code/game/world.dm b/code/game/world.dm index f7cf1a758b7..4ebeadedc6f 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -68,7 +68,7 @@ var/world_topic_spam_protect_ip = "0.0.0.0" var/world_topic_spam_protect_time = world.timeofday /world/Topic(T, addr, master, key) - log_debug("WORLD/TOPIC: \"[T]\", from:[addr], master:[master], key:[key]") + log_misc("WORLD/TOPIC: \"[T]\", from:[addr], master:[master], key:[key]") var/list/input = params2list(T) var/key_valid = (config.comms_password && input["key"] == config.comms_password) //no password means no comms, not any password diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm index 29c6044e386..3e1be19b0de 100644 --- a/code/modules/martial_arts/martial.dm +++ b/code/modules/martial_arts/martial.dm @@ -55,7 +55,7 @@ D.apply_damage(damage, BRUTE, affecting, armor_block) - add_attack_logs(A, D, "Melee attacked with [src]") + add_attack_logs(A, D, "Melee attacked with martial-art [src]", admin_notify = (damage > 0) ? TRUE : FALSE) if((D.stat != DEAD) && damage >= A.species.punchstunthreshold) D.visible_message("[A] has weakened [D]!!", \ diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 7cdebe4502c..823ad0c58ed 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -201,6 +201,7 @@ swap_hand() /mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) + add_attack_logs(M, src, "Shaked", admin_notify = FALSE) if(src.health >= config.health_threshold_crit) if(src == M && istype(src, /mob/living/carbon/human)) var/mob/living/carbon/human/H = src diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 57be152295b..a3f153d59f1 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -19,7 +19,7 @@ ..() if((M != src) && M.a_intent != INTENT_HELP && check_shields(0, M.name, attack_type = UNARMED_ATTACK)) - add_attack_logs(M, src, "Melee attacked with fists (miss/block)") + add_attack_logs(M, src, "Melee attacked with fists (miss/block)", admin_notify = FALSE) visible_message("[M] attempted to touch [src]!") return 0 @@ -38,11 +38,9 @@ if(S.next_step(M, src)) return 1 help_shake_act(M) - add_attack_logs(M, src, "Shaked") return 1 if(health >= config.health_threshold_crit) help_shake_act(M) - add_attack_logs(M, src, "Shaked") return 1 if(!H.check_has_mouth()) to_chat(H, "You don't have a mouth, you cannot perform CPR!") @@ -107,7 +105,7 @@ var/datum/unarmed_attack/attack = M.species.unarmed M.do_attack_animation(src) - add_attack_logs(M, src, "Melee attacked with fists") + add_attack_logs(M, src, "Melee attacked with fists", admin_notify = ckey ? TRUE : FALSE) if(!iscarbon(M)) LAssailant = null @@ -146,7 +144,7 @@ if(attacker_style && attacker_style.disarm_act(H, src)) return 1 else - add_attack_logs(M, src, "Disarmed") + add_attack_logs(M, src, "Disarmed", admin_notify = FALSE) if(w_uniform) w_uniform.add_fingerprint(M) @@ -156,7 +154,7 @@ apply_effect(2, WEAKEN, run_armor_check(affecting, "melee")) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) visible_message("[M] has pushed [src]!") - add_attack_logs(M, src, "Pushed over") + add_attack_logs(M, src, "Pushed over", admin_notify = FALSE) if(!iscarbon(M)) LAssailant = null else diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index d1eeafa6b19..506b819f195 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -240,7 +240,7 @@ to_chat(user, "You already grabbed [src].") return - add_attack_logs(user, src, "Grabbed passively") + add_attack_logs(user, src, "Grabbed passively", admin_notify = FALSE) var/obj/item/grab/G = new /obj/item/grab(user, src) if(buckled) diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index 72513f57de2..1c4b0f38fbe 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -263,6 +263,7 @@ state = GRAB_AGGRESSIVE icon_state = "grabbed1" hud.icon_state = "reinforce1" + add_attack_logs(assailant, affecting, "Aggressively grabbed", admin_notify = FALSE) else if(state < GRAB_NECK) if(isslime(affecting)) to_chat(assailant, "You squeeze [affecting], but nothing interesting happens.") @@ -272,7 +273,7 @@ state = GRAB_NECK icon_state = "grabbed+1" assailant.setDir(get_dir(assailant, affecting)) - add_attack_logs(assailant, affecting, "Neck grabbed") + add_attack_logs(assailant, affecting, "Neck grabbed", admin_notify = FALSE) if(!iscarbon(assailant)) affecting.LAssailant = null else From 5fd9b421638ee5fe87645a0926709a8d9eb5b930 Mon Sep 17 00:00:00 2001 From: tigercat2000 Date: Wed, 25 Apr 2018 16:41:58 -0700 Subject: [PATCH 2/2] Revert all mob-code changes --- code/modules/mob/living/carbon/carbon.dm | 1 - .../mob/living/carbon/human/human_attackhand.dm | 10 ++++++---- code/modules/mob/living/living_defense.dm | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 823ad0c58ed..7cdebe4502c 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -201,7 +201,6 @@ swap_hand() /mob/living/carbon/proc/help_shake_act(mob/living/carbon/M) - add_attack_logs(M, src, "Shaked", admin_notify = FALSE) if(src.health >= config.health_threshold_crit) if(src == M && istype(src, /mob/living/carbon/human)) var/mob/living/carbon/human/H = src diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index a3f153d59f1..57be152295b 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -19,7 +19,7 @@ ..() if((M != src) && M.a_intent != INTENT_HELP && check_shields(0, M.name, attack_type = UNARMED_ATTACK)) - add_attack_logs(M, src, "Melee attacked with fists (miss/block)", admin_notify = FALSE) + add_attack_logs(M, src, "Melee attacked with fists (miss/block)") visible_message("[M] attempted to touch [src]!") return 0 @@ -38,9 +38,11 @@ if(S.next_step(M, src)) return 1 help_shake_act(M) + add_attack_logs(M, src, "Shaked") return 1 if(health >= config.health_threshold_crit) help_shake_act(M) + add_attack_logs(M, src, "Shaked") return 1 if(!H.check_has_mouth()) to_chat(H, "You don't have a mouth, you cannot perform CPR!") @@ -105,7 +107,7 @@ var/datum/unarmed_attack/attack = M.species.unarmed M.do_attack_animation(src) - add_attack_logs(M, src, "Melee attacked with fists", admin_notify = ckey ? TRUE : FALSE) + add_attack_logs(M, src, "Melee attacked with fists") if(!iscarbon(M)) LAssailant = null @@ -144,7 +146,7 @@ if(attacker_style && attacker_style.disarm_act(H, src)) return 1 else - add_attack_logs(M, src, "Disarmed", admin_notify = FALSE) + add_attack_logs(M, src, "Disarmed") if(w_uniform) w_uniform.add_fingerprint(M) @@ -154,7 +156,7 @@ apply_effect(2, WEAKEN, run_armor_check(affecting, "melee")) playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) visible_message("[M] has pushed [src]!") - add_attack_logs(M, src, "Pushed over", admin_notify = FALSE) + add_attack_logs(M, src, "Pushed over") if(!iscarbon(M)) LAssailant = null else diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 506b819f195..d1eeafa6b19 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -240,7 +240,7 @@ to_chat(user, "You already grabbed [src].") return - add_attack_logs(user, src, "Grabbed passively", admin_notify = FALSE) + add_attack_logs(user, src, "Grabbed passively") var/obj/item/grab/G = new /obj/item/grab(user, src) if(buckled)