Esempio n. 1
0
 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)
Esempio n. 2
0
 def __init__(self):
     if Utils.getOS() == 'windows':
         from ctypes import windll
         kernel = windll.kernel32
         kernel.SetConsoleMode(kernel.GetStdHandle(-11), 7)
     self.BOLD = '\x1b[1m'
     self.OBFUSCATED = ''
     self.ITALIC = '\x1b[3m'
     self.UNDERLINE = '\x1b[4m'
     self.STRIKETHROUGH = '\x1b[9m'
     self.RESET = '\x1b[m'
     self.BLACK = '\x1b[38;5;16m'
     self.DARKBLUE = '\x1b[38;5;19m'
     self.DARKGREEN = '\x1b[38;5;34m'
     self.DARKAQUA = '\x1b[38;5;37m'
     self.DARKRED = '\x1b[38;5;124m'
     self.PURPLE = '\x1b[38;5;127m'
     self.GOLD = '\x1b[38;5;214m'
     self.GRAY = '\x1b[38;5;145m'
     self.DARKGRAY = '\x1b[38;5;59m'
     self.BLUE = '\x1b[38;5;63m'
     self.GREEN = '\x1b[38;5;83m'
     self.AQUA = '\x1b[38;5;87m'
     self.RED = '\x1b[38;5;203m'
     self.LIGHTPURPLE = '\x1b[38;5;207m'
     self.YELLOW = '\x1b[38;5;227m'
     self.WHITE = '\x1b[38;5;231m'