コード例 #1
0
def questlist():
    import math
    page_number = request.values.get('api_page_no', None)      
    data = {}
    admiral = get_token_admiral_or_error()
    questlist = QuestHelper.get_questlist_ordered(admiral)
    data['api_count'] = len(questlist)
    data['api_page_count'] = int(math.ceil(data['api_count'] / 5))
    data["api_disp_page"] = int(page_number)
    data["api_list"] = []
    for admiral_quest,quest in questlist:      
      data["api_list"].append({
        "api_no": quest.id,
        "api_category": quest.category,
        "api_type": quest.frequency,
        "api_state": admiral_quest.state,
        "api_title": quest.title,
        "api_detail": quest.detail,
        "api_get_material": quest.reward.to_list(),
        "api_bonus_flag": quest.bonus_flag,
        "api_progress_flag": admiral_quest.progress,
        "api_invalid_flag": quest.invalid_flag
      })
    return svdata(data)
コード例 #2
0
ファイル: kccheat.py プロジェクト: f-matos/kcsrv
def quest_add(admiral_id,quest_id):
    admiral = db.session.query(Admiral).get(admiral_id)
    QuestHelper.unlock_quest(admiral,quest_id)
    print("Eh, if id was correct it probably worked.")
コード例 #3
0
def quest_add(admiral_id, quest_id):
    admiral = db.session.query(Admiral).get(admiral_id)
    QuestHelper.unlock_quest(admiral, quest_id)
    print("Eh, if id was correct it probably worked.")
コード例 #4
0
def clearitemget():
    admiral = get_token_admiral_or_error()
    quest_id = request.values.get("api_quest_id")
    data = QuestHelper.complete_quest(admiral, quest_id)
    return svdata(data)
コード例 #5
0
def queststart():
    admiral = get_token_admiral_or_error()
    quest_id = request.values.get("api_quest_id")
    AdmiralHelper.activate_quest(quest_id, admiral)
    QuestHelper.update_quest_progress(quest_id, admiral)
    return svdata({'api_result_msg': 'ok', 'api_result': 1})
コード例 #6
0
ファイル: actions.py プロジェクト: f-matos/kcsrv
def clearitemget():
    admiral = get_token_admiral_or_error()
    quest_id = request.values.get("api_quest_id")
    data = QuestHelper.complete_quest(admiral,quest_id)
    return svdata(data)
コード例 #7
0
ファイル: actions.py プロジェクト: f-matos/kcsrv
def queststart():
    admiral = get_token_admiral_or_error()
    quest_id = request.values.get("api_quest_id")
    AdmiralHelper.activate_quest(quest_id,admiral)
    QuestHelper.update_quest_progress(quest_id,admiral)
    return svdata({'api_result_msg': 'ok', 'api_result': 1})