def render_JSON(self, request): clients_response = [] for p in allClients(): client = { 'cn': p.cn, 'name': p.name(), 'frags': p.frags(), 'teamkills': p.teamkills(), 'deaths': p.deaths(), 'privilege': p.privilege(), } try: client['team'] = p.team() except ValueError: client['team'] = 'spectator' try: client['is_verified'] = p.user != None except AttributeError: client['is_verified'] = False clients_response.append(client) return json.dumps({ 'clients': clients_response, 'map': currentMap(), 'mode': modeName(currentMode()) })
def render_JSON(self, request): return json.dumps({ 'map': currentMap(), 'mode': modeName(currentMode()) })