Import the main module properly and fix some oddities in Twisted to prevent it from discarding some data
This commit is contained in:
38
threshold
38
threshold
@@ -6,29 +6,9 @@ from twisted.internet.ssl import DefaultOpenSSLContextFactory
|
||||
#from sys import stdout
|
||||
#log.startLogging(stdout)
|
||||
|
||||
from core.main import (
|
||||
configPath,
|
||||
certPath,
|
||||
connections,
|
||||
IRCPool,
|
||||
ReactorPool,
|
||||
FactoryPool,
|
||||
MonitorPool,
|
||||
saveConf,
|
||||
loadConf,
|
||||
initMain,
|
||||
)
|
||||
import main
|
||||
|
||||
initMain()
|
||||
|
||||
from core.main import (
|
||||
config,
|
||||
keyconf,
|
||||
pool,
|
||||
help,
|
||||
wholist,
|
||||
counters,
|
||||
)
|
||||
main.initMain()
|
||||
|
||||
from utils.logging.log import *
|
||||
import modules.userinfo as userinfo
|
||||
@@ -37,14 +17,14 @@ from core.server import Server, ServerFactory
|
||||
|
||||
if __name__ == "__main__":
|
||||
listener = ServerFactory()
|
||||
if config["Listener"]["UseSSL"] == True:
|
||||
reactor.listenSSL(config["Listener"]["Port"], listener, DefaultOpenSSLContextFactory(certPath+config["Listener"]["Key"], certPath+config["Listener"]["Certificate"]), interface=config["Listener"]["Address"])
|
||||
log("Threshold running with SSL on %s:%s" % (config["Listener"]["Address"], config["Listener"]["Port"]))
|
||||
if main.config["Listener"]["UseSSL"] == True:
|
||||
reactor.listenSSL(main.config["Listener"]["Port"], listener, DefaultOpenSSLContextFactory(main.certPath+main.config["Listener"]["Key"], main.certPath+main.config["Listener"]["Certificate"]), interface=main.config["Listener"]["Address"])
|
||||
log("Threshold running with SSL on %s:%s" % (main.config["Listener"]["Address"], main.config["Listener"]["Port"]))
|
||||
else:
|
||||
reactor.listenTCP(config["Listener"]["Port"], listener, interface=config["Listener"]["Address"])
|
||||
log("Threshold running on %s:%s" % (config["Listener"]["Address"], config["Listener"]["Port"]))
|
||||
for i in pool.keys():
|
||||
if pool[i]["enabled"] == True:
|
||||
reactor.listenTCP(main.config["Listener"]["Port"], listener, interface=main.config["Listener"]["Address"])
|
||||
log("Threshold running on %s:%s" % (main.config["Listener"]["Address"], main.config["Listener"]["Port"]))
|
||||
for i in main.pool.keys():
|
||||
if main.pool[i]["enabled"] == True:
|
||||
helper.addBot(i)
|
||||
|
||||
reactor.run()
|
||||
|
||||
Reference in New Issue
Block a user