Beispiel #1
0
def full_puzzle_list():
    core_display_data = get_full_path_core_display_data()
    all_puzzles_async = cube.get_all_puzzle_properties_async(app)

    all_puzzles = {
        v['puzzleId']: v
        for v in all_puzzles_async.result().json()['puzzles']
    }
    # default to UNLOCKED instead of SOLVED here to avoid showing answers
    all_visibilities = {
        p: {
            'status': request.args.get('visibility', 'UNLOCKED')
        }
        for p in all_puzzles
    }

    r = make_response(
        render_template(
            "puzzle_list.html",
            core_display_data=core_display_data,
            is_hunt_started=True,
            all_visibilities=all_visibilities,
            all_puzzles=all_puzzles,
            round_puzzle_map=ROUND_PUZZLE_MAP,
            events_unlocked=True,
            interactions_finales=all_puzzles,
        ))
    r.headers.set('Cache-Control', 'private, max-age=0, no-cache, no-store')
    return r
Beispiel #2
0
def activity_log():
    is_hunt_started_async = cube.is_hunt_started_async(app)
    core_team_properties_async = cube.get_team_properties_async(app)
    team_visibility_changes_async = cube.get_team_visibility_changes_async(app)
    team_submissions_async = cube.get_team_submissions_async(app)
    all_puzzles_async = cube.get_all_puzzle_properties_async(app)

    is_hunt_started = is_hunt_started_async.result()
    core_display_data = make_core_display_data(core_team_properties_async)

    visibility_changes = [
        vc for vc in team_visibility_changes_async.result()
        if vc["status"] in ['UNLOCKED', 'SOLVED']
    ]
    activity_entries = visibility_changes + team_submissions_async.result()
    activity_entries.sort(key=lambda entry: entry["timestamp"], reverse=True)

    all_puzzles = {
        v["puzzleId"]: v
        for v in all_puzzles_async.result().json()["puzzles"]
    }
    interactions_and_finales = [v["puzzleId"] for v in []]

    r = make_response(
        render_template("activity_log.html",
                        core_display_data=core_display_data,
                        is_hunt_started=is_hunt_started,
                        activity_entries=activity_entries,
                        all_puzzles=all_puzzles,
                        interactions_and_finales=interactions_and_finales))
    r.headers.set('Cache-Control', 'private, max-age=0, no-cache, no-store')
    return r
def activity_log():
    core_visibilities_async = cube.get_puzzle_visibilities_for_list_async(
        app, CHARACTER_IDS + QUEST_IDS + ['merchants', 'battle'])
    core_team_properties_async = cube.get_team_properties_async(app)
    team_visibility_changes_async = cube.get_team_visibility_changes_async(app)
    team_submissions_async = cube.get_team_submissions_async(app)
    all_puzzles_async = cube.get_all_puzzle_properties_async(app)

    core_display_data = make_core_display_data(core_visibilities_async,
                                               core_team_properties_async)

    visibility_changes = [
        vc for vc in team_visibility_changes_async.result()
        if vc["status"] in ['UNLOCKED', 'SOLVED']
        and not vc["puzzleId"].startswith("event")
    ]
    activity_entries = visibility_changes + team_submissions_async.result()
    activity_entries.sort(key=lambda entry: entry["timestamp"], reverse=True)

    all_puzzles = {
        v["puzzleId"]: v
        for v in all_puzzles_async.result().json()["puzzles"]
    }

    return render_template("activity_log.html",
                           core_display_data=core_display_data,
                           activity_entries=activity_entries,
                           all_puzzles=all_puzzles)
Beispiel #4
0
def puzzle_list():
    if not cube.is_hunt_started_async(app).result():
        abort(403)

    core_team_properties_async = cube.get_team_properties_async(app)
    all_visibilities_async = cube.get_puzzle_visibilities_async(app)
    all_puzzles_async = cube.get_all_puzzle_properties_async(app)

    core_display_data = make_core_display_data(core_team_properties_async)
    all_visibilities = {
        v["puzzleId"]: v
        for v in all_visibilities_async.result().json()["visibilities"]
    }
    all_puzzles = {
        v["puzzleId"]: v
        for v in all_puzzles_async.result().json()["puzzles"]
    }

    with metrics.timer("present.puzzle_list_render"):
        r = make_response(
            render_template(
                "puzzle_list.html",
                core_display_data=core_display_data,
                is_hunt_started=True,
                all_visibilities=all_visibilities,
                all_puzzles=all_puzzles,
                round_puzzle_map=ROUND_PUZZLE_MAP,
            ))
        r.headers.set('Cache-Control',
                      'private, max-age=0, no-cache, no-store')
        return r
def puzzle_list():
    if not cube.is_hunt_started_async(app).result():
        abort(403)

    core_visibilities_async = cube.get_puzzle_visibilities_for_list_async(
        app, CHARACTER_IDS + QUEST_IDS + ['merchants', 'battle'])
    core_team_properties_async = cube.get_team_properties_async(app)
    all_visibilities_async = cube.get_puzzle_visibilities_async(app)
    all_puzzles_async = cube.get_all_puzzle_properties_async(app)

    core_display_data = make_core_display_data(core_visibilities_async,
                                               core_team_properties_async)
    all_visibilities = {
        v["puzzleId"]: v
        for v in all_visibilities_async.result().json()["visibilities"]
    }
    all_puzzles = {
        v["puzzleId"]: v
        for v in all_puzzles_async.result().json()["puzzles"]
    }

    with metrics.timer("present.puzzle_list_render"):
        return render_template("puzzle_list.html",
                               core_display_data=core_display_data,
                               all_visibilities=all_visibilities,
                               all_puzzles=all_puzzles,
                               round_puzzle_map=ROUND_PUZZLE_MAP)