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
|
|
@ -159,13 +159,14 @@ class EvenniaService(service.Service):
|
|||
imc2_events.add_events()
|
||||
|
||||
if settings.IRC_ENABLED:
|
||||
#Connect to the IRC network.
|
||||
from src.irc.connection import connect_to_IRC
|
||||
connect_to_IRC(settings.IRC_NETWORK,
|
||||
settings.IRC_PORT,
|
||||
settings.IRC_CHANNEL,
|
||||
settings.IRC_NICKNAME)
|
||||
|
||||
from src.irc.connection import IRC_BotFactory
|
||||
irc = internet.TCPClient(settings.IRC_NETWORK,
|
||||
settings.IRC_PORT,
|
||||
IRC_BotFactory(settings.IRC_CHANNEL,
|
||||
settings.IRC_NETWORK,
|
||||
settings.IRC_NICKNAME))
|
||||
irc.setName("%s:%s" % ("IRC",settings.IRC_CHANNEL))
|
||||
irc.setServiceParent(self.service_collection)
|
||||
|
||||
application = service.Application('Evennia')
|
||||
mud_service = EvenniaService()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue