Added MIN_PLAYERS setting.
This commit is contained in:
parent
510dcfa9bf
commit
9ad5713471
@ -2337,8 +2337,8 @@ def start(cli, nick, chann_, rest):
|
|||||||
cli.msg(chan, "Please wait at least {0} more seconds.".format(dur))
|
cli.msg(chan, "Please wait at least {0} more seconds.".format(dur))
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(villagers) < 4:
|
if len(villagers) < var.MIN_PLAYERS:
|
||||||
cli.msg(chan, "{0}: Four or more players are required to play.".format(nick))
|
cli.msg(chan, "{0}: {1} or more players are required to play.".format(nick, var.MIN_PLAYERS))
|
||||||
return
|
return
|
||||||
|
|
||||||
for pcount in range(len(villagers), 3, -1):
|
for pcount in range(len(villagers), 3, -1):
|
||||||
@ -2921,8 +2921,8 @@ def game_stats(cli, nick, chan, rest):
|
|||||||
|
|
||||||
# Check for invalid input
|
# Check for invalid input
|
||||||
rest = rest.strip()
|
rest = rest.strip()
|
||||||
if not rest.isdigit() or int(rest) > var.MAX_PLAYERS or int(rest) < 4:
|
if not rest.isdigit() or int(rest) > var.MAX_PLAYERS or int(rest) < var.MIN_PLAYERS:
|
||||||
cli.notice(nick, "Please enter an integer between {0} and {1}.".format(4, var.MAX_PLAYERS))
|
cli.notice(nick, "Please enter an integer between {0} and {1}.".format(var.MIN_PLAYERS, var.MAX_PLAYERS))
|
||||||
return
|
return
|
||||||
|
|
||||||
# Attempt to find game stats for the given game size.
|
# Attempt to find game stats for the given game size.
|
||||||
|
@ -8,6 +8,7 @@ STATS_RATE_LIMIT = 60
|
|||||||
VOTES_RATE_LIMIT = 60
|
VOTES_RATE_LIMIT = 60
|
||||||
ADMINS_RATE_LIMIT = 300
|
ADMINS_RATE_LIMIT = 300
|
||||||
SHOTS_MULTIPLIER = .12 # ceil(shots_multiplier * len_players) = bullets given
|
SHOTS_MULTIPLIER = .12 # ceil(shots_multiplier * len_players) = bullets given
|
||||||
|
MIN_PLAYERS = 4
|
||||||
MAX_PLAYERS = 21
|
MAX_PLAYERS = 21
|
||||||
DRUNK_SHOTS_MULTIPLIER = 3
|
DRUNK_SHOTS_MULTIPLIER = 3
|
||||||
NIGHT_TIME_LIMIT = 120
|
NIGHT_TIME_LIMIT = 120
|
||||||
@ -333,7 +334,7 @@ def get_game_totals():
|
|||||||
size_totals = []
|
size_totals = []
|
||||||
total = 0
|
total = 0
|
||||||
with conn:
|
with conn:
|
||||||
for size in range(4, MAX_PLAYERS + 1):
|
for size in range(MIN_PLAYERS, MAX_PLAYERS + 1):
|
||||||
c.execute("SELECT size, totalgames FROM gamestats WHERE size=?", (size,))
|
c.execute("SELECT size, totalgames FROM gamestats WHERE size=?", (size,))
|
||||||
row = c.fetchone()
|
row = c.fetchone()
|
||||||
if row:
|
if row:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user