From 5faa9a11d801d32ce8432db2bed407afe1c927e3 Mon Sep 17 00:00:00 2001 From: Rogier Neeleman Date: Sun, 2 Jul 2017 21:43:41 +0200 Subject: [PATCH] #7 added the time a out-of-time-player is still shown on the current scoreboard --- nfgame.cfg-example | 11 +++++++++++ nfgame.py | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/nfgame.cfg-example b/nfgame.cfg-example index b4be27b..3fe5217 100644 --- a/nfgame.cfg-example +++ b/nfgame.cfg-example @@ -14,6 +14,9 @@ START_KEY = 'None # Max time of the game in seconds MAX_TIME = '3600' +# Time the players will be shown on the overview after there playtime is over +SHOW_TIME = '120' + # HTML text for the registration page: REGISTRATION_DESK = 'You can find the registration desk in the center.' @@ -21,3 +24,11 @@ REGISTRATION_DESK = 'You can find the registration desk in the center.' SECRET_KEY = 'Very secret key!' ADMIN_PASSWORD = 'changeme!' + + +# All the tags and there human readable name +TAGS = {'taghash1': 'boom', + 'taghash2': 'toilet', + 'taghash3': 'tent', + 'taghash4': 'water tap' + } diff --git a/nfgame.py b/nfgame.py index 0a843a2..d6a5c48 100644 --- a/nfgame.py +++ b/nfgame.py @@ -20,6 +20,7 @@ app.config.update(dict( }, START_KEY = 'None', MAX_TIME = '3600', + SHOW_TIME = '120', SECRET_KEY = 'Very secret key!', ADMIN_PASSWORD = 'changeme!' )) @@ -61,7 +62,7 @@ def close_db(error): @app.route('/') def index(): """Calculate starttime""" - now = datetime.now() - timedelta(seconds=int(app.config['MAX_TIME'])) + now = datetime.now() - timedelta(seconds=int(app.config['MAX_TIME'])) - timedelta(seconds=int(app.config['SHOW_TIME'])) maxstarttime = datetime.strptime((str(now.year)+"-"+str(now.month)+"-"+str(now.day)+" "+str(now.hour)+":"+str(now.minute)+":"+str(now.second)), "%Y-%m-%d %H:%M:%S") db = get_db()