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:
parent
cb7ee081f5
commit
c5c8505582
4 changed files with 40 additions and 16 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue