def setAvailable(self, available):
     DistributedDistrictAI.setAvailable(self, available)
     self.air.netMessenger.send(
         'shardStatus',
         [self.air.ourChannel, {
             'available': bool(available)
         }])
Example #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)
    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])
 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])
Example #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)
Example #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])
Example #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])
Example #11
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.description = ''
     self.holidayValue = 0
Example #12
0
 def announceGenerate(self):
     DistributedDistrictAI.announceGenerate(self)
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.created = 0
     self.ahnnLog = 0
Example #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)
Example #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])
 def generate(self):
     DistributedDistrictAI.generate(self)
     self.air.notify.info("Generated PiratesDistrictAI at %d" %
                          (self.getDoId()))
    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])
    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])
Example #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])
 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}])
 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)}])
 def __init__(self, air, mainWorld, shardType):
     DistributedDistrictAI.__init__(self, air)
     self.avatarCount = 0
     self.newAvatarCount = 0
     self.mainWorld = mainWorld
     self.shardType = shardType
Example #26
0
 def __init__(self, air, name="untitled"):
     DistributedDistrictAI.__init__(self, air, name)
     self.stats = None
Example #27
0
 def generate(self):
 	DistributedDistrictAI.generate(self)
 	self.air.notify.info("Generated PiratesDistrictAI at %d" % (self.getDoId()))
Example #28
0
 def delete(self):
     DistributedDistrictAI.delete(self)        
     if(self.stats is not None):
         self.stats.requestDelete()
         self.stats = None
Example #29
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.ahnnLog = False