Files
CHOMPStation2/code/game/topic.dm
elly1989@rocketmail.com 69f0046185 Fix for revdata=null causing world/Topic() runtimes.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4420 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-15 19:14:48 +00:00

43 lines
939 B
Plaintext

/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)
x++
return x
else if(T == "players")
var/n = 0
for(var/mob/M in player_list)
if(M.client)
n++
return n
else if (T == "status")
var/list/s = list()
s["version"] = game_version
s["mode"] = master_mode
s["respawn"] = config ? abandon_allowed : 0
s["enter"] = enter_allowed
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 client_list)
if(C.holder)
if(C.stealth)
continue //so stealthmins aren't revealed by the hub
admins++
s["player[n]"] = C.key
n++
s["players"] = n
if(revdata) s["revision"] = revdata.revision
s["admins"] = admins
return list2params(s)