Fixes #8954 - splits 'attack log' preference, spam-be-gone (#8992)

* Fixes #8954

* projectile reagetns

* removes all attack logs on keyless simple_animals even by keyed mobs

* deletes 'potentially'

* Tiger request

* more comprehensive solution

* check for mob

* istype

* brevity

* Split attack logs preference

* toggle

* deletes old CHAT_ATTACKLOGS

* explains what levels do when toggling them

* clarification

* Tigercat requests
This commit is contained in:
Kyep
2018-06-13 16:55:21 -07:00
committed by tigercat2000
parent 8c43e80657
commit 412341439a
39 changed files with 118 additions and 65 deletions
+7 -5
View File
@@ -9,15 +9,17 @@ var/global/nologevent = 0
if(C.prefs && !(C.prefs.toggles & CHAT_NO_ADMINLOGS))
to_chat(C, msg)
/proc/msg_admin_attack(var/text) //Toggleable Attack Messages
/proc/msg_admin_attack(var/text, var/loglevel)
if(!nologevent)
var/rendered = "<span class=\"admin\"><span class=\"prefix\">ATTACK:</span> <span class=\"message\">[text]</span></span>"
for(var/client/C in admins)
if(R_ADMIN & C.holder.rights)
if(C.prefs.toggles & CHAT_ATTACKLOGS)
if(!istype(C, /mob/living))
var/msg = rendered
to_chat(C, msg)
if(C.prefs.atklog == ATKLOG_NONE)
continue
var/msg = rendered
if(C.prefs.atklog <= loglevel)
to_chat(C, msg)
/proc/message_adminTicket(var/msg)
msg = "<span class='adminticket'><span class='prefix'>ADMIN TICKET:</span> [msg]</span>"
+20 -5
View File
@@ -902,12 +902,27 @@ var/list/admin_verbs_ticket = list(
if(!check_rights(R_ADMIN))
return
prefs.toggles ^= CHAT_ATTACKLOGS
prefs.save_preferences(src)
if(prefs.toggles & CHAT_ATTACKLOGS)
to_chat(usr, "You now will get attack log messages")
if(prefs.atklog == ATKLOG_ALL)
prefs.atklog = ATKLOG_ALMOSTALL
to_chat(usr, "Your attack logs preference is now: show ALMOST ALL attack logs (notable exceptions: NPCs attacking other NPCs, vampire bites, equipping/stripping, people pushing each other over)")
else if(prefs.atklog == ATKLOG_ALMOSTALL)
prefs.atklog = ATKLOG_MOST
to_chat(usr, "Your attack logs preference is now: show MOST attack logs (like ALMOST ALL, except that it also hides attacks by players on NPCs)")
else if(prefs.atklog == ATKLOG_MOST)
prefs.atklog = ATKLOG_FEW
to_chat(usr, "Your attack logs preference is now: show FEW attack logs (only the most important stuff: attacks on SSDs, use of explosives, messing with the engine, gibbing, AI wiping, forcefeeding, acid sprays, and organ extraction)")
else if(prefs.atklog == ATKLOG_FEW)
prefs.atklog = ATKLOG_NONE
to_chat(usr, "Your attack logs preference is now: show NO attack logs")
else if(prefs.atklog == ATKLOG_NONE)
prefs.atklog = ATKLOG_ALL
to_chat(usr, "Your attack logs preference is now: show ALL attack logs")
else
to_chat(usr, "You now won't get attack log messages")
prefs.atklog = ATKLOG_ALL
to_chat(usr, "Your attack logs preference is now: show ALL attack logs (your preference was set to an invalid value, it has been reset)")
prefs.save_preferences(src)
/client/proc/toggleadminlogs()
set name = "Toggle Admin Log Messages"
+1 -1
View File
@@ -46,7 +46,7 @@
if(!status)
status = 1
investigate_log("[key_name(user)] welded a single tank bomb. Temperature: [bombtank.air_contents.temperature-T0C]", INVESTIGATE_BOMB)
msg_admin_attack("[key_name_admin(user)] welded a single tank bomb. Temperature: [bombtank.air_contents.temperature-T0C]")
msg_admin_attack("[key_name_admin(user)] welded a single tank bomb. Temperature: [bombtank.air_contents.temperature-T0C]", ATKLOG_FEW)
log_game("[key_name(user)] welded a single tank bomb. Temperature: [bombtank.air_contents.temperature - T0C]")
to_chat(user, "<span class='notice'>A pressure hole has been bored to [bombtank] valve. \The [bombtank] can now be ignited.</span>")
else
@@ -90,6 +90,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/UI_style_alpha = 255
var/windowflashing = TRUE
var/clientfps = 0
var/atklog = ATKLOG_ALL
//ghostly preferences
var/ghost_anonsay = 0
@@ -17,7 +17,8 @@
windowflashing,
ghost_anonsay,
exp,
clientfps
clientfps,
atklog
FROM [format_table_name("player")]
WHERE ckey='[C.ckey]'"}
)
@@ -48,6 +49,7 @@
ghost_anonsay = text2num(query.item[15])
exp = query.item[16]
clientfps = text2num(query.item[17])
atklog = text2num(query.item[18])
//Sanitize
ooccolor = sanitize_hexcolor(ooccolor, initial(ooccolor))
@@ -66,6 +68,7 @@
ghost_anonsay = sanitize_integer(ghost_anonsay, 0, 1, initial(ghost_anonsay))
exp = sanitize_text(exp, initial(exp))
clientfps = sanitize_integer(clientfps, 0, 1000, initial(clientfps))
atklog = sanitize_integer(atklog, 0, 100, initial(atklog))
return 1
/datum/preferences/proc/save_preferences(client/C)
@@ -85,6 +88,7 @@
be_role='[sanitizeSQL(list2params(be_special))]',
default_slot='[default_slot]',
toggles='[toggles]',
atklog='[atklog]',
sound='[sound]',
randomslot='[randomslot]',
volume='[volume]',
@@ -93,7 +97,8 @@
lastchangelog='[lastchangelog]',
windowflashing='[windowflashing]',
ghost_anonsay='[ghost_anonsay]',
clientfps='[clientfps]'
clientfps='[clientfps]',
atklog='[atklog]'
WHERE ckey='[C.ckey]'"}
)
@@ -260,7 +260,7 @@
new /obj/effect/decal/cleanable/blood/gibs(src)
if(!UserOverride)
add_attack_logs(user, occupant, "Gibbed in [src]", !!occupant.ckey)
add_attack_logs(user, occupant, "Gibbed in [src]", !!occupant.ckey ? ATKLOG_FEW : ATKLOG_ALL)
if(!iscarbon(user))
occupant.LAssailant = null
+1 -1
View File
@@ -60,7 +60,7 @@
D.apply_damage(damage, BRUTE, affecting, armor_block)
add_attack_logs(A, D, "Melee attacked with martial-art [src]", admin_notify = (damage > 0) ? TRUE : FALSE)
add_attack_logs(A, D, "Melee attacked with martial-art [src]", (damage > 0) ? null : ATKLOG_ALL)
if((D.stat != DEAD) && damage >= A.species.punchstunthreshold)
D.visible_message("<span class='danger'>[A] has weakened [D]!!</span>", \
@@ -35,7 +35,7 @@ In all, this is a lot like the monkey code. /N
visible_message("<span class='danger'>[M.name] bites [src]!</span>", \
"<span class='userdanger'>[M.name] bites [src]!</span>")
adjustBruteLoss(damage)
add_attack_logs(M, src, "Alien attack", FALSE)
add_attack_logs(M, src, "Alien attack", ATKLOG_ALL)
updatehealth()
else
to_chat(M, "<span class='warning'>[name] is too injured for that.</span>")
+2 -2
View File
@@ -201,7 +201,7 @@
swap_hand()
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
add_attack_logs(M, src, "Shaked", admin_notify = FALSE)
add_attack_logs(M, src, "Shaked", ATKLOG_ALL)
if(health >= config.health_threshold_crit)
if(src == M && ishuman(src))
var/mob/living/carbon/human/H = src
@@ -1015,7 +1015,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
return 1
/mob/living/carbon/proc/forceFedAttackLog(var/obj/item/reagent_containers/food/toEat, mob/user)
add_attack_logs(user, src, "Fed [toEat]. Reagents: [toEat.reagentlist(toEat)]")
add_attack_logs(user, src, "Fed [toEat]. Reagents: [toEat.reagentlist(toEat)]", ATKLOG_FEW)
if(!iscarbon(user))
LAssailant = null
else
@@ -651,12 +651,12 @@
unEquip(pocket_item)
if(thief_mode)
usr.put_in_hands(pocket_item)
add_attack_logs(usr, src, "Stripped of [pocket_item]", isLivingSSD(src))
add_attack_logs(usr, src, "Stripped of [pocket_item]", isLivingSSD(src) ? null : ATKLOG_ALL)
else
if(place_item)
usr.unEquip(place_item)
equip_to_slot_if_possible(place_item, pocket_id, 0, 1)
add_attack_logs(usr, src, "Equipped with [pocket_item]", isLivingSSD(src))
add_attack_logs(usr, src, "Equipped with [pocket_item]", isLivingSSD(src) ? null : ATKLOG_ALL)
// Update strip window
if(usr.machine == src && in_range(src, usr))
@@ -665,7 +665,7 @@
// Display a warning if the user mocks up if they don't have pickpocket gloves.
if(!thief_mode)
to_chat(src, "<span class='warning'>You feel your [pocket_side] pocket being fumbled with!</span>")
add_attack_logs(usr, src, "Attempted strip of [pocket_item]", isLivingSSD(src))
add_attack_logs(usr, src, "Attempted strip of [pocket_item]", isLivingSSD(src) ? null : ATKLOG_ALL)
if(href_list["set_sensor"])
if(istype(w_uniform, /obj/item/clothing/under))
@@ -680,7 +680,7 @@
"<span class='danger'>You have dislodged everything from [src]'s headpocket!</span>")
var/obj/item/organ/internal/headpocket/C = get_int_organ(/obj/item/organ/internal/headpocket)
C.empty_contents()
add_attack_logs(usr, src, "Stripped of headpocket items", isLivingSSD(src))
add_attack_logs(usr, src, "Stripped of headpocket items", isLivingSSD(src) ? null : ATKLOG_ALL)
if(href_list["strip_accessory"])
if(istype(w_uniform, /obj/item/clothing/under))
@@ -1762,7 +1762,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X
to_chat(H, "<span class='notice'>You feel a breath of fresh air enter your lungs. It feels good.</span>")
to_chat(src, "<span class='alert'>Repeat at least every 7 seconds.")
add_attack_logs(src, H, "CPRed", FALSE)
add_attack_logs(src, H, "CPRed", ATKLOG_ALL)
return 1
else
to_chat(src, "<span class='danger'>You need to stay still while performing CPR!</span>")
@@ -357,7 +357,7 @@
var/datum/unarmed_attack/attack = user.species.unarmed
user.do_attack_animation(target, attack.animation_type)
add_attack_logs(user, target, "Melee attacked with fists", admin_notify = target.ckey ? TRUE : FALSE)
add_attack_logs(user, target, "Melee attacked with fists", target.ckey ? null : ATKLOG_ALL)
if(!iscarbon(user))
target.LAssailant = null
@@ -392,7 +392,7 @@
if(attacker_style && attacker_style.disarm_act(user, target))
return 1
else
add_attack_logs(user, target, "Disarmed", admin_notify = FALSE)
add_attack_logs(user, target, "Disarmed", ATKLOG_ALL)
user.do_attack_animation(target, ATTACK_EFFECT_DISARM)
if(target.w_uniform)
target.w_uniform.add_fingerprint(user)
@@ -402,7 +402,7 @@
target.apply_effect(2, WEAKEN, target.run_armor_check(affecting, "melee"))
playsound(target.loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
target.visible_message("<span class='danger'>[user] has pushed [target]!</span>")
add_attack_logs(user, target, "Pushed over", admin_notify = FALSE)
add_attack_logs(user, target, "Pushed over", ATKLOG_ALL)
if(!iscarbon(user))
target.LAssailant = null
else
+2 -3
View File
@@ -818,7 +818,7 @@
who.unEquip(what)
if(silent)
put_in_hands(what)
add_attack_logs(src, who, "Stripped of [what]", isLivingSSD(who))
add_attack_logs(src, who, "Stripped of [what]")
// The src mob is trying to place an item on someone
// Override if a certain mob should be behave differently when placing items (can't, for example)
@@ -837,8 +837,7 @@
if(what && Adjacent(who))
unEquip(what)
who.equip_to_slot_if_possible(what, where, 0, 1)
add_attack_logs(src, who, "Equipped [what]", isLivingSSD(who))
add_attack_logs(src, who, "Equipped [what]")
/mob/living/singularity_act()
var/gain = 20
+2 -2
View File
@@ -129,7 +129,7 @@
add_attack_logs(M.occupant, src, "Mecha-meleed with [M]")
else
step_away(src,M)
add_attack_logs(M.occupant, src, "Mecha-pushed with [M]", FALSE)
add_attack_logs(M.occupant, src, "Mecha-pushed with [M]", ATKLOG_ALL)
M.occupant_message("<span class='warning'>You push [src] out of the way.</span>")
visible_message("<span class='warning'>[M] pushes [src] out of the way.</span>")
return
@@ -240,7 +240,7 @@
to_chat(user, "<span class='notice'>You already grabbed [src].</span>")
return
add_attack_logs(user, src, "Grabbed passively", admin_notify = FALSE)
add_attack_logs(user, src, "Grabbed passively", ATKLOG_ALL)
var/obj/item/grab/G = new /obj/item/grab(user, src)
if(buckled)
@@ -276,7 +276,7 @@
return
apply_damage(M.melee_damage_upper, BRUTE)
visible_message("<span class='danger'>[M] has [M.attacktext] [src]!</span>")
add_attack_logs(M, src, "Animal attacked", FALSE)
add_attack_logs(M, src, "Animal attacked", ATKLOG_ALL)
if(prob(10))
new /obj/effect/decal/cleanable/blood/oil(loc)
+2 -2
View File
@@ -263,7 +263,7 @@
state = GRAB_AGGRESSIVE
icon_state = "grabbed1"
hud.icon_state = "reinforce1"
add_attack_logs(assailant, affecting, "Aggressively grabbed", admin_notify = FALSE)
add_attack_logs(assailant, affecting, "Aggressively grabbed", ATKLOG_ALL)
else if(state < GRAB_NECK)
if(isslime(affecting))
to_chat(assailant, "<span class='notice'>You squeeze [affecting], but nothing interesting happens.</span>")
@@ -273,7 +273,7 @@
state = GRAB_NECK
icon_state = "grabbed+1"
assailant.setDir(get_dir(assailant, affecting))
add_attack_logs(assailant, affecting, "Neck grabbed", admin_notify = FALSE)
add_attack_logs(assailant, affecting, "Neck grabbed", ATKLOG_ALL)
if(!iscarbon(assailant))
affecting.LAssailant = null
else
+1 -1
View File
@@ -121,7 +121,7 @@
if(radio_controller)
radio_controller.remove_object(src, frequency)
radio_connection = null
msg_admin_attack("Emitter deleted at ([x],[y],[z] - [ADMIN_JMP(src)])", 0, 1)
msg_admin_attack("Emitter deleted at ([x],[y],[z] - [ADMIN_JMP(src)])", ATKLOG_FEW)
log_game("Emitter deleted at ([x],[y],[z])")
investigate_log("<font color='red'>deleted</font> at ([x],[y],[z])","singulo")
return ..()
@@ -227,7 +227,7 @@
active = !active
investigate_log("turned [active?"<font color='red'>ON</font>":"<font color='green'>OFF</font>"] by [usr ? usr.key : "outside forces"]","singulo")
if(active)
msg_admin_attack("PA Control Computer turned ON by [key_name_admin(usr)]",0,1)
msg_admin_attack("PA Control Computer turned ON by [key_name_admin(usr)]", ATKLOG_FEW)
log_game("PA Control Computer turned ON by [key_name(usr)] in ([x],[y],[z])")
use_log += text("\[[time_stamp()]\] <font color='red'>[key_name(usr)] has turned on the PA Control Computer.</font>")
if(active)
+2 -1
View File
@@ -178,7 +178,8 @@
else
M.LAssailant = user
add_attack_logs(user, M, "Shot with dartgun containing [R]", !!M.ckey)
add_attack_logs(user, M, "Shot with dartgun containing [R]")
if(D.reagents)
D.reagents.trans_to(M, 15)
to_chat(M, "<span class='danger'>You feel a slight prick.</span>")
+6 -1
View File
@@ -114,13 +114,18 @@
"<span class='userdanger'>[L] is hit by \a [src][organ_hit_text]!</span>") //X has fired Y is now given by the guns so you cant tell who shot you if you could not see the shooter
var/reagent_note
var/has_reagents = FALSE
if(reagents && reagents.reagent_list)
reagent_note = " REAGENTS:"
for(var/datum/reagent/R in reagents.reagent_list)
reagent_note += R.id + " ("
reagent_note += num2text(R.volume) + ") "
has_reagents = TRUE
if(!log_override && firer && original)
add_attack_logs(firer, L, "Shot with a [type] (potentially containing [reagent_note])")
if(has_reagents)
add_attack_logs(firer, L, "Shot with a [type] (containing [reagent_note])")
else
add_attack_logs(firer, L, "Shot with a [type]")
return L.apply_effects(stun, weaken, paralyze, irradiate, slur, stutter, eyeblur, drowsy, blocked, stamina, jitter)
/obj/item/projectile/proc/get_splatter_blockage(var/turf/step_over, var/atom/target, var/splatter_dir, var/target_loca) //Check whether the place we want to splatter blood is blocked (i.e. by windows).
@@ -85,7 +85,7 @@
var/datum/reagent/injected = chemical_reagents_list[reagent_ids[mode]]
var/contained = injected.name
var/trans = R.trans_to(M, amount_per_transfer_from_this)
add_attack_logs(M, user, "Injected with [name] containing [contained], transfered [trans] units", !!M.ckey)
add_attack_logs(M, user, "Injected with [name] containing [contained], transfered [trans] units")
M.LAssailant = user
to_chat(user, "<span class='notice'>[trans] units injected. [R.total_volume] units remaining.</span>")
return
@@ -83,7 +83,7 @@
for(var/datum/reagent/R in reagents.reagent_list)
injected += R.name
var/contained = english_list(injected)
add_attack_logs(M, user, "Splashed with [name] containing [contained]", !!M.ckey)
add_attack_logs(M, user, "Splashed with [name] containing [contained]", !!M.ckey ? null : ATKLOG_ALL)
if(!iscarbon(user))
M.LAssailant = null
else
@@ -49,10 +49,10 @@
user.newtonian_move(get_dir(A, user))
if(reagents.has_reagent("sacid"))
msg_admin_attack("[key_name_admin(user)] fired sulphuric acid from \a [src] at [COORD(user)].")
msg_admin_attack("[key_name_admin(user)] fired sulphuric acid from \a [src] at [COORD(user)].", ATKLOG_FEW)
log_game("[key_name(user)] fired sulphuric acid from \a [src] at [COORD(user)].")
if(reagents.has_reagent("facid"))
msg_admin_attack("[key_name_admin(user)] fired fluorosulfuric acid from \a [src] at [COORD(user)].")
msg_admin_attack("[key_name_admin(user)] fired fluorosulfuric acid from \a [src] at [COORD(user)].", ATKLOG_FEW)
log_game("[key_name(user)] fired fluorosulfuric Acid from \a [src] at [COORD(user)].")
if(reagents.has_reagent("lube"))
msg_admin_attack("[key_name_admin(user)] fired space lube from \a [src] at [COORD(user)].")
+1 -1
View File
@@ -131,7 +131,7 @@
var/obj/item/assembly_holder/H = I
if(istype(H.a_left, /obj/item/assembly/igniter) || istype(H.a_right, /obj/item/assembly/igniter))
msg_admin_attack("[key_name_admin(user)] rigged [src.name] with [I.name] for explosion (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")
msg_admin_attack("[key_name_admin(user)] rigged [src.name] with [I.name] for explosion (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)", ATKLOG_FEW)
log_game("[key_name(user)] rigged [src.name] with [I.name] for explosion at [COORD(loc)]")
investigate_log("[key_name(user)] rigged [src.name] with [I.name] for explosion at [COORD(loc)]", INVESTIGATE_BOMB)
+2 -2
View File
@@ -133,7 +133,7 @@
for(var/mob/C in viewers(src))
C.show_message("<span class='warning'>[GM.name] has been placed in the [src] by [user].</span>", 3)
qdel(G)
add_attack_logs(usr, GM, "Disposal'ed", !!GM.ckey)
add_attack_logs(usr, GM, "Disposal'ed", !!GM.ckey ? null : ATKLOG_ALL)
return
if(!I)
@@ -179,7 +179,7 @@
msg = "[user.name] stuffs [target.name] into the [src]!"
to_chat(user, "You stuff [target.name] into the [src]!")
add_attack_logs(user, target, "Disposal'ed", !!target.ckey)
add_attack_logs(user, target, "Disposal'ed", !!target.ckey ? null : ATKLOG_ALL)
else
return
target.forceMove(src)
+1 -1
View File
@@ -307,7 +307,7 @@
processing_objects |= src
if(owner && vital && is_primary_organ()) // I'd do another check for species or whatever so that you couldn't "kill" an IPC by removing a human head from them, but it doesn't matter since they'll come right back from the dead
add_attack_logs(user, owner, "Removed vital organ ([src])", !!user)
add_attack_logs(user, owner, "Removed vital organ ([src])", !!user ? ATKLOG_FEW : ATKLOG_ALL)
owner.death()
owner = null
return src