mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 02:24:12 +01:00
Fixed the reconnect bug and still kept the quit bug fixed. w00t.
This commit is contained in:
parent
6890baa787
commit
56dc087b20
@ -46,6 +46,9 @@ from twisted.protocols.basic import LineReceiver
|
|||||||
from twisted.internet.protocol import ReconnectingClientFactory
|
from twisted.internet.protocol import ReconnectingClientFactory
|
||||||
|
|
||||||
class TwistedRunnerDriver(drivers.IrcDriver):
|
class TwistedRunnerDriver(drivers.IrcDriver):
|
||||||
|
def name(self):
|
||||||
|
return self.__class__.__name__
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
try:
|
try:
|
||||||
reactor.iterate(conf.supybot.drivers.poll())
|
reactor.iterate(conf.supybot.drivers.poll())
|
||||||
@ -69,23 +72,21 @@ class SupyIrcProtocol(LineReceiver):
|
|||||||
msg = self.irc.takeMsg()
|
msg = self.irc.takeMsg()
|
||||||
if msg:
|
if msg:
|
||||||
self.transport.write(str(msg))
|
self.transport.write(str(msg))
|
||||||
if not self.irc.zombie:
|
|
||||||
self.mostRecentCall = reactor.callLater(1, self.checkIrcForMsgs)
|
self.mostRecentCall = reactor.callLater(1, self.checkIrcForMsgs)
|
||||||
|
|
||||||
def connectionLost(self, failure):
|
def connectionLost(self, failure):
|
||||||
|
self.mostRecentCall.cancel()
|
||||||
drivers.log.disconnect(self.factory.currentServer, errorMsg(failure))
|
drivers.log.disconnect(self.factory.currentServer, errorMsg(failure))
|
||||||
if not self.irc.zombie:
|
if self.irc.zombie:
|
||||||
self.irc.reset()
|
|
||||||
else:
|
|
||||||
# Let's take and take and take until our IRC is DESTROYED!
|
# Let's take and take and take until our IRC is DESTROYED!
|
||||||
x = 1
|
x = 1
|
||||||
while x:
|
while x:
|
||||||
x = self.irc.takeMsg()
|
x = self.irc.takeMsg()
|
||||||
|
|
||||||
def connectionMade(self):
|
def connectionMade(self):
|
||||||
self.irc.reset()
|
|
||||||
self.factory.resetDelay()
|
self.factory.resetDelay()
|
||||||
self.irc.driver = self
|
self.irc.driver = self
|
||||||
|
self.irc.reset()
|
||||||
|
|
||||||
def die(self):
|
def die(self):
|
||||||
drivers.log.die(self.irc)
|
drivers.log.die(self.irc)
|
||||||
|
Loading…
Reference in New Issue
Block a user