def server_connect(self, protocol_path="", config=dict()): """ Called by server to force the initialization of a new protocol instance. Server wants this instance to get a unique sessid and to be connected back as normal. This is used to initiate irc/imc2/rss etc connections. Args: protocol_path (st): Full python path to the class factory for the protocol used, eg 'evennia.server.portal.irc.IRCClientFactory' config (dict): Dictionary of configuration options, fed as **kwarg to protocol class' __init__ method. Raises: RuntimeError: If The correct factory class is not found. Notes: The called protocol class must have a method start() that calls the portalsession.connect() as a normal protocol. """ global _MOD_IMPORT if not _MOD_IMPORT: from evennia.utils.utils import variable_from_module as _MOD_IMPORT path, clsname = protocol_path.rsplit(".", 1) cls = _MOD_IMPORT(path, clsname) if not cls: raise RuntimeError( "ServerConnect: protocol factory '%s' not found." % protocol_path) protocol = cls(self, **config) protocol.start()
def server_connect(self, protocol_path="", config=dict()): """ Called by server to force the initialization of a new protocol instance. Server wants this instance to get a unique sessid and to be connected back as normal. This is used to initiate irc/imc2/rss etc connections. Args: protocol_path (st): Full python path to the class factory for the protocol used, eg 'evennia.server.portal.irc.IRCClientFactory' config (dict): Dictionary of configuration options, fed as **kwarg to protocol class' __init__ method. Raises: RuntimeError: If The correct factory class is not found. Notes: The called protocol class must have a method start() that calls the portalsession.connect() as a normal protocol. """ global _MOD_IMPORT if not _MOD_IMPORT: from evennia.utils.utils import variable_from_module as _MOD_IMPORT path, clsname = protocol_path.rsplit(".", 1) cls = _MOD_IMPORT(path, clsname) if not cls: raise RuntimeError("ServerConnect: protocol factory '%s' not found." % protocol_path) protocol = cls(self, **config) protocol.start()