diff --git a/nfgame.py b/nfgame.py index e1b3f85..6b66025 100644 --- a/nfgame.py +++ b/nfgame.py @@ -19,6 +19,7 @@ app.config.update(dict( 'taghash4': 'tagname4' }, START_KEY = 'None', + MAX_TIME = '3600', SECRET_KEY = 'Very secret key!', ADMIN_PASSWORD = 'changeme!' )) @@ -162,6 +163,9 @@ def tag_found(taghash): seconds = timediff.seconds - (minutes * 60) time = str(hours) + ":" + str(minutes) + ":" + str(seconds) + if int(timediff.seconds) > int(app.config['MAX_TIME']): + return render_template('timeout.html', color='#FF9999') + db = get_db() cur = db.execute('update score set tags = ?, lasttime = datetime(), duration = ? where id = ?', [cur_score, time, session['id']]) db.commit() diff --git a/templates/timeout.html b/templates/timeout.html new file mode 100644 index 0000000..d619fe1 --- /dev/null +++ b/templates/timeout.html @@ -0,0 +1,9 @@ +{% extends "layout.html" %} +{% block body %} +
+

Timeout!

+ Your time is up!
+ Please return to the registration desk. +
+{% endblock %} +