def start(request): server_id = request._game_session.server_id char_id = request._game_session.char_id _id = request._proto.id formation_slots = parse_protocol_sync_formation_slots(request._proto.slots) tp = request._proto.tp if request._proto.HasField('win'): win = request._proto.win else: win = None p = Plunder(server_id, char_id) match = p.plunder_start(_id, tp, formation_slots, win) response = PlunderStartResponse() response.ret = 0 if match: response.match.MergeFrom(match) return ProtobufResponse(response)