From 008effdf82b1a8fbef456a9958a03728a464133d Mon Sep 17 00:00:00 2001 From: jcao219 Date: Fri, 22 Jul 2011 20:46:25 -0500 Subject: [PATCH] !reset is now !fstop --- oyoyo/client.py | 5 +++-- wolfgame.py | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/oyoyo/client.py b/oyoyo/client.py index 7c34c4b..f8bc56c 100644 --- a/oyoyo/client.py +++ b/oyoyo/client.py @@ -72,7 +72,6 @@ def add_commands(d): @add_commands(("join", "mode", "nick", - "part", "who")) class IRCClient(object): """ IRC Client class. This handles one connection to a server. @@ -233,8 +232,10 @@ class IRCClient(object): def notice(self, user, msg): for line in msg.split('\n'): self.send("NOTICE", user, ":{0}".format(line)) - def quit(self, chan, msg): + def quit(self, msg): self.send("QUIT :{0}".format(msg)) + def part(self, chan, msg): + self.send("PART {0} :{1}".format(chan, msg)) def kick(self, chan, nick, msg): self.send("KICK", chan, nick, ":"+msg) def ns_identify(self, passwd): diff --git a/wolfgame.py b/wolfgame.py index 67fd7f6..bd29233 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -343,6 +343,7 @@ def fleave(cli, nick, chan, rest): @cmd("fstart", admin_only=True) def fstart(cli, nick, chan, rest): var.CAN_START_TIME = datetime.now() + cli.msg(chan, "\u0002{0}\u0002 has forced the game to start.".format(nick)) start(cli, nick, chan, rest) @@ -1844,8 +1845,12 @@ def fwait(cli, nick, chan, rest): "{1} seconds.").format(nick, var.EXTRA_WAIT)) -@cmd("reset",admin_only=True) +@cmd("fstop",admin_only=True) def reset_game(cli, nick, chan, rest): + if var.PHASE == "none": + cli.notice(nick, "No game is currently running.") + return + cli.msg(chan, "\u0002{0}\u0002 has forced the game to stop.".format(nick)) reset(cli) @@ -1917,6 +1922,7 @@ def show_admins(cli, nick, chan, rest): if (cloak in botconfig.ADMINS and 'G' not in status and user != botconfig.NICK and cloak not in var.AWAY): admins.append(user) + hk1 = HOOKS["whoreply"][-1] @@ -1926,6 +1932,7 @@ def show_admins(cli, nick, chan, rest): HOOKS.pop("whoreply") # todo, makes this better :( HOOKS.pop("endofwho") + hk2 = HOOKS["whoreply"][-1] cli.who(chan) \ No newline at end of file