Beispiel #1
0
 def run(self):
     self.__startTime = curTime()
     self.__printHeader()
     self.onInitialize()
     self._body()
     self.onFinalize()
     self.__endTime = curTime()
     self.__durationSecs = self.__endTime - self.__startTime
     self.__printFooter()
Beispiel #2
0
        def remote_resurrectionRequest(self,publicName,xpRecover,healthRecover,manaRecover,staminaRecover,tm,cname):
            for p in self.world.activePlayers:
                if p.zone and p in p.zone.players:
                    if p.party.members[0].name == cname and p.party.members[0].deathZone:
                        #got it and we are on this cluster
                        if p.resurrectionRequest:
                            timer = p.resurrectionRequest[0]
                            if curTime() - timer < 30:
                                return

                        p.resurrectionRequest = (curTime(),xpRecover,healthRecover,manaRecover,staminaRecover,cname)
                        p.mind.callRemote("resurrectionRequest",publicName,xpRecover)
                        return
        def remote_resurrectionRequest(self,publicName,xpRecover,healthRecover,manaRecover,staminaRecover,tm,cname):
            for p in self.world.activePlayers:
                if p.zone and p in p.zone.players:
                    if p.party.members[0].name == cname and p.party.members[0].deathZone:
                        #got it and we are on this cluster
                        if p.resurrectionRequest:
                            timer = p.resurrectionRequest[0]
                            if curTime() - timer < 30:
                                return

                        p.resurrectionRequest = (curTime(),xpRecover,healthRecover,manaRecover,staminaRecover,cname)
                        p.mind.callRemote("resurrectionRequest",publicName,xpRecover)
                        return
Beispiel #4
0
    def main():
        print "####Starting world server"
        from twisted.python import log

        LOG = not USE_WX

        if SSH_ENABLED:
            print "Security Warning: SSH Enabled on port %i for ip addresses:"%SSH_PORT,SSH_IPS
            from manhole import MakeFactory
            ips = SSH_IPS
            f= MakeFactory(ips,"me","me")
            reactor.listenTCP(SSH_PORT, f)


        if LOG:
            fname = "./logs/WorldServer.txt"
            if CLUSTER != -1:
                fname = "./logs/ZoneCluster%i.txt"%CLUSTER

            LOGFILE = file(fname,"w")
            log.startLogging(LOGFILE)


        #kickstart the heart
        print "####Getting world info"
        world = World.byName("TheWorld")
        world.frozen = FROZEN
        world.clusterNum = CLUSTER
        world.worldPort = WORLDPORT

        world.launchTime = curTime()
        world.liveZoneCallback = LiveZoneCallback
        world.startup()
        world.transactionTick()
        world.tick()

        reactor.callLater(0,LaunchWorld)
        reactor.addSystemEventTrigger('before', 'shutdown', world.shutdown)
        reactor.run()

        #world.shutdown()

        if LOG:
            LOGFILE.close()
    def main():

        from twisted.python import log

        LOG = not USE_WX

        if SSH_ENABLED:
            print "Security Warning: SSH Enabled on port %i for ip addresses:"%SSH_PORT,SSH_IPS
            from manhole import MakeFactory
            ips = SSH_IPS
            f= MakeFactory(ips,"me","me")
            reactor.listenTCP(SSH_PORT, f)


        if LOG:
            fname = "./log_WorldServer.txt"
            if CLUSTER != -1:
                fname = "./log_ZoneCluster%i.txt"%CLUSTER

            LOGFILE = file(fname,"w")
            log.startLogging(LOGFILE)


        #kickstart the heart
        world = World.byName("TheWorld")
        world.frozen = FROZEN
        world.clusterNum = CLUSTER
        world.worldPort = WORLDPORT

        world.launchTime = curTime()
        world.liveZoneCallback = LiveZoneCallback
        world.startup()
        world.transactionTick()
        world.tick()

        reactor.callLater(0,LaunchWorld)
        reactor.addSystemEventTrigger('before', 'shutdown', world.shutdown)
        reactor.run()

        #world.shutdown()

        if LOG:
            LOGFILE.close()