Fix ping responder module

This commit is contained in:
Dave Pedu 2015-12-13 13:40:53 -08:00
parent dd171d568a
commit 89e4a56d44
1 changed files with 14 additions and 1 deletions

View File

@ -15,16 +15,29 @@ class PingResponder(ModuleBase):
def __init__(self, bot, moduleName):
ModuleBase.__init__(self, bot, moduleName);
self.timer = PingRespondTimer(self)
self.hooks=[ModuleHook("PING", self.pingrespond)]
ModuleHook("PING", self.pingrespond),
ModuleHook("_RECV", self.resettimer)
def pingrespond(self, args, prefix, trailing):
"""Respond to the PING command"""
# got a ping? send it right back"%s Responded to a ping: %s" % (, trailing))
def resettimer(self, msg):
"""Resets the connection failure timer"""
def ondisable(self):
class PingRespondTimer(Thread):
"Tracks last ping from server, and reconnects if over a threshold"
def __init__(self, master):