Esempio n. 1
0
    def partyInfoOfHostResponseUdToAi(self, partyStruct, inviteeIds):
        party = self._makePartyDict(partyStruct)
        av = self.air.doId2do.get(party['hostId'], None)
        if not av:
            return  # The host isn't on the district... wat do
        party['inviteeIds'] = inviteeIds
        partyId = party['partyId']
        # This is issued in response to a request for the party to start, essentially. So let's alloc a zone
        zoneId = self.air.allocateZone()
        self.partyId2Zone[partyId] = zoneId
        self.host2PartyId[party['hostId']] = partyId

        # We need to setup the party itself on our end, so make an ai party
        partyAI = DistributedPartyAI(self.air, party['hostId'], zoneId, party)
        partyAI.generateWithRequiredAndId(self.air.allocateChannel(),
                                          self.air.districtId, zoneId)
        self.id2Party[partyId] = partyAI

        # Alert the UD
        self.air.globalPartyMgr.d_partyStarted(partyId, self.air.ourChannel,
                                               zoneId, av.getName())

        # Don't forget this was initially started by a getPartyZone, so we better tell the host the partyzone
        self.sendUpdateToAvatarId(party['hostId'], 'receivePartyZone',
                                  [party['hostId'], partyId, zoneId])

        # And last, set up our cleanup stuff
        taskMgr.doMethodLater(PARTY_DURATION, self.closeParty,
                              'DistributedPartyManagerAI_cleanup%s' % partyId,
                              [partyId])
    def partyInfoOfHostResponseUdToAi(self, partyStruct, inviteeIds):
        party = self._makePartyDict(partyStruct)
        av = self.air.doId2do.get(party['hostId'], None)
        if not av:
            return

        party['inviteeIds'] = inviteeIds
        partyId = party['partyId']

        zoneId = self.air.allocateZone()
        self.partyId2Zone[partyId] = zoneId
        self.host2PartyId[party['hostId']] = partyId

        partyAI = DistributedPartyAI(self.air, party['hostId'], zoneId, party)
        partyAI.generateWithRequiredAndId(self.air.allocateChannel(),
                                          self.air.districtId, zoneId)
        self.id2Party[partyId] = partyAI

        self.air.globalPartyMgr.d_partyStarted(partyId, self.air.ourChannel,
                                               zoneId, av.getName())

        self.sendUpdateToAvatarId(party['hostId'], 'receivePartyZone',
                                  [party['hostId'], partyId, zoneId])

        taskMgr.doMethodLater(PARTY_DURATION, self.closeParty,
                              'DistributedPartyManagerAI_cleanup%s' % partyId,
                              [partyId])
    def partyInfoOfHostResponseUdToAi(self, partyStruct, inviteeIds):
        party = self._makePartyDict(partyStruct)
        av = self.air.doId2do.get(party['hostId'], None)
        if not av:
            return # The host isn't on the district... wat do
        party['inviteeIds'] = inviteeIds
        partyId = party['partyId']
        # This is issued in response to a request for the party to start, essentially. So let's alloc a zone
        zoneId = self.air.allocateZone()
        self.partyId2Zone[partyId] = zoneId
        self.host2PartyId[party['hostId']] = partyId

        # We need to setup the party itself on our end, so make an ai party
        partyAI = DistributedPartyAI(self.air, party['hostId'], zoneId, party)
        partyAI.generateWithRequiredAndId(self.air.allocateChannel(), self.air.districtId, zoneId)
        self.id2Party[partyId] = partyAI

        # Alert the UD
        self.air.globalPartyMgr.d_partyStarted(partyId, self.air.ourChannel, zoneId, av.getName())

        # Don't forget this was initially started by a getPartyZone, so we better tell the host the partyzone
        self.sendUpdateToAvatarId(party['hostId'], 'receivePartyZone', [party['hostId'], partyId, zoneId])

        # And last, set up our cleanup stuff
        taskMgr.doMethodLater(PARTY_DURATION, self.closeParty, 'DistributedPartyManagerAI_cleanup%s' % partyId, [partyId])
    def partyInfoOfHostResponseUdToAi(self, partyStruct, inviteeIds):
        party = self._makePartyDict(partyStruct)
        av = self.air.doId2do.get(party['hostId'], None)
        if not av:
            return
            
        party['inviteeIds'] = inviteeIds
        partyId = party['partyId']
        
        zoneId = self.air.allocateZone()
        self.partyId2Zone[partyId] = zoneId
        self.host2PartyId[party['hostId']] = partyId
        
        partyAI = DistributedPartyAI(self.air, party['hostId'], zoneId, party)
        partyAI.generateWithRequiredAndId(self.air.allocateChannel(), self.air.districtId, zoneId)
        self.id2Party[partyId] = partyAI

        self.air.globalPartyMgr.d_partyStarted(partyId, self.air.ourChannel, zoneId, av.getName())
        
        self.sendUpdateToAvatarId(party['hostId'], 'receivePartyZone', [party['hostId'], partyId, zoneId])
        
        taskMgr.doMethodLater(PARTY_DURATION, self.closeParty, 'DistributedPartyManagerAI_cleanup%s' % partyId, [partyId])