From 09b5a62a9bc7cea9465178748af1810821772fc9 Mon Sep 17 00:00:00 2001 From: Janik Kleinhoff Date: Thu, 1 Jan 2015 05:20:52 +0000 Subject: [PATCH] Disallow !quit immediately after starting to avoid accidents --- modules/wolfgame.py | 4 ++++ settings/wolfgame.py | 1 + 2 files changed, 5 insertions(+) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index b51a1ca..4432dd1 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -2731,6 +2731,10 @@ def leave_game(cli, nick, chan, rest): else: population = (" New player count: \u0002{0}\u0002").format(lpl) else: + dur = (datetime.now() - var.GAME_START_TIME).total_seconds() + if var.START_QUIT_DELAY and dur < var.START_QUIT_DELAY: + cli.notice(nick, "The game already started!") + return population = "" if nick not in var.list_players() or nick in var.DISCONNECTED.keys(): # not playing cli.notice(nick, "You're not currently playing.") diff --git a/settings/wolfgame.py b/settings/wolfgame.py index f067cda..d3a6c30 100644 --- a/settings/wolfgame.py +++ b/settings/wolfgame.py @@ -39,6 +39,7 @@ PM_WARN_IDLE_TIME = 240 PART_GRACE_TIME = 30 QUIT_GRACE_TIME = 30 ACC_GRACE_TIME = 30 +START_QUIT_DELAY = 10 # controls how many people it does in one /msg; only works for messages that are the same MAX_PRIVMSG_TARGETS = 4 LEAVE_STASIS_PENALTY = 1