mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Adds missing runtime viewer Topic calls.
Relocates them to the datum itself rather than it being an admin topic for maximum self-containment. Also adds 'adminplayerobservefollow', making it possible for admins to not only jump to mobs but also follow them with a single click. Misc tweaks from Paradise.
This commit is contained in:
@@ -327,9 +327,7 @@
|
|||||||
|
|
||||||
/datum/controller/process/proc/catchException(var/exception/e, var/thrower)
|
/datum/controller/process/proc/catchException(var/exception/e, var/thrower)
|
||||||
if(istype(e)) // Real runtimes go to the real error handler
|
if(istype(e)) // Real runtimes go to the real error handler
|
||||||
// There are two newlines here, because handling desc sucks
|
log_runtime(e, thrower, "Caught by process: [name]")
|
||||||
e.desc = " Caught by process: [name]\n\n" + e.desc
|
|
||||||
world.Error(e, e_src = thrower)
|
|
||||||
return
|
return
|
||||||
var/etext = "[e]"
|
var/etext = "[e]"
|
||||||
var/eid = "[e]" // Exception ID, for tracking repeated exceptions
|
var/eid = "[e]" // Exception ID, for tracking repeated exceptions
|
||||||
|
|||||||
@@ -1176,6 +1176,18 @@
|
|||||||
sleep(2)
|
sleep(2)
|
||||||
C.jumptomob(M)
|
C.jumptomob(M)
|
||||||
|
|
||||||
|
else if(href_list["adminplayerobservefollow"])
|
||||||
|
if(!check_rights(R_MENTOR|R_MOD|R_ADMIN|R_SERVER))
|
||||||
|
return
|
||||||
|
|
||||||
|
var/mob/M = locate(href_list["adminplayerobservefollow"])
|
||||||
|
|
||||||
|
var/client/C = usr.client
|
||||||
|
if(!isobserver(usr)) C.admin_ghost()
|
||||||
|
var/mob/observer/dead/G = C.mob
|
||||||
|
sleep(2)
|
||||||
|
G.ManualFollow(M)
|
||||||
|
|
||||||
else if(href_list["check_antagonist"])
|
else if(href_list["check_antagonist"])
|
||||||
check_antagonists()
|
check_antagonists()
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ var/total_runtimes_skipped = 0
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
/world/Error(var/exception/e, var/datum/e_src)
|
/world/Error(var/exception/e, var/datum/e_src)
|
||||||
if(!istype(e)) // Something threw an unusual exception
|
if(!istype(e)) // Something threw an unusual exception
|
||||||
log_to_dd("\[[time2text(world.timeofday, "hh:mm")]] Uncaught exception: [e]")
|
log_to_dd("\[[time_stamp()]] Uncaught exception: [e]")
|
||||||
return ..()
|
return ..()
|
||||||
if(!error_last_seen) // A runtime is occurring too early in start-up initialization
|
if(!error_last_seen) // A runtime is occurring too early in start-up initialization
|
||||||
return ..()
|
return ..()
|
||||||
@@ -39,7 +39,7 @@ var/total_runtimes_skipped = 0
|
|||||||
var/skipcount = abs(error_cooldown[erroruid]) - 1
|
var/skipcount = abs(error_cooldown[erroruid]) - 1
|
||||||
error_cooldown[erroruid] = 0
|
error_cooldown[erroruid] = 0
|
||||||
if(skipcount > 0)
|
if(skipcount > 0)
|
||||||
log_to_dd("\[[time2text(world.timeofday, "hh:mm")]] Skipped [skipcount] runtimes in [e.file],[e.line].")
|
log_to_dd("\[[time_stamp()]] Skipped [skipcount] runtimes in [e.file],[e.line].")
|
||||||
error_cache.logError(e, skipCount = skipcount)
|
error_cache.logError(e, skipCount = skipcount)
|
||||||
error_last_seen[erroruid] = world.time
|
error_last_seen[erroruid] = world.time
|
||||||
error_cooldown[erroruid] = cooldown
|
error_cooldown[erroruid] = cooldown
|
||||||
@@ -95,10 +95,24 @@ var/total_runtimes_skipped = 0
|
|||||||
desclines += " (This error will now be silenced for [ERROR_SILENCE_TIME / 600] minutes)"
|
desclines += " (This error will now be silenced for [ERROR_SILENCE_TIME / 600] minutes)"
|
||||||
|
|
||||||
// Now to actually output the error info...
|
// Now to actually output the error info...
|
||||||
log_to_dd("\[[time2text(world.timeofday, "hh:mm")]] Runtime in [e.file],[e.line]: [e]")
|
log_to_dd("\[[time_stamp()]] Runtime in [e.file],[e.line]: [e]")
|
||||||
for(var/line in desclines)
|
for(var/line in desclines)
|
||||||
log_to_dd(line)
|
log_to_dd(line)
|
||||||
if(error_cache)
|
if(error_cache)
|
||||||
error_cache.logError(e, desclines, e_src = e_src)
|
error_cache.logError(e, desclines, e_src = e_src)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/proc/log_runtime(exception/e, datum/e_src, extra_info)
|
||||||
|
if(!istype(e))
|
||||||
|
world.Error(e, e_src)
|
||||||
|
return
|
||||||
|
|
||||||
|
if(extra_info)
|
||||||
|
// Adding extra info adds two newlines, because parsing runtimes is funky
|
||||||
|
if(islist(extra_info))
|
||||||
|
e.desc = " [jointext(extra_info, "\n ")]\n\n" + e.desc
|
||||||
|
else
|
||||||
|
e.desc = " [extra_info]\n\n" + e.desc
|
||||||
|
|
||||||
|
world.Error(e, e_src)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ var/global/datum/ErrorViewer/ErrorCache/error_cache = new()
|
|||||||
var/global/datum/ErrorViewer/ErrorCache/error_cache = null
|
var/global/datum/ErrorViewer/ErrorCache/error_cache = null
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// - ErrorSource datums exist for each line (of code) that generates an error,
|
// - ErrorSource datums exist for each line (of code) that generates an error,
|
||||||
// and keep track of all errors generated by that line.
|
// and keep track of all errors generated by that line.
|
||||||
//
|
//
|
||||||
// - ErrorEntry datums exist for each logged error, and keep track of all
|
// - ErrorEntry datums exist for each logged error, and keep track of all
|
||||||
@@ -71,7 +71,15 @@ var/global/datum/ErrorViewer/ErrorCache/error_cache = null
|
|||||||
back_to_param = ";viewruntime_backto=\ref[back_to]"
|
back_to_param = ";viewruntime_backto=\ref[back_to]"
|
||||||
if(linear)
|
if(linear)
|
||||||
back_to_param += ";viewruntime_linear=1"
|
back_to_param += ";viewruntime_linear=1"
|
||||||
return "<A HREF='?_src_=holder;viewruntime=\ref[src][back_to_param]'>[html_encode(linktext)]</A>"
|
return "<A HREF='?src=\ref[src];viewruntime=\ref[src][back_to_param]'>[html_encode(linktext)]</A>"
|
||||||
|
|
||||||
|
/datum/ErrorViewer/Topic(href, href_list)
|
||||||
|
if(..())
|
||||||
|
return 1
|
||||||
|
if(href_list["viewruntime_backto"])
|
||||||
|
showTo(usr, locate(href_list["viewruntime_backto"]), href_list["viewruntime_linear"])
|
||||||
|
else
|
||||||
|
showTo(usr, null, href_list["viewruntime_linear"])
|
||||||
|
|
||||||
/datum/ErrorViewer/ErrorCache
|
/datum/ErrorViewer/ErrorCache
|
||||||
var/list/errors = list()
|
var/list/errors = list()
|
||||||
|
|||||||
Reference in New Issue
Block a user