From d4d179585953e44ce834c8f68313f8124657cc4f Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Tue, 17 Apr 2012 23:29:45 +0100 Subject: [PATCH] TG r3475: New Verb added for "Game Master"s: getruntimelog This verb can only be accessed by typing it in full in the input bar down the bottom of the gamescreen. HOW DO I LOG RUNTIMES? Firstly, start dreamdeamon if it isn't already running. Then select "world>Log Session" in dreamdeamon (or press the F3 key) navigate the popup window to the log/runtime/ folder from where your tgstation .dmb is located. OPTIONAL: you can select the little checkbox down the bottom to make dreamdeamon save the log everytime you start a world. Just remember to repeat these steps with a new name when you update to a new revision! Save it with the name of the revision your server uses (e.g. r3459.txt). This will allow us to gather information on bugs across multiple servers simply by logging on as a player and asking any Game Master to send us the logs. Hence making maintaining our codebase for the entire community a TONNE easier :3 If you're keeping runtime logs: Thanks for your help! ~love from #coderbus r3475 Author: elly1...@rocketmail.com Date: Today (3 hours ago) Review scores: No one has yet scored this revision. For SkyMarshal --- baystation12.dme | 1 + code/defines/global.dm | 6 ++- code/modules/admin/admin_verbs.dm | 3 +- code/modules/admin/verbs/getruntimelog.dm | 53 +++++++++++++++++++++++ 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 code/modules/admin/verbs/getruntimelog.dm diff --git a/baystation12.dme b/baystation12.dme index 0bdee3aed5..27f5b809d0 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -773,6 +773,7 @@ #include "code\modules\admin\verbs\deadsay.dm" #include "code\modules\admin\verbs\debug.dm" #include "code\modules\admin\verbs\diagnostics.dm" +#include "code\modules\admin\verbs\getruntimelog.dm" #include "code\modules\admin\verbs\gimmicks.dm" #include "code\modules\admin\verbs\mapping.dm" #include "code\modules\admin\verbs\massmodvar.dm" diff --git a/code/defines/global.dm b/code/defines/global.dm index 63a9ea0767..1c52793d5e 100644 --- a/code/defines/global.dm +++ b/code/defines/global.dm @@ -220,10 +220,14 @@ var // These are all default values that will load should the forumdbconfig.txt // file fail to read for whatever reason. - /*forumsqladdress = "localhost" +/* forumsqladdress = "localhost" forumsqlport = "3306" forumsqldb = "tgstation" forumsqllogin = "root" forumsqlpass = "" forum_activated_group = "2" forum_authenticated_group = "10"*/ + + // For FTP requests. (i.e. downloading runtime logs.) + // However it'd be ok to use for accessing attack logs and such too, which are even laggier. + fileaccess_timer = 600 //Cannot access files by ftp until the game is finished setting up and stuff. \ No newline at end of file diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 27f6476703..08eee0f3c9 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -142,6 +142,7 @@ verbs += /client/proc/callprocobj verbs += /client/proc/rnd_check_designs verbs += /client/proc/CarbonCopy + verbs += /client/proc/getruntimelog //used by coders to retrieve runtime logs if (holder.level >= 5)//Game Admin******************************************************************** verbs += /obj/admins/proc/view_txt_log @@ -438,7 +439,7 @@ verbs -= /client/proc/rnd_check_designs verbs -= /client/proc/make_tajaran verbs -= /client/proc/CarbonCopy - + verbs -= /client/proc/getruntimelog //used by coders to retrieve runtime logs return diff --git a/code/modules/admin/verbs/getruntimelog.dm b/code/modules/admin/verbs/getruntimelog.dm new file mode 100644 index 0000000000..406b3d631a --- /dev/null +++ b/code/modules/admin/verbs/getruntimelog.dm @@ -0,0 +1,53 @@ +/* + HOW DO I LOG RUNTIMES? + Firstly, start dreamdeamon if it isn't already running. Then select "world>Log Session" (or press the F3 key) + navigate the popup window to the log/runtime/ folder from where your tgstation .dmb is located. + + OPTIONAL: you can select the little checkbox down the bottom to make dreamdeamon save the log everytime you + start a world. Just remember to repeat these steps with a new name when you update to a new revision! + + Save it with the name of the revision your server uses (e.g. r3459.txt). + Coders with the Game Master rank will now be able to access any runtime logs you have archived this way! + This will allow us to gather information on bugs across multiple servers and make maintaining the TG + codebase for the entire /TG/station commuity a TONNE easier :3 Thanks for your help! +*/ +#define FTPDELAY 200 //20 second delay to prevent spam + +//This proc allows GameMasters to download txt files saved to the log/runtime/ folder on the server. +//In effect this means the server owner can log game sessions through DreamDeamon to that folder and +//Coders (with access) can download logs (old and current). +//To make life easier on everyone please name logfiles according to the revision number in use! + +//This proc has a failsafe built in to prevent spamming of ftp requests. As such it can only be used once every +//20 seconds. This can be changed by modifying FTPDELAY's value. + +//PLEASE USE RESPONSIBLY, only download from the server if the log isn't already available elsewhere! +//Bandwidth is expensive and lags are lame. Although txt files of a few kB shouldn't cause problems really ~Carn + +/client/proc/getruntimelog() + set name = "getruntimelog" + set desc = "Retrieve any session logfiles saved by dreamdeamon" + set category = "Debug" + set hidden = 1 + + if( !src.holder || holder.rank != "Game Master" ) + src << "Only Game Masters may use this command." + return + + var/time_to_wait = fileaccess_timer - world.time + if(time_to_wait > 0) + src << "Error: getruntimelog(): FTP-request spam prevention. Please wait [round(time_to_wait/10)] seconds." + return + fileaccess_timer = world.time + FTPDELAY + + var/list/list_of_runtimelogs = flist("log/runtime/") + var/choice = input(src,"Choose a runtime-log to download:","Download",null) in list_of_runtimelogs + + if(!choice || !fexists("log/runtime/[choice]")) + src << "Error: getruntimelog(): Files not found/Invalid file([choice])." + return + + src << ftp("log/runtime/[choice]") + + return +