Ejemplo n.º 1
0
 def setAvailable(self, available):
     DistributedDistrictAI.setAvailable(self, available)
     self.air.netMessenger.send(
         'shardStatus',
         [self.air.ourChannel, {
             'available': bool(available)
         }])
Ejemplo n.º 2
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.avatarCount = 0
     self.newAvatarCount = 0
     self.mainWorldFile = ''
     self.shardType = PiratesGlobals.SHARD_MAIN
     self.populationLimits = [0, 0]
    def announceGenerate(self):
        DistributedDistrictAI.announceGenerate(self)

        # Remember the time of which this district was created:
        self.created = int(time.time())

        # We want to handle shard status queries so that a ShardStatusReceiver
        # being created after we're generated will know where we're at:
        self.air.netMessenger.accept('queryShardStatus', self,
                                     self.handleShardStatusQuery)

        # Send a shard status update with the information we have:
        status = {
            'available': bool(self.available),
            'name': self.name,
            'created': int(time.time())
        }
        self.air.netMessenger.send('shardStatus',
                                   [self.air.ourChannel, status])

        # Add a post remove shard status update in-case we go down:
        status = {'available': False}
        datagram = self.air.netMessenger.prepare('shardStatus',
                                                 [self.air.ourChannel, status])
        self.air.addPostRemove(datagram)
Ejemplo n.º 4
0
    def announceGenerate(self):
        DistributedDistrictAI.announceGenerate(self)

        # Remember the time of which this district was created:
        self.created = int(time.time())

        # We want to handle shard status queries so that a ShardStatusReceiver
        # being created after we're generated will know where we're at:
        self.air.accept("queryShardStatus", self.handleShardStatusQuery)

        # Send a shard status update with the information we have:
        status = {"available": bool(self.available), "name": self.name, "created": int(time.time())}
        self.air.sendNetEvent("shardStatus", [self.air.ourChannel, status])
Ejemplo n.º 5
0
 def announceGenerate(self):
     DistributedDistrictAI.announceGenerate(self)
     self.created = int(time.time())
     self.air.netMessenger.accept('queryShardStatus', self,
                                  self.handleShardStatusQuery)
     status = {
         'available': bool(self.available),
         'name': self.name,
         'created': int(time.time())
     }
     self.air.netMessenger.send('shardStatus',
                                [self.air.ourChannel, status])
     status = {'available': False}
     datagram = self.air.netMessenger.prepare('shardStatus',
                                              [self.air.ourChannel, status])
     self.air.addPostRemove(datagram)
    def announceGenerate(self):
        DistributedDistrictAI.announceGenerate(self)

        # Remember the time of which this district was created:
        self.created = int(time.time())

        # We want to handle shard status queries so that a ShardStatusReceiver
        # being created after we're generated will know where we're at:
        self.air.accept('queryShardStatus', self.handleShardStatusQuery)

        # Send a shard status update with the information we have:
        status = {
            'available': bool(self.available),
            'name': self.name,
            'created': int(time.time())
        }
        self.air.sendNetEvent('shardStatus', [self.air.ourChannel, status])
Ejemplo n.º 7
0
    def announceGenerate(self):
        DistributedDistrictAI.announceGenerate(self)

        # Remember the time of which this district was created:
        self.created = int(time.time())

        # We want to handle shard status queries so that a ShardStatusReceiver
        # being created after we're generated will know where we're at:
        self.air.netMessenger.accept('queryShardStatus', self, self.handleShardStatusQuery)

        # Send a shard status update with the information we have:
        status = {
            'available': bool(self.available),
            'name': self.name,
            'created': int(time.time())
        }
        self.air.netMessenger.send('shardStatus', [self.air.ourChannel, status])

        # Add a post remove shard status update in-case we go down:
        status = {'available': False}
        datagram = self.air.netMessenger.prepare('shardStatus', [self.air.ourChannel, status])
        self.air.addPostRemove(datagram)
Ejemplo n.º 8
0
    def setAvailable(self, available):
        DistributedDistrictAI.setAvailable(self, available)

        # Send a shard status update containing our availability:
        status = {'available': bool(available)}
        self.air.netMessenger.send('shardStatus', [self.air.ourChannel, status])
Ejemplo n.º 9
0
 def __init__(self, air, mainWorld, shardType):
     DistributedDistrictAI.__init__(self, air)
     self.avatarCount = 0
     self.newAvatarCount = 0
     self.mainWorld = mainWorld
     self.shardType = shardType
    def setName(self, name):
        DistributedDistrictAI.setName(self, name)

        # Send a shard status update containing our name:
        status = {'name': name}
        self.air.sendNetEvent('shardStatus', [self.air.ourChannel, status])
Ejemplo n.º 11
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.description = ''
     self.holidayValue = 0
Ejemplo n.º 12
0
 def announceGenerate(self):
     DistributedDistrictAI.announceGenerate(self)
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.created = 0
     self.ahnnLog = 0
Ejemplo n.º 14
0
 def generate(self):        
     DistributedDistrictAI.generate(self)
     self.stats = ToontownDistrictStatsAI.ToontownDistrictStatsAI(self.air)
     self.stats.toontownDistrictId = self.doId
     self.stats.generateOtpObject(self.stats.defaultParent, self.stats.defaultZone)
Ejemplo n.º 15
0
    def setName(self, name):
        DistributedDistrictAI.setName(self, name)

        # Send a shard status update containing our name:
        status = {'name': name}
        self.air.netMessenger.send('shardStatus', [self.air.ourChannel, status])
Ejemplo n.º 16
0
 def generate(self):
     DistributedDistrictAI.generate(self)
     self.air.notify.info("Generated PiratesDistrictAI at %d" %
                          (self.getDoId()))
Ejemplo n.º 17
0
    def setName(self, name):
        DistributedDistrictAI.setName(self, name)

        # Send a shard status update containing our name:
        status = {"name": name}
        self.air.sendNetEvent("shardStatus", [self.air.ourChannel, status])
Ejemplo n.º 18
0
    def setAvailable(self, available):
        DistributedDistrictAI.setAvailable(self, available)

        # Send a shard status update containing our availability:
        status = {"available": bool(available)}
        self.air.sendNetEvent("shardStatus", [self.air.ourChannel, status])
Ejemplo n.º 19
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.ahnnLog = False
     self.description = ''
     self.iconPath = ''
    def setAvailable(self, available):
        DistributedDistrictAI.setAvailable(self, available)

        # Send a shard status update containing our availability:
        status = {'available': bool(available)}
        self.air.sendNetEvent('shardStatus', [self.air.ourChannel, status])
Ejemplo n.º 21
0
 def setName(self, name):
     DistributedDistrictAI.setName(self, name)
     self.air.netMessenger.send('shardStatus',
                                [self.air.ourChannel, {
                                    'name': name
                                }])
    def setName(self, name):
        DistributedDistrictAI.setName(self, name)

        # Send a shard status update containing our name:
        self.air.netMessenger.send('shardStatus', [self.air.ourChannel, {'name': \
            name}])
Ejemplo n.º 23
0
 def announceGenerate(self):
     DistributedDistrictAI.announceGenerate(self)
    def setAvailable(self, available):
        DistributedDistrictAI.setAvailable(self, available)

        # Send a shard status update containing our availability:
        self.air.netMessenger.send('shardStatus', [self.air.ourChannel, {'available': \
            bool(available)}])
Ejemplo n.º 25
0
 def __init__(self, air, mainWorld, shardType):
     DistributedDistrictAI.__init__(self, air)
     self.avatarCount = 0
     self.newAvatarCount = 0
     self.mainWorld = mainWorld
     self.shardType = shardType
Ejemplo n.º 26
0
 def __init__(self, air, name="untitled"):
     DistributedDistrictAI.__init__(self, air, name)
     self.stats = None
Ejemplo n.º 27
0
 def generate(self):
 	DistributedDistrictAI.generate(self)
 	self.air.notify.info("Generated PiratesDistrictAI at %d" % (self.getDoId()))
Ejemplo n.º 28
0
 def delete(self):
     DistributedDistrictAI.delete(self)        
     if(self.stats is not None):
         self.stats.requestDelete()
         self.stats = None
Ejemplo n.º 29
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.ahnnLog = False