Ejemplo n.º 1
0
def who(caller,where="ingame"):
        """This gives info on all the people logged in to the server. It tells their name, client number and IP address. Use this in conjuction with #echo. Ex: #echo (who)"""
	def cndetails(cn):
		return sbserver.playerName(cn)+" (cn"+str(cn)+"/"+ipLongToString(sbserver.playerIpLong(cn))+")"
	
	clientlist=[session[1] for session in UserSessionManager.keys() if session[0] == where]
	
	if where=="ingame":
		clientlist='; '.join(map(cndetails,clientlist))
	
	if clientlist!="" or clientlist!=[]:
		return str(clientlist)
	else:
		return "No clients for %s." % where