bcolors.YELLOW) except: consoleHelper.printColored( "[!] Error while starting Datadog client! Please check your config.ini and run the server again", bcolors.RED) # Connect to pubsub channels pubSub.listener(glob.redis, { "lets:beatmap_updates": beatmapUpdateHandler.handler(), }).start() # Server start message and console output consoleHelper.printColored( "> L.E.T.S. is listening for clients on {}:{}...".format( glob.conf.config["server"]["host"], serverPort), bcolors.GREEN) log.logMessage("Server started!", discord="bunker", stdout=False) # DUMMY TEST BUAT GA CLOSE CONNECTION KE MYSQL CONNECT thx to @ReiFan49 def ping(): try: glob.db.execute("SELECT 1+1") #SOLUSI BIAR CEPAT MENINGGAL #os.execv(sys.executable, [sys.executable] + sys.argv) log.info("[AUTOMATED QUERY] has been execute!") except: log.info( "[AUTOMATED QUERY] error! the connection will restart!") #os.execv(sys.executable, [sys.executable] + sys.argv) //automated restart lets when error glob.db = dbConnector.db( glob.conf.config["db"]["host"], glob.conf.config["db"]["username"],
"[!] Error while starting Datadog client! Please check your config.ini and run the server again", bcolors.RED) # IRC start message and console output glob.irc = generalUtils.stringToBool(glob.conf.config["irc"]["enable"]) if glob.irc: # IRC port ircPort = 0 try: ircPort = int(glob.conf.config["irc"]["port"]) except ValueError: consoleHelper.printColored( "[!] Invalid IRC port! Please check your config.ini and run the server again", bcolors.RED) log.logMessage("IRC server started!", discord="bunker", of="info.txt", stdout=False) consoleHelper.printColored( "> IRC server listening on 127.0.0.1:{}...".format(ircPort), bcolors.GREEN) threading.Thread( target=lambda: ircserver.main(port=ircPort)).start() else: consoleHelper.printColored("[!] Warning! IRC server is disabled!", bcolors.YELLOW) # Server port serverPort = 0 try: serverPort = int(glob.conf.config["server"]["port"]) except ValueError:
glob.conf.config["datadog"]["appkey"]) else: consoleHelper.printColored( "[!] Warning! Datadog stats tracking is disabled!", bcolors.YELLOW) except: consoleHelper.printColored( "[!] Error while starting Datadog client! Please check your config.ini and run the server again", bcolors.RED) # Connect to pubsub channels pubSub.listener(glob.redis, { "lets:beatmap_updates": beatmapUpdateHandler.handler(), }).start() # Server start message and console output consoleHelper.printColored( "> L.E.T.S. is listening for clients on {}:{}...".format( glob.conf.config["server"]["host"], serverPort), bcolors.GREEN) log.logMessage("OSS started!", discord="bunker", stdout=False) # Start Tornado glob.application.listen(serverPort, address=glob.conf.config["server"]["host"]) tornado.ioloop.IOLoop.instance().start() finally: # Perform some clean up print("> Disposing server... ") log.logMessage("OSS stoping!", discord="bunker", stdout=False) glob.fileBuffers.flushAll() consoleHelper.printColored("Goodbye!", bcolors.GREEN)