Renovate the module system and implement adding and resuming pool instances using the new relay/alias/network system

This commit is contained in:
2019-01-26 18:58:21 +00:00
parent 4efea3f535
commit 8926cb76ec
37 changed files with 184 additions and 302 deletions

View File

@@ -1,8 +1,9 @@
import main
from core.bot import deliverRelayCommands
class Disable:
def __init__(self, register):
register("disable", self.disable)
def __init__(self, *args):
self.disable(*args)
def disable(self, addr, authed, data, obj, spl, success, failure, info, incUsage, length):
if authed:
@@ -11,6 +12,11 @@ class Disable:
failure("Name does not exist: %s" % spl[1])
return
main.pool[spl[1]]["enabled"] = False
user = main.pool[spl[1]]["alias"]
network = main.pool[spl[1]]["network"]
relay = main.pool[spl[1]]["relay"]
commands = {"status": ["Disconnect"]}
deliverRelayCommands(relay, commands, user=user+"/"+network)
main.saveConf("pool")
if spl[1] in main.ReactorPool.keys():
if spl[1] in main.FactoryPool.keys():