예제 #1
0
파일: api.py 프로젝트: GunioRobot/xsbs
	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())
			})
예제 #2
0
파일: api.py 프로젝트: pguenth/xsbs
 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())
     })
예제 #3
0
파일: api.py 프로젝트: GunioRobot/xsbs
	def render_JSON(self, request):
		return json.dumps({
			'map': currentMap(),
			'mode': modeName(currentMode())
			})
예제 #4
0
파일: api.py 프로젝트: pguenth/xsbs
 def render_JSON(self, request):
     return json.dumps({
         'map': currentMap(),
         'mode': modeName(currentMode())
     })