Skip to content

Commit e94e09d

Browse files
committed
Adjust timing, add cookie secret
1 parent f4304ad commit e94e09d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/button.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
db = sqlite3.connect(app_dir + '/../database.db')
1919
#TODO Change this to 1800 for production
2020
time_in_round = 1800
21-
min_time_between_clicks = 1.0 # float seconds
21+
min_time_between_clicks = 0.5 # float seconds
22+
button_check_time = 0.25 # float seconds
2223
spam_ban_time = 10.0 # float seconds
2324
flag_index = 0
2425

@@ -216,11 +217,11 @@ def make_app():
216217
(r"/css/(.*)", tornado.web.StaticFileHandler, {"path": app_dir + "/public/css/"}),
217218
(r"/js/(.*)", tornado.web.StaticFileHandler, {"path": app_dir + "/public/js/"}),
218219
(r"/images/(.*)", tornado.web.StaticFileHandler, {"path": app_dir + "/public/images/"}),
219-
], cookie_secret="__TODO:_GENERATE_YOUR_OWN_RANDOM_VALUE_HERE__",
220+
], cookie_secret="CEHB0le6i7tXFsyIChKzQ7UOg2kgsako",
220221
login_url = "/")
221222

222223
def checkButton():
223-
tornado.ioloop.IOLoop.current().add_timeout(time.time() + 1, checkButton)
224+
tornado.ioloop.IOLoop.current().add_timeout(time.time() + button_check_time, checkButton)
224225
global kingOfTheHill
225226
global goingNegative
226227
if(kingOfTheHill != ""):
@@ -248,7 +249,7 @@ def resetRound():
248249
if __name__ == "__main__":
249250
app = make_app()
250251
app.listen(8888)
251-
tornado.ioloop.IOLoop.current().add_timeout(time.time() + 1, checkButton)
252+
tornado.ioloop.IOLoop.current().add_timeout(time.time() + button_check_time, checkButton)
252253
mins_to_half_hr = time.localtime().tm_min
253254
tornado.ioloop.IOLoop.current().add_timeout(time.time() + time_in_round - mins_to_half_hr, resetRound)
254255
tornado.ioloop.IOLoop.current().start()

0 commit comments

Comments
 (0)