Files
Polaris/code/game/topic.dm
vageyenaman@gmail.com 6a8a665132 More work on NTSL and world/Topic()
Includes a plethora of new NTSL functions, courtesy of Donkieyo (thread: http://nanotrasen.com/phpBB3/viewtopic.php?f=16&t=8153)


Bugfix for a weird runtime generated when an AI tries to interact with telecomms machinery directly.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3347 316c924e-a436-60f5-8080-3fe189b3f50e
2012-03-23 19:59:00 +00:00

46 lines
979 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 world)
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/mob/M in world)
if(M.client)
if(M.client.holder && M.client.authenticated)
if(!M.client.stealth)
admins++
s["player[n]"] = M.client.key
n++
s["players"] = n
// 7 + s["players"] + 1 = index of s["revinfo"]
s["revision"] = revdata.revision
s["admins"] = admins
return list2params(s)