From b37bff072b5ef879725796b32d924017abe9ad23 Mon Sep 17 00:00:00 2001 From: Rogier Neeleman Date: Sun, 2 Jul 2017 21:52:55 +0200 Subject: [PATCH] Refresh time of the overview pages is now configurable. --- nfgame.cfg-example | 3 +++ nfgame.py | 5 +++-- templates/layout-overview.html | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nfgame.cfg-example b/nfgame.cfg-example index 612dd07..c5c8294 100644 --- a/nfgame.cfg-example +++ b/nfgame.cfg-example @@ -17,6 +17,9 @@ MAX_TIME = '3600' # Time the players will be shown on the overview after there playtime is over SHOW_TIME = '120' +# Refresh time for the scoreboard and highscore pages +REFRESH_TIME = '10' + # HTML text for the registration page: REGISTRATION_DESK = 'You can find the registration desk in the center.' diff --git a/nfgame.py b/nfgame.py index d6a5c48..579cd4a 100644 --- a/nfgame.py +++ b/nfgame.py @@ -21,6 +21,7 @@ app.config.update(dict( START_KEY = 'None', MAX_TIME = '3600', SHOW_TIME = '120', + REFRESH_TIME = '10', SECRET_KEY = 'Very secret key!', ADMIN_PASSWORD = 'changeme!' )) @@ -86,7 +87,7 @@ def index(): if found_tag == tag: user[entry['id']][tag] = 'Found' - return render_template('overview.html', entries=entries, tags=app.config['TAGS'], user=user, type='Current players') + return render_template('overview.html', entries=entries, tags=app.config['TAGS'], user=user, type='Current players', refresh=app.config['REFRESH_TIME']) @app.route('/highscores') def highscores(): @@ -120,7 +121,7 @@ def highscores(): if found_tag == tag: user[entry['id']][tag] = 'Found' - return render_template('overview.html', entries=entries, tags=app.config['TAGS'], user=user, type='Highscores') + return render_template('overview.html', entries=entries, tags=app.config['TAGS'], user=user, type='Highscores', refresh=app.config['REFRESH_TIME']) @app.route('/newuser/', methods=['GET', 'POST']) @app.route('/newuser//', methods=['GET', 'POST']) diff --git a/templates/layout-overview.html b/templates/layout-overview.html index eb912e3..7ebff09 100644 --- a/templates/layout-overview.html +++ b/templates/layout-overview.html @@ -6,7 +6,7 @@ - +