Beispiel #1
0
    def __init__(self, path, withWizard, isTravisBuild=False):
        super().__init__()
        startTime = Utils.microtime(True)
        self.path = path
        self.withWizard = withWizard
        if (withWizard):
            ServerFS.checkAllFiles(path)
        else:
            Wizard.skipWizard(path, True)
        port = self.port
        print(str(self.podrumLogo))
        Wizard.isInWizard = False
        Logger.log(
            'info',
            str(Base.get("startingServer")).replace(
                "{ip}",
                str(Utils.getPrivateIpAddress())).replace("{port}", str(port)))
        Logger.log(
            'info',
            str(Base.get("extIpMsg")).replace("{ipPublic}",
                                              str(Utils.getPublicIpAddress())))
        Logger.log('info', str(Base.get("license")))
        server = PyRakLibServer(port=19132)
        handler = ServerHandler(server, None)
        handler.sendOption(
            "name",
            "MCPE;Podrum powered server;407;1.16.0;0;0;0;PodrumPoweredServer;0"
        )
        repeter = 0
        while repeater >= 1:
            pass  # Here is going to be the place for the packet handling

        doneTime = Utils.microtime(True)
        finishStartupSeconds = "%.3f" % (doneTime - startTime)
        Logger.log(
            'info',
            f'Done in {str(finishStartupSeconds)}s. Type "help" to view all available commands.'
        )
        if (isTravisBuild):
            Server.checkTravisBuild(path)
        else:
            while Wizard.isInWizard == False:
                cmd = input('> ')
                Server.command(cmd, True)
                cmd = None
            ticking = True
            while ticking:
                time.sleep(0.002)
Beispiel #2
0
 def __init__(self, path, withWizard, isTravisBuild=False):
     super().__init__()
     startTime = Utils.microtime(True)
     self.path = path
     self.withWizard = withWizard
     self.tickrate = 20 / 1000
     if (withWizard):
         ServerFS.checkAllFiles(path)
     else:
         Wizard.skipWizard(path, True)
     print(str(self.podrumLogo))
     Wizard.isInWizard = False
     Logger.log(
         'info',
         str(Base.get("startingServer")).replace(
             "{ip}", str(Utils.getPrivateIpAddress())).replace(
                 "{port}", str(self.port)))
     Logger.log(
         'info',
         str(Base.get("extIpMsg")).replace("{ipPublic}",
                                           str(Utils.getPublicIpAddress())))
     Logger.log('info', str(Base.get("license")))
     PluginLoader.loadAll()
     doneTime = Utils.microtime(True)
     self.queryHandler = QueryHandler(self)
     self.mainInterface = NetworkInterface(self)
     self.mainInterface.process()
     finishStartupSeconds = "%.3f" % (doneTime - startTime)
     Logger.log(
         'info',
         f'Done in {str(finishStartupSeconds)}s. Type "help" to view all available commands.'
     )
     if (isTravisBuild):
         Server.checkTravisBuild(path)
     else:
         while Wizard.isInWizard == False:
             cmd = input('> ')
             Server.command(cmd, True)
             cmd = None
         ticking = True
         while ticking:
             time.sleep(self.tickrate)