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 clanWar(cn, args): '''@description Start a clan war with current teams @usage map (mode)''' sender = player(cn) if args == '': raise UsageError() else: args = args.split(' ') if len(args) == 1: map = args mode = currentMode() elif len(args) == 2: map = args[0] try: mode = modeNumber(args[1]) except ValueError: raise ArgumentValueError('Invalid game mode') persistentTeams(True) setMap(map, mode) setMasterMode(2) setPaused(True, cn) setFrozen(True) clanWarTimer(10, cn)