added ping rate-limit

This commit is contained in:
Jimmy Cao 2011-07-04 21:02:55 -05:00
parent 267d7104bc
commit d75ddd641c

View File

@ -44,6 +44,12 @@ def py(cli, nick, chan, rest):
@cmd("!ping") @cmd("!ping")
def pinger(cli, nick, chan, rest): def pinger(cli, nick, chan, rest):
if vars.LAST_PING + 300 > time.time():
cli.notice(nick, "This command is ratelimited. \
Please wait a while before using it again.")
return
vars.LAST_PING = time.time()
vars.PINGING = True vars.PINGING = True
TO_PING = [] TO_PING = []
@ -191,6 +197,7 @@ def start(cli, nick, chan, rest):
party game (a theme of Mafia).".format(", ".join(vars.list_players()))) party game (a theme of Mafia).".format(", ".join(vars.list_players())))
cli.mode(chan, "+m") cli.mode(chan, "+m")
vars.GAME_START_TIME = time.time()
vars.ORIGINAL_ROLES = dict(vars.ROLES) # Make a copy vars.ORIGINAL_ROLES = dict(vars.ROLES) # Make a copy
transition_night(cli, chan) transition_night(cli, chan)