def __init__(self, withWizard): super().__init__() self.startTime = time() if Utils.getOS() == "windows": Utils.enableWindowsFormating() if Utils.isPacked(): print(Utils.getPodrumDir()) Base.addFromZipDir(Utils.getPodrumDir(), "podrum/lang/languages") else: Base.addFromDir(Utils.getPodrumDir() + "/" + "podrum/lang/languages") if not Utils.checkAllFiles() and withWizard: Wizard.start() while Wizard.isInWizard: pass self.config = Utils.getDefaultConfig() self.ip = self.config.config["server-ip"] self.port = int(self.config.config["server-port"]) print(str(self.podrumLogo)) Logger.info(str(Base.getTranslation("startingServer")).replace("{ip}", str(self.ip)).replace("{port}", str(self.port))) Logger.info(str(Base.getTranslation("license"))) RegisterVanilla() Plugin.pluginsDir = os.getcwd() + "/plugins" Plugin.server = self Plugin.loadAll() self.endTime = time() self.timeDiff = "%.3f" % (self.endTime - self.startTime) Logger.info(f'Done in {str(self.timeDiff)}s. Type "help" to view all available commands.') CommandReader(self) Interface(self.ip, self.port) while self.isTicking: sleep(self.tickrate)
def sendMessage(self, message): Logger.info(message)
def onCloseConnection(self, address, reason): Logger.info(f"{address.address} disconnected due to {reason}")