#!/usr/bin/env python from twisted.internet import reactor from twisted.internet.ssl import DefaultOpenSSLContextFactory #from twisted.python import log #from sys import stdout #log.startLogging(stdout) from core.main import ( numbers, configPath, certPath, listener, connections, IRCPool, ReactorPool, FactoryPool, MonitorPool, saveConf, loadConf, initMain, ) initMain() from core.main import ( config, keyconf, pool, help, wholist, counters, ) from utils.logging.log import * import modules.userinfo as userinfo import core.helper as helper from core.server import Server, ServerFactory if __name__ == "__main__": for i in pool.keys(): if pool[i]["enabled"] == True: helper.addBot(i) 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"])) else: reactor.listenTCP(config["Listener"]["Port"], listener, interface=config["Listener"]["Address"]) log("Threshold running on %s:%s" % (config["Listener"]["Address"], config["Listener"]["Port"])) reactor.run()