コード例 #1
0
 def setAvailable(self, available):
     DistributedDistrictAI.setAvailable(self, available)
     self.air.netMessenger.send(
         'shardStatus',
         [self.air.ourChannel, {
             'available': bool(available)
         }])
コード例 #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]
コード例 #3
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)
コード例 #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])
コード例 #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)
コード例 #6
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])
コード例 #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)
コード例 #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])
コード例 #9
0
 def __init__(self, air, mainWorld, shardType):
     DistributedDistrictAI.__init__(self, air)
     self.avatarCount = 0
     self.newAvatarCount = 0
     self.mainWorld = mainWorld
     self.shardType = shardType
コード例 #10
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])
コード例 #11
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.description = ''
     self.holidayValue = 0
コード例 #12
0
 def announceGenerate(self):
     DistributedDistrictAI.announceGenerate(self)
コード例 #13
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.created = 0
     self.ahnnLog = 0
コード例 #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)
コード例 #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])
コード例 #16
0
 def generate(self):
     DistributedDistrictAI.generate(self)
     self.air.notify.info("Generated PiratesDistrictAI at %d" %
                          (self.getDoId()))
コード例 #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])
コード例 #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])
コード例 #19
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.ahnnLog = False
     self.description = ''
     self.iconPath = ''
コード例 #20
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])
コード例 #21
0
 def setName(self, name):
     DistributedDistrictAI.setName(self, name)
     self.air.netMessenger.send('shardStatus',
                                [self.air.ourChannel, {
                                    'name': name
                                }])
コード例 #22
0
    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}])
コード例 #23
0
 def announceGenerate(self):
     DistributedDistrictAI.announceGenerate(self)
コード例 #24
0
    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)}])
コード例 #25
0
 def __init__(self, air, mainWorld, shardType):
     DistributedDistrictAI.__init__(self, air)
     self.avatarCount = 0
     self.newAvatarCount = 0
     self.mainWorld = mainWorld
     self.shardType = shardType
コード例 #26
0
 def __init__(self, air, name="untitled"):
     DistributedDistrictAI.__init__(self, air, name)
     self.stats = None
コード例 #27
0
 def generate(self):
 	DistributedDistrictAI.generate(self)
 	self.air.notify.info("Generated PiratesDistrictAI at %d" % (self.getDoId()))
コード例 #28
0
 def delete(self):
     DistributedDistrictAI.delete(self)        
     if(self.stats is not None):
         self.stats.requestDelete()
         self.stats = None
コード例 #29
0
 def __init__(self, air):
     DistributedDistrictAI.__init__(self, air)
     self.ahnnLog = False