def render_master_JSON(self, request, user): try: map = request.args['map'][0] mode = request.args['mode'][0] mode_num = modeNumber(mode) except (KeyError, ValueError): return response('invalid_parameters', 'Valid map and mode name not specified') setMap(map, mode_num) return response('success')
def render_JSON(self, request): try: username = request.args['username'][0] password = request.args['password'][0] except (KeyError, IndexError): return response('invalid_parameters', 'Invalid username and or password') return resource('success')
def render_master_JSON(self, request, user): try: player(int(request.args['cn'][0])).kick() except (ValueError, TypeError, KeyError): return response('invalid_parameters', 'No valid cn specified') return response('success')