Skip to content

Commit

Permalink
irc: Fixed a bug where certain commands could crash the server due to…
Browse files Browse the repository at this point in the history
… console commands being executed from another thread.
  • Loading branch information
MinoMino committed Dec 7, 2015
1 parent d588c43 commit b55375a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,14 @@ def handle_msg(self, irc, user, channel, msg):
if self.auth_attempts[user[2]] > 0:
irc.msg(channel, "Wrong password. You have {} attempts left.".format(self.auth_attempts[user[2]]))
elif len(msg) > 1 and user in self.authed and msg[0].lower() == ".qlx":
try:
minqlx.COMMANDS.handle_input(IrcDummyPlayer(self.irc, user[0]), " ".join(msg[1:]), IrcChannel(self.irc, user[0]))
except Exception as e:
irc.msg(channel, "{}: {}".format(e.__class__.__name__, e))
minqlx.log_exception()
@minqlx.next_frame
def f():
try:
minqlx.COMMANDS.handle_input(IrcDummyPlayer(self.irc, user[0]), " ".join(msg[1:]), IrcChannel(self.irc, user[0]))
except Exception as e:
irc.msg(channel, "{}: {}".format(e.__class__.__name__, e))
minqlx.log_exception()
f()

def handle_perform(self, irc):
self.logger.info("Connected to IRC!".format(self.server))
Expand Down

0 comments on commit b55375a

Please sign in to comment.