mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
At the moment it only logs some singularity things. Please let me know if there are any important methods of singulo-grief which I may have missed. The "Investigate" verb is available to everyone of rank "Admin observer" and upwards. Just type "Investigate" and select the subject you'd like to see logs for. Typing "Investigate singulo" will also work as a shortcut. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3679 316c924e-a436-60f5-8080-3fe189b3f50e
44 lines
1.5 KiB
Plaintext
44 lines
1.5 KiB
Plaintext
//By Carnwennan
|
|
|
|
//This system was made as an alternative to all the in-game lists and variables used to log stuff in-game.
|
|
//lists and variables are great. However, they have several major flaws:
|
|
//Firstly, they use memory. TGstation has one of the highest memory usage of all the ss13 branches.
|
|
//Secondly, they are usually stored in an object. This means that they aren't centralised. It also means that
|
|
//the data is lost when the object is deleted! This is especially annoying for things like the singulo engine!
|
|
#define INVESTIGATE_DIR "data/investigate/"
|
|
|
|
//SYSTEM
|
|
/proc/investigate_subject2file(var/subject)
|
|
switch(subject)
|
|
if("singulo")
|
|
return file("[INVESTIGATE_DIR]singulo.html")
|
|
if("silicon")
|
|
return file("[INVESTIGATE_DIR]silicon.html")
|
|
else
|
|
return
|
|
|
|
/proc/investigate_reset()
|
|
if(fdel(INVESTIGATE_DIR)) return 1
|
|
return 0
|
|
|
|
/atom/proc/investigate_log(var/message, var/subject)
|
|
if(!message) return
|
|
var/F = investigate_subject2file(subject)
|
|
if(!F) return
|
|
F << "[src] \ref[src] ([x],[y],[z]) [message]<br>"
|
|
|
|
|
|
|
|
//ADMINVERBS
|
|
/client/proc/investigate_show( subject in list("singulo","silicon") )
|
|
set name = "Investigate"
|
|
set category = "Admin"
|
|
if(!holder) return
|
|
var/F = investigate_subject2file(subject)
|
|
if(!F)
|
|
src << "<font color='red'>Error: admin_investigate: [INVESTIGATE_DIR][subject] is an invalid path or cannot be accessed.</font>"
|
|
return
|
|
src << browse(F,"window=investigate;title='investigate [subject]'")
|
|
|
|
|