From 603f955a0019366acfcc9cac422cf9300cd96c0d Mon Sep 17 00:00:00 2001 From: zamabe Date: Mon, 20 Feb 2012 14:49:27 -0600 Subject: [PATCH] Allow players to join the game after being pinged. Check for and enforce a minimum wait time when ping command is used to avoid leaving players behind after pinging them. --- modules/wolfgame.py | 4 ++++ settings/wolfgame.py | 1 + 2 files changed, 5 insertions(+) diff --git a/modules/wolfgame.py b/modules/wolfgame.py index ea9624a..d89c5b2 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -272,6 +272,10 @@ def pinger(cli, nick, chan, rest): cli.msg(chan, "PING! "+" ".join(TO_PING)) var.PINGING = False + + minimum = datetime.now() + timedelta(seconds=var.PING_MIN_WAIT) + if var.CAN_START_TIME < minimum: + var.CAN_START_TIME = minimum decorators.unhook(HOOKS, 800) diff --git a/settings/wolfgame.py b/settings/wolfgame.py index ae82349..fcd87f7 100644 --- a/settings/wolfgame.py +++ b/settings/wolfgame.py @@ -1,4 +1,5 @@ PING_WAIT = 300 # Seconds +PING_MIN_WAIT = 30 MINIMUM_WAIT = 60 EXTRA_WAIT = 20 MAXIMUM_WAITED = 2 # limit for amount of !wait's