diff --git a/modules/wolfgame.py b/modules/wolfgame.py index 4ec5d6c..1bcb713 100644 --- a/modules/wolfgame.py +++ b/modules/wolfgame.py @@ -73,6 +73,8 @@ var.illegal_joins = defaultdict(int) var.LOGGER = WolfgameLogger(var.LOG_FILENAME, var.BARE_LOG_FILENAME) +var.JOINED_THIS_GAME = [] # keeps track of who already joined this game at least once (cloaks) + if botconfig.DEBUG_MODE: var.NIGHT_TIME_LIMIT = 0 # 90 var.NIGHT_TIME_WARN = 0 @@ -178,6 +180,8 @@ def reset(cli): var.ROLES = {"person" : []} + var.JOINED_THIS_GAME = [] + reset_settings() dict.clear(var.LAST_SAID_TIME) @@ -414,7 +418,14 @@ def join(cli, nick, chann_, rest): cli.mode(chan, "+v", nick) var.ROLES["person"].append(nick) cli.msg(chan, '\u0002{0}\u0002 has joined the game and raised the number of players to \u0002{1}\u0002.'.format(nick, len(pl) + 1)) - + if not cloak in var.JOINED_THIS_GAME: + # make sure this only happens one + var.JOINED_THIS_GAME.append(cloak) + now = datetime.now() + # make sure there's at least var.WAIT_AFTER_JOIN seconds of wait time left, if not add them + if now + timedelta(seconds=var.WAIT_AFTER_JOIN) > var.CAN_START_TIME: + var.CAN_START_TIME = now + timedelta(seconds=var.WAIT_AFTER_JOIN) + var.LAST_STATS = None # reset diff --git a/settings/wolfgame.py b/settings/wolfgame.py index 830aa3c..52666b6 100644 --- a/settings/wolfgame.py +++ b/settings/wolfgame.py @@ -2,6 +2,7 @@ PING_WAIT = 300 # Seconds PING_MIN_WAIT = 30 # How long !start has to wait after a !ping MINIMUM_WAIT = 60 EXTRA_WAIT = 20 +WAIT_AFTER_JOIN = 10 # Wait at least this many seconds after the last join MAXIMUM_WAITED = 3 # limit for amount of !wait's STATS_RATE_LIMIT = 60 VOTES_RATE_LIMIT = 60