* Adds the active players for when you are getting the server status.

* Removed the unused player number followed by player name.
This commit is contained in:
Giacomand
2013-10-29 20:48:56 +00:00
parent d9fbcbab74
commit a5aca96dcc
2 changed files with 23 additions and 9 deletions
+16 -1
View File
@@ -310,4 +310,19 @@ proc/isInSight(var/atom/A, var/atom/B)
C.images += I
sleep(duration)
for(var/client/C in show_to)
C.images -= I
C.images -= I
/proc/get_active_player_count()
// Get active players who are playing in the round
var/active_players = 0
for(var/i = 1; i <= player_list.len; i++)
var/mob/M = player_list[i]
if(M && M.client)
if(istype(M, /mob/new_player)) // exclude people in the lobby
continue
else if(isobserver(M)) // Ghosts are fine if they were playing once (didn't start as observers)
var/mob/dead/observer/O = M
if(O.started_as_observer) // Exclude people who started as observers
continue
active_players++
return active_players
+7 -8
View File
@@ -106,12 +106,13 @@
// world << "End of Topic() call."
// ..()
/world/Topic(T, addr, master, key)
diary << "TOPIC: \"[T]\", from:[addr], master:[master], key:[key]"
if (T == "ping")
var/x = 1
for (var/client/C)
for (var/client/C in clients)
x++
return x
@@ -124,6 +125,7 @@
else if (T == "status")
var/list/s = list()
// Please add new status indexes under the old ones, for the server banner (until that gets reworked)
s["version"] = game_version
s["mode"] = master_mode
s["respawn"] = config ? abandon_allowed : 0
@@ -131,19 +133,16 @@
s["vote"] = config.allow_vote_mode
s["ai"] = config.allow_ai
s["host"] = host ? host : null
s["players"] = list()
var/n = 0
var/admins = 0
for(var/client/C in clients)
var/admins = 0
for(var/client/C in admins)
if(C.holder)
if(C.holder.fakekey)
continue //so stealthmins aren't revealed by the hub
admins++
s["player[n]"] = C.key
n++
s["players"] = n
s["active_players"] = get_active_player_count()
s["players"] = clients.len
s["revision"] = revdata.revision
s["revision_date"] = revdata.date
s["admins"] = admins