- Status query now also replies with the map name.

This commit is contained in:
errorage
2013-11-10 01:32:01 +01:00
parent 821067a955
commit b830dfd06b
2 changed files with 18 additions and 1 deletions
+3 -1
View File
@@ -8,4 +8,6 @@ var/list/powernets = list()
// this is not strictly unused although the whole modules datum thing is unused
// To remove this you need to remove that
var/datum/moduletypes/mods = new()
var/datum/moduletypes/mods = new()
var/map_name = "Unknown" //The name of the map that is loaded. Assigned in world/New()
+15
View File
@@ -88,6 +88,20 @@
process_ghost_teleport_locs() //Sets up ghost teleport locations.
sleep_offline = 1
var/list/lines = file2list(file('tgstation.dme'))
for(var/l in lines)
if( dd_hassuffix(l, ".dmm\"") )
var/firstquote = findtext(l, "\"")
var/lastslash = 0
for(var/j = 1; j < length(l); j++)
var/lastslashtest = findtext(l, "\\", -j)
if(lastslashtest > 0)
lastslash = lastslashtest
break
map_name = copytext(l, max(firstquote+1,lastslash+1), length(l)-4)
if(!map_name)
map_name = "Unknown"
spawn(3000) //so we aren't adding to the round-start lag
if(config.kick_inactive)
KickInactiveClients()
@@ -149,6 +163,7 @@
s["gamestate"] = 1
if(ticker)
s["gamestate"] = ticker.current_state
s["map_name"] = map_name ? map_name : "Unknown"
return list2params(s)