Browse Source

#7 added the time a out-of-time-player is still shown on the current scoreboard

pull/14/head
Rogier Neeleman 7 years ago
parent
commit
5faa9a11d8
  1. 11
      nfgame.cfg-example
  2. 3
      nfgame.py

11
nfgame.cfg-example

@ -14,6 +14,9 @@ START_KEY = 'None @@ -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.' @@ -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'
}

3
nfgame.py

@ -20,6 +20,7 @@ app.config.update(dict( @@ -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): @@ -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()

Loading…
Cancel
Save