Rust-G integration. Makes logging procs 2-3 times less expensive (EVEN WITH CALL OVERHEAD). tgstation/tgstation#36858

This commit is contained in:
tigercat2000
2018-04-19 15:01:46 -08:00
parent 2364b0332b
commit a2507f589d
8 changed files with 67 additions and 83 deletions
+1 -1
View File
@@ -41,7 +41,7 @@
if("hrefs") //persistant logs and stuff
if(config && config.log_hrefs)
if(GLOB.world_href_log)
src << browse(GLOB.world_href_log,"window=investigate[subject];size=800x300")
src << browse(file(GLOB.world_href_log), "window=investigate[subject];size=800x300")
else
to_chat(src, "<font color='red'>Error: admin_investigate: No href logfile found.</font>")
return
+1 -3
View File
@@ -19,15 +19,13 @@ var/list/admin_verbs_admin = list(
/client/proc/resetcolorooc, /*allows us to set a reset our ooc color*/
/client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/
/client/proc/toggle_view_range, /*changes how far we can see*/
/datum/admins/proc/view_txt_log, /*shows the server log (diary) for today*/
/datum/admins/proc/view_atk_log, /*shows the server combat-log, doesn't do anything presently*/
/client/proc/cmd_admin_pm_context, /*right-click adminPM interface*/
/client/proc/cmd_admin_pm_panel, /*admin-pm list*/
/client/proc/cmd_admin_pm_by_key_panel, /*admin-pm list by key*/
/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/getserverlog, /*allows us to fetch server logs (diary) for other days*/
/client/proc/getserverlogs, /*allows us to fetch server logs (diary) for other days*/
/client/proc/jumptocoord, /*we ghost and jump to a coordinate*/
/client/proc/Getmob, /*teleports a mob to our location*/
/client/proc/Getkey, /*teleports a mob with a certain ckey to our location*/
+15 -46
View File
@@ -15,11 +15,10 @@
//This proc allows download of past server logs saved within the data/logs/ folder.
//It works similarly to show-server-log.
/client/proc/getserverlog()
set name = ".getserverlog"
set desc = "Fetch logfiles from data/logs"
set category = null
/client/proc/getserverlogs()
set name = "Get Server Logs"
set desc = "View/retrieve logfiles."
set category = "Admin"
var/path = browse_files("data/logs/")
if(!path)
@@ -29,44 +28,14 @@
return
message_admins("[key_name_admin(src)] accessed file: [path]")
src << ftp(file(path))
to_chat(src, "Attempting to send file, this may take a fair few minutes if the file is very large.")
return
//Other log stuff put here for the sake of organisation
//Shows today's server log
/datum/admins/proc/view_txt_log()
set category = "Admin"
set name = "Show Server Log"
set desc = "Shows today's server log."
var/path = "[GLOB.log_directory]/game.log"
if( fexists(path) )
src << ftp(file(path))
else
to_chat(src, "<font color='red'>Error: view_txt_log(): File not found/Invalid path([path]).</font>")
return
feedback_add_details("admin_verb","VTL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
//Shows today's attack log
/datum/admins/proc/view_atk_log()
set category = "Admin"
set name = "Show Server Attack Log"
set desc = "Shows today's server attack log."
var/path = "[GLOB.log_directory]/attack.log"
if(fexists(path))
src << ftp(file(path))
else
to_chat(src, "<font color='red'>Error: view_atk_log(): File not found/Invalid path([path]).</font>")
return
usr << run(file(path))
feedback_add_details("admin_verb","SSAL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
switch(alert("View (in game), Open (in your system's text editor), or Download?", path, "View", "Open", "Download"))
if ("View")
src << browse("<pre style='word-wrap: break-word;'>[html_encode(file2text(file(path)))]</pre>", list2params(list("window" = "viewfile.[path]")))
if ("Open")
src << run(file(path))
if ("Download")
src << ftp(file(path))
else
return
to_chat(src, "Attempting to send [path], this may take a fair few minutes if the file is very large.")
return