Browse Source

flastgame now pings the admin who did it after the game ends.

master
jcao219 14 years ago
parent
commit
f997decf1d
  1. 9
      wolfgame.py

9
wolfgame.py

@ -86,6 +86,7 @@ def connect_callback(cli):
var.ROLES = {"person" : []} var.ROLES = {"person" : []}
var.ORIGINAL_ROLES = {} var.ORIGINAL_ROLES = {}
var.DEAD_USERS = {} var.DEAD_USERS = {}
var.ADMIN_TO_PING = None
var.PHASE = "none" # "join", "day", or "night" var.PHASE = "none" # "join", "day", or "night"
var.TIMERS = [None, None] var.TIMERS = [None, None]
var.DEAD = [] var.DEAD = []
@ -672,6 +673,10 @@ def stop_game(cli, winner = ""):
var.update_role_stats(clk, rol, won, iwon) var.update_role_stats(clk, rol, won, iwon)
if var.ADMIN_TO_PING:
cli.msg(chan, "PING! " + var.ADMIN_TO_PING)
var.ADMIN_TO_PING = None
reset(cli) reset(cli)
return True return True
@ -895,6 +900,9 @@ def on_nick(cli, prefix, nick):
var.USERS.append(nick) var.USERS.append(nick)
var.CLOAKS.append(cloak) var.CLOAKS.append(cloak)
if prefix == var.ADMIN_TO_PING:
var.ADMIN_TO_PING = nick
for k,v in var.ORIGINAL_ROLES.items(): for k,v in var.ORIGINAL_ROLES.items():
if prefix in v: if prefix in v:
var.ORIGINAL_ROLES[k].remove(prefix) var.ORIGINAL_ROLES[k].remove(prefix)
@ -2188,6 +2196,7 @@ def flastgame(cli, nick, *rest):
COMMANDS["start"] = [lambda *spam: cli.msg(chan, "This command has been disabled by an admin.")] COMMANDS["start"] = [lambda *spam: cli.msg(chan, "This command has been disabled by an admin.")]
cli.msg(chan, "Starting a new game has now been disabled by \02{0}\02.".format(nick)) cli.msg(chan, "Starting a new game has now been disabled by \02{0}\02.".format(nick))
var.ADMIN_TO_PING = nick

Loading…
Cancel
Save