Registering IRC as an Evennia Service, can now be controlled with @service/start/stop.

At the moment this only works with the initial IRC channel (the one set in preferences),
those channels you add later with @ircjoin does not add as Services; when setting it up
they add just fine, but the bot does not connect - I don't know why (code is commented out
in src/commands/irc.py).
/Griatch
This commit is contained in:
Griatch 2009-08-30 17:28:56 +00:00
parent cb7ee081f5
commit c5c8505582
4 changed files with 40 additions and 16 deletions

View file

@ -77,9 +77,13 @@ class IRC_BotFactory(protocol.ClientFactory):
self.network = network
self.channel = channel
self.nickname = nickname
def clientConnectionLost(self, connector, reason):
cemit_info("Lost connection (%s), reconnecting." % reason)
connector.connect()
def clientConnectionLost(self, connector, reason):
from twisted.internet.error import ConnectionDone
if type(reason.type) == type(ConnectionDone):
cemit_info("Connection closed.")
else:
cemit_info("Lost connection (%s), reconnecting." % reason)
connector.connect()
def clientConnectionFailed(self, connector, reason):
msg = "Could not connect: %s" % reason
cemit_info(msg)