|
|
@ -77,6 +77,7 @@ def connect_callback(cli): |
|
|
|
var.LAST_STATS = None |
|
|
|
var.LAST_STATS = None |
|
|
|
var.LAST_VOTES = None |
|
|
|
var.LAST_VOTES = None |
|
|
|
var.LAST_ADMINS = None |
|
|
|
var.LAST_ADMINS = None |
|
|
|
|
|
|
|
var.LAST_PLAYERS = None |
|
|
|
|
|
|
|
|
|
|
|
var.USERS = {} |
|
|
|
var.USERS = {} |
|
|
|
|
|
|
|
|
|
|
@ -272,6 +273,10 @@ def pinger(cli, nick, chan, rest): |
|
|
|
|
|
|
|
|
|
|
|
cli.msg(chan, "PING! "+" ".join(TO_PING)) |
|
|
|
cli.msg(chan, "PING! "+" ".join(TO_PING)) |
|
|
|
var.PINGING = False |
|
|
|
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) |
|
|
|
decorators.unhook(HOOKS, 800) |
|
|
|
|
|
|
|
|
|
|
@ -349,6 +354,7 @@ def join(cli, nick, chan, rest): |
|
|
|
cli.msg(chan, '\u0002{0}\u0002 has joined the game.'.format(nick)) |
|
|
|
cli.msg(chan, '\u0002{0}\u0002 has joined the game.'.format(nick)) |
|
|
|
|
|
|
|
|
|
|
|
var.LAST_STATS = None # reset |
|
|
|
var.LAST_STATS = None # reset |
|
|
|
|
|
|
|
var.LAST_PLAYERS = None # re/set |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cmd("fjoin", admin_only=True) |
|
|
|
@cmd("fjoin", admin_only=True) |
|
|
@ -424,7 +430,7 @@ def on_account(cli, nick, acc): |
|
|
|
|
|
|
|
|
|
|
|
@cmd("stats") |
|
|
|
@cmd("stats") |
|
|
|
def stats(cli, nick, chan, rest): |
|
|
|
def stats(cli, nick, chan, rest): |
|
|
|
"""Display the player statistics""" |
|
|
|
"""Display the game statistics""" |
|
|
|
if var.PHASE == "none": |
|
|
|
if var.PHASE == "none": |
|
|
|
cli.notice(nick, "No game is currently running.") |
|
|
|
cli.notice(nick, "No game is currently running.") |
|
|
|
return |
|
|
|
return |
|
|
@ -442,10 +448,12 @@ def stats(cli, nick, chan, rest): |
|
|
|
|
|
|
|
|
|
|
|
pl.sort(key=lambda x: x.lower()) |
|
|
|
pl.sort(key=lambda x: x.lower()) |
|
|
|
if len(pl) > 1: |
|
|
|
if len(pl) > 1: |
|
|
|
msg = '{0}: \u0002{1}\u0002 players: {2}'.format(nick, |
|
|
|
msg = '{0}: \u0002{1}\u0002 players'.format(nick, len(pl)) |
|
|
|
len(pl), ", ".join(pl)) |
|
|
|
|
|
|
|
else: |
|
|
|
else: |
|
|
|
msg = '{0}: \u00021\u0002 player: {1}'.format(nick, pl[0]) |
|
|
|
msg = '{0}: \u00021\u0002 player'.format(nick) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if var.PHASE == "join": |
|
|
|
|
|
|
|
msg = msg + ". The game has not started yet." |
|
|
|
|
|
|
|
|
|
|
|
if nick in pl or var.PHASE == "join": |
|
|
|
if nick in pl or var.PHASE == "join": |
|
|
|
cli.msg(chan, msg) |
|
|
|
cli.msg(chan, msg) |
|
|
@ -498,6 +506,29 @@ def stats(cli, nick, chan, rest): |
|
|
|
cli.notice(nick, stats_mssg) |
|
|
|
cli.notice(nick, stats_mssg) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cmd("players") |
|
|
|
|
|
|
|
def players(cli, nick, chan, rest): |
|
|
|
|
|
|
|
"""Display the player statistics""" |
|
|
|
|
|
|
|
if var.PHASE == "none": |
|
|
|
|
|
|
|
cli.notice(nick, "No players have joined.") |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (var.LAST_PLAYERS and |
|
|
|
|
|
|
|
var.LAST_PLAYERS + timedelta(seconds=var.PLAYERS_RATE_LIMIT) > datetime.now()): |
|
|
|
|
|
|
|
cli.msg(chan, nick+": This command is rate-limited.") |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var.LAST_PLAYERS = datetime.now() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pl = var.list_players() |
|
|
|
|
|
|
|
pl.sort(key=lambda x: x.lower()) |
|
|
|
|
|
|
|
if len(pl) > 1: |
|
|
|
|
|
|
|
cli.msg(chan, '{0}: \u0002{1}\u0002 players: {2}'.format(nick, |
|
|
|
|
|
|
|
len(pl), ", ".join(pl))) |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
cli.msg(chan, '{0}: \u00021\u0002 player: {1}'.format(nick, pl[0])) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def hurry_up(cli, gameid, change): |
|
|
|
def hurry_up(cli, gameid, change): |
|
|
|
if var.PHASE != "day": return |
|
|
|
if var.PHASE != "day": return |
|
|
|