mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Ports World Server Dialogue/Attack Log Viewer
This commit is contained in:
committed by
VirgoBot
parent
c102f73df6
commit
3622a2fd2a
@@ -1,6 +1,7 @@
|
||||
/mob/var/lastattacker = null
|
||||
/mob/var/lastattacked = null
|
||||
/mob/var/attack_log = list( )
|
||||
/mob/var/dialogue_log = list( )
|
||||
|
||||
proc/log_and_message_admins(var/message as text, var/mob/user = usr)
|
||||
log_admin(user ? "[key_name(user)] [message]" : "EVENT [message]")
|
||||
|
||||
62
code/modules/admin/admin_tools.dm
Normal file
62
code/modules/admin/admin_tools.dm
Normal file
@@ -0,0 +1,62 @@
|
||||
/client/proc/cmd_admin_check_player_logs(mob/living/M as mob in mob_list)
|
||||
set category = "Admin"
|
||||
set name = "Check Player Attack Logs"
|
||||
set desc = "Check a player's attack logs."
|
||||
|
||||
//Views specific attack logs belonging to one player.
|
||||
var/dat = "<B>[M]'s Attack Log:<HR></B>"
|
||||
dat += "<b>Viewing attack logs of [M]</b> - (Played by ([key_name(M)]).<br>"
|
||||
if(M.mind)
|
||||
dat += "<b>Current Antag?:</b> [(M.mind.special_role)?"Yes":"No"]<br>"
|
||||
dat += "<br><b>Note:</b> This is arranged from earliest to latest. <br><br>"
|
||||
|
||||
|
||||
if(!isemptylist(M.attack_log))
|
||||
dat += "<fieldset style='border: 2px solid white; display: inline'>"
|
||||
for(var/l in M.attack_log)
|
||||
dat += "[l]<br>"
|
||||
|
||||
dat += "</fieldset>"
|
||||
|
||||
else
|
||||
dat += "<i>No attack logs found for [M].</i>"
|
||||
|
||||
var/datum/browser/popup = new(usr, "admin_attack_log", "[src]", 650, 650, src)
|
||||
popup.set_content(jointext(dat,null))
|
||||
popup.open()
|
||||
|
||||
onclose(usr, "admin_attack_log")
|
||||
|
||||
feedback_add_details("admin_verb","PL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_admin_check_dialogue_logs(mob/living/M as mob in mob_list)
|
||||
set category = "Admin"
|
||||
set name = "Check Player Dialogue Logs"
|
||||
set desc = "Check a player's dialogue logs."
|
||||
|
||||
//Views specific dialogue logs belonging to one player.
|
||||
var/dat = "<B>[M]'s Dialogue Log:<HR></B>"
|
||||
dat += "<b>Viewing say and emote logs of [M]</b> - (Played by ([key_name(M)]).<br>"
|
||||
if(M.mind)
|
||||
dat += "<b>Current Antag?:</b> [(M.mind.special_role)?"Yes":"No"]<br>"
|
||||
dat += "<br><b>Note:</b> This is arranged from earliest to latest. <br><br>"
|
||||
|
||||
if(!isemptylist(M.dialogue_log))
|
||||
dat += "<fieldset style='border: 2px solid white; display: inline'>"
|
||||
|
||||
for(var/d in M.dialogue_log)
|
||||
dat += "[d]<br>"
|
||||
|
||||
dat += "</fieldset>"
|
||||
else
|
||||
dat += "<i>No dialogue logs found for [M].</i>"
|
||||
var/datum/browser/popup = new(usr, "admin_dialogue_log", "[src]", 650, 650, src)
|
||||
popup.set_content(jointext(dat,null))
|
||||
popup.open()
|
||||
|
||||
onclose(usr, "admin_dialogue_log")
|
||||
|
||||
|
||||
feedback_add_details("admin_verb","PDL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/cmd_admin_subtle_message, //send an message to somebody as a 'voice in their head',
|
||||
/client/proc/cmd_admin_delete, //delete an instance/object/mob/etc,
|
||||
/client/proc/cmd_admin_check_contents, //displays the contents of an instance,
|
||||
/client/proc/cmd_admin_check_player_logs, //checks a player's attack logs,
|
||||
/client/proc/cmd_admin_check_dialogue_logs, //checks a player's dialogue logs,
|
||||
/datum/admins/proc/access_news_network, //allows access of newscasters,
|
||||
/client/proc/giveruntimelog, //allows us to give access to runtime logs to somebody,
|
||||
/client/proc/getserverlog, //allows us to fetch server logs (diary) for other days,
|
||||
@@ -267,6 +269,8 @@ var/list/admin_verbs_hideable = list(
|
||||
/datum/admins/proc/view_atk_log,
|
||||
/client/proc/cmd_admin_subtle_message,
|
||||
/client/proc/cmd_admin_check_contents,
|
||||
/client/proc/cmd_admin_check_player_logs,
|
||||
/client/proc/cmd_admin_check_dialogue_logs,
|
||||
/datum/admins/proc/access_news_network,
|
||||
/client/proc/admin_call_shuttle,
|
||||
/client/proc/admin_cancel_shuttle,
|
||||
|
||||
@@ -10,4 +10,35 @@
|
||||
dat += "<li>[l]</li>"
|
||||
if(!admin_log.len)
|
||||
dat += "No-one has done anything this round!"
|
||||
user << browse(dat, "window=admin_log")
|
||||
|
||||
var/datum/browser/popup = new(user, "adminlogs", "[src]", 550, 650, src)
|
||||
popup.set_content(jointext(dat,null))
|
||||
popup.open()
|
||||
|
||||
onclose(user, "adminlogs")
|
||||
|
||||
|
||||
/datum/admin_secret_item/admin_secret/round_logs
|
||||
name = "Round Dialogue Logs"
|
||||
|
||||
/datum/admin_secret_item/admin_secret/round_logs/execute(var/mob/user)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
var/dat = "<B>Dialogue Log<HR></B>"
|
||||
|
||||
dat += "<fieldset style='border: 2px solid white; display: inline'>"
|
||||
|
||||
for(var/l in GLOB.round_text_log)
|
||||
dat += "<li>[l]</li>"
|
||||
|
||||
dat += "</fieldset>"
|
||||
|
||||
if(!GLOB.round_text_log)
|
||||
dat += "No-one has said anything this round! (How odd?)"
|
||||
|
||||
var/datum/browser/popup = new(user, "dialoguelogs", "[src]", 550, 650, src)
|
||||
popup.set_content(jointext(dat,null))
|
||||
popup.open()
|
||||
|
||||
onclose(user, "dialoguelogs")
|
||||
|
||||
Reference in New Issue
Block a user