mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-26 00:51:23 +00:00
## About The Pull Request All investigate logs start with [src], which can be any atom. So sometimes names and items get printed twice. Adds ckeys to the investigate_logs of living mobs.  ## Why It's Good For The Game Better logging, includes the ckey for living mobs in investigate logs, and fixes some investigate_death logs that weren't properly attributed to mobs. ## Changelog 🆑 Tattle admin: investigate logs include ckey of source (if applicable) /🆑 Co-authored-by: tattle <article.disaster@gmail.com>
68 lines
1.8 KiB
Plaintext
68 lines
1.8 KiB
Plaintext
/atom/proc/investigate_log(message, subject)
|
|
if(!message || !subject)
|
|
return
|
|
var/F = file("[GLOB.log_directory]/[subject].html")
|
|
var/source = "[src]"
|
|
|
|
if(isliving(src))
|
|
var/mob/living/source_mob = src
|
|
source += " ([source_mob.ckey ? source_mob.ckey : "*no key*"])"
|
|
|
|
WRITE_FILE(F, "[time_stamp()] [REF(src)] ([x],[y],[z]) || [source] [message]<br>")
|
|
|
|
/client/proc/investigate_show()
|
|
set name = "Investigate"
|
|
set category = "Admin.Game"
|
|
if(!holder)
|
|
return
|
|
|
|
var/list/investigates = list(
|
|
INVESTIGATE_ACCESSCHANGES,
|
|
INVESTIGATE_ATMOS,
|
|
INVESTIGATE_BOTANY,
|
|
INVESTIGATE_CARGO,
|
|
INVESTIGATE_CRAFTING,
|
|
INVESTIGATE_DEATHS,
|
|
INVESTIGATE_ENGINE,
|
|
INVESTIGATE_EXPERIMENTOR,
|
|
INVESTIGATE_GRAVITY,
|
|
INVESTIGATE_HALLUCINATIONS,
|
|
INVESTIGATE_HYPERTORUS,
|
|
INVESTIGATE_PORTAL,
|
|
INVESTIGATE_PRESENTS,
|
|
INVESTIGATE_RADIATION,
|
|
INVESTIGATE_RECORDS,
|
|
INVESTIGATE_RESEARCH,
|
|
INVESTIGATE_WIRES,
|
|
)
|
|
|
|
var/list/logs_present = list("notes, memos, watchlist")
|
|
var/list/logs_missing = list("---")
|
|
|
|
for(var/subject in investigates)
|
|
var/temp_file = file("[GLOB.log_directory]/[subject].html")
|
|
if(fexists(temp_file))
|
|
logs_present += subject
|
|
else
|
|
logs_missing += "[subject] (empty)"
|
|
|
|
var/list/combined = sort_list(logs_present) + sort_list(logs_missing)
|
|
|
|
var/selected = tgui_input_list(src, "Investigate what?", "Investigation", combined)
|
|
if(isnull(selected))
|
|
return
|
|
if(!(selected in combined) || selected == "---")
|
|
return
|
|
|
|
selected = replacetext(selected, " (empty)", "")
|
|
|
|
if(selected == "notes, memos, watchlist" && check_rights(R_ADMIN))
|
|
browse_messages()
|
|
return
|
|
|
|
var/F = file("[GLOB.log_directory]/[selected].html")
|
|
if(!fexists(F))
|
|
to_chat(src, span_danger("No [selected] logfile was found."), confidential = TRUE)
|
|
return
|
|
src << browse(F,"window=investigate[selected];size=800x300")
|