mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-12 10:42:37 +00:00
* Suppresses excessive logging that results from fights in the deathmatch (#82096) ## About The Pull Request So this is a PR i have had testmerged downstream for like a month now because deathmatch SPAMS the hell out of admin logs. This makes doing admin work kinda annoying when all the useful logs are drowned out by people trying to smoke each other to death endlessly. I don't know how bad the problem is upstream, but I'd imagine TG admins would likely express the same gratitude to have less active logging in game, in the case something important happens that they need to see. This should still keep logging things to the actual log files so the logs will still exist, but this merely suppresses the massive spam of logs that admins actively see. ## Why It's Good For The Game Lets admins do their job a little bit better being able to see when things happen in the logs. Deathmatch logs can be rather disruptive towards admins. ## Changelog 🆑 SomeRandomOwl admin: Deathmatch Bombs, Smoke, and Liquid floods are now suppressed in the logs and will not actively spam admin logs. code: adds a area flag to suppress logging for floods and bombs /🆑 * Suppresses excessive logging that results from fights in the deathmatch --------- Co-authored-by: SomeRandomOwl <2568378+SomeRandomOwl@users.noreply.github.com>
85 lines
4.1 KiB
Plaintext
85 lines
4.1 KiB
Plaintext
/// Generic attack logging
|
|
/proc/log_attack(text, list/data)
|
|
logger.Log(LOG_CATEGORY_ATTACK, text, data)
|
|
|
|
/**
|
|
* Log a combat message in the attack log
|
|
*
|
|
* Arguments:
|
|
* * atom/user - argument is the actor performing the action
|
|
* * atom/target - argument is the target of the action
|
|
* * what_done - is a verb describing the action (e.g. punched, throwed, kicked, etc.)
|
|
* * atom/object - is a tool with which the action was made (usually an item)
|
|
* * addition - is any additional text, which will be appended to the rest of the log line
|
|
*/
|
|
/proc/log_combat(atom/user, atom/target, what_done, atom/object=null, addition=null)
|
|
var/ssource = key_name(user)
|
|
var/starget = key_name(target)
|
|
|
|
var/mob/living/living_target = target
|
|
var/hp = istype(living_target) ? " (NEWHP: [living_target.health]) " : ""
|
|
|
|
var/sobject = ""
|
|
if(object)
|
|
sobject = " with [object]"
|
|
var/saddition = ""
|
|
if(addition)
|
|
saddition = " [addition]"
|
|
|
|
var/postfix = "[sobject][saddition][hp]"
|
|
|
|
var/message = "[what_done] [starget][postfix]"
|
|
user.log_message(message, LOG_ATTACK, color="red")
|
|
|
|
if(user != target)
|
|
var/reverse_message = "was [what_done] by [ssource][postfix]"
|
|
target.log_message(reverse_message, LOG_VICTIM, color="orange", log_globally=FALSE)
|
|
|
|
/**
|
|
* log_wound() is for when someone is *attacked* and suffers a wound. Note that this only captures wounds from damage, so smites/forced wounds aren't logged, as well as demotions like cuts scabbing over
|
|
*
|
|
* Note that this has no info on the attack that dealt the wound: information about where damage came from isn't passed to the bodypart's damaged proc. When in doubt, check the attack log for attacks at that same time
|
|
* TODO later: Add logging for healed wounds, though that will require some rewriting of healing code to prevent admin heals from spamming the logs. Not high priority
|
|
*
|
|
* Arguments:
|
|
* * victim- The guy who got wounded
|
|
* * suffered_wound- The wound, already applied, that we're logging. It has to already be attached so we can get the limb from it
|
|
* * dealt_damage- How much damage is associated with the attack that dealt with this wound.
|
|
* * dealt_wound_bonus- The wound_bonus, if one was specified, of the wounding attack
|
|
* * dealt_bare_wound_bonus- The bare_wound_bonus, if one was specified *and applied*, of the wounding attack. Not shown if armor was present
|
|
* * base_roll- Base wounding ability of an attack is a random number from 1 to (dealt_damage ** WOUND_DAMAGE_EXPONENT). This is the number that was rolled in there, before mods
|
|
*/
|
|
/proc/log_wound(atom/victim, datum/wound/suffered_wound, dealt_damage, dealt_wound_bonus, dealt_bare_wound_bonus, base_roll)
|
|
if(QDELETED(victim) || !suffered_wound)
|
|
return
|
|
var/message = "suffered: [suffered_wound][suffered_wound.limb ? " to [suffered_wound.limb.plaintext_zone]" : null]"// maybe indicate if it's a promote/demote?
|
|
|
|
if(dealt_damage)
|
|
message += " | Damage: [dealt_damage]"
|
|
// The base roll is useful since it can show how lucky someone got with the given attack. For example, dealing a cut
|
|
if(base_roll)
|
|
message += " (rolled [base_roll]/[dealt_damage ** WOUND_DAMAGE_EXPONENT])"
|
|
|
|
if(dealt_wound_bonus)
|
|
message += " | WB: [dealt_wound_bonus]"
|
|
|
|
if(dealt_bare_wound_bonus)
|
|
message += " | BWB: [dealt_bare_wound_bonus]"
|
|
|
|
victim.log_message(message, LOG_ATTACK, color="blue")
|
|
|
|
/// Logging for bombs detonating
|
|
/proc/log_bomber(atom/user, details, atom/bomb, additional_details, message_admins = TRUE)
|
|
var/bomb_message = "[details][bomb ? " [bomb.name] at [AREACOORD(bomb)]": ""][additional_details ? " [additional_details]" : ""]."
|
|
|
|
if(user)
|
|
user.log_message(bomb_message, LOG_ATTACK) //let it go to individual logs as well as the game log
|
|
bomb_message = "[key_name(user)] at [AREACOORD(user)] [bomb_message]."
|
|
else
|
|
log_game(bomb_message)
|
|
|
|
GLOB.bombers += bomb_message
|
|
var/area/bomb_area = get_area(bomb)
|
|
if(message_admins && !(bomb_area.area_flags & QUIET_LOGS)) // Don't spam the logs with deathmatch bombs
|
|
message_admins("[user ? "[ADMIN_LOOKUPFLW(user)] at [ADMIN_VERBOSEJMP(user)] " : ""][details][bomb ? " [bomb.name] at [ADMIN_VERBOSEJMP(bomb)]": ""][additional_details ? " [additional_details]" : ""].")
|