Add feature for wait time added for each !join
Ineffective by default because the wait time is set to 0 in the default configuration file.
This commit is contained in:
parent
04d2702f36
commit
d769943c0a
@ -420,9 +420,16 @@ def join(cli, nick, chann_, rest):
|
|||||||
var.ROLES["person"].append(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))
|
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:
|
if not cloak in var.JOINED_THIS_GAME:
|
||||||
# make sure this only happens one
|
# make sure this only happens once
|
||||||
var.JOINED_THIS_GAME.append(cloak)
|
var.JOINED_THIS_GAME.append(cloak)
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
|
||||||
|
# add var.EXTRA_WAIT_JOIN to wait time
|
||||||
|
if now > var.CAN_START_TIME:
|
||||||
|
var.CAN_START_TIME = now + timedelta(seconds=var.EXTRA_WAIT_JOIN)
|
||||||
|
else:
|
||||||
|
var.CAN_START_TIME += timedelta(seconds=var.EXTRA_WAIT_JOIN)
|
||||||
|
|
||||||
# make sure there's at least var.WAIT_AFTER_JOIN seconds of wait time left, if not add them
|
# 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:
|
if now + timedelta(seconds=var.WAIT_AFTER_JOIN) > var.CAN_START_TIME:
|
||||||
var.CAN_START_TIME = now + timedelta(seconds=var.WAIT_AFTER_JOIN)
|
var.CAN_START_TIME = now + timedelta(seconds=var.WAIT_AFTER_JOIN)
|
||||||
|
@ -2,6 +2,7 @@ PING_WAIT = 300 # Seconds
|
|||||||
PING_MIN_WAIT = 30 # How long !start has to wait after a !ping
|
PING_MIN_WAIT = 30 # How long !start has to wait after a !ping
|
||||||
MINIMUM_WAIT = 60
|
MINIMUM_WAIT = 60
|
||||||
EXTRA_WAIT = 20
|
EXTRA_WAIT = 20
|
||||||
|
EXTRA_WAIT_JOIN = 0 # Add this many seconds to the waiting time for each !join
|
||||||
WAIT_AFTER_JOIN = 10 # Wait at least this many seconds after the last join
|
WAIT_AFTER_JOIN = 10 # Wait at least this many seconds after the last join
|
||||||
MAXIMUM_WAITED = 3 # limit for amount of !wait's
|
MAXIMUM_WAITED = 3 # limit for amount of !wait's
|
||||||
STATS_RATE_LIMIT = 60
|
STATS_RATE_LIMIT = 60
|
||||||
|
Loading…
x
Reference in New Issue
Block a user