From 1a5e198c72dcddd509683a7017ad43e766f8e990 Mon Sep 17 00:00:00 2001 From: jcao219 Date: Tue, 9 Aug 2011 22:12:25 -0500 Subject: [PATCH] flastgame disables next-game-starting if used during the joining phase --- wolfgame.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/wolfgame.py b/wolfgame.py index 1c09270..5d929c9 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -1904,6 +1904,12 @@ def start(cli, nick, chan, rest): var.PHASE = "join" return + + if var.ADMIN_TO_PING: + if "join" in COMMANDS.keys(): + COMMANDS["join"] = [lambda *spam: cli.msg(chan, "This command has been disabled by an admin.")] + if "start" in COMMANDS.keys(): + COMMANDS["start"] = [lambda *spam: cli.msg(chan, "This command has been disabled by an admin.")] var.ROLES = {} var.CURSED = [] @@ -2217,11 +2223,11 @@ def coin(cli, nick, chan, rest): def flastgame(cli, nick, *rest): """This command may be used in the channel or in a PM, and it disables starting or joining a game.""" chan = botconfig.CHANNEL - - if "join" in COMMANDS.keys(): - COMMANDS["join"] = [lambda *spam: cli.msg(chan, "This command has been disabled by an admin.")] - if "start" in COMMANDS.keys(): - COMMANDS["start"] = [lambda *spam: cli.msg(chan, "This command has been disabled by an admin.")] + if var.PHASE != "join": + if "join" in COMMANDS.keys(): + COMMANDS["join"] = [lambda *spam: cli.msg(chan, "This command has been disabled by an admin.")] + if "start" in COMMANDS.keys(): + 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)) var.ADMIN_TO_PING = nick