mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-09 16:07:40 +00:00
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
//This proc allows download of past server logs saved within the data/logs/ folder.
|
|
/client/proc/getserverlogs()
|
|
set name = "Get Server Logs"
|
|
set desc = "View/retrieve logfiles."
|
|
set category = "Admin"
|
|
|
|
browseserverlogs()
|
|
|
|
/client/proc/getcurrentlogs()
|
|
set name = "Get Current Logs"
|
|
set desc = "View/retrieve logfiles for the current round."
|
|
set category = "Admin"
|
|
|
|
browseserverlogs("[GLOB.log_directory]/")
|
|
|
|
/client/proc/browseserverlogs(path = "data/logs/")
|
|
if(!check_rights(R_SENSITIVE))
|
|
return
|
|
path = browse_files(path)
|
|
if(!path)
|
|
return
|
|
|
|
if(file_spam_check())
|
|
return
|
|
|
|
message_admins("[key_name_admin(src)] accessed file: [path]")
|
|
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.", confidential = TRUE)
|
|
return
|