Browse Source

minor distributed object fixes

David Rose 16 years ago
parent
commit
d4679444ef

+ 11 - 1
direct/src/distributed/ClientRepository.py

@@ -40,6 +40,9 @@ class ClientRepository(ClientRepositoryBase):
         # processed.
         # processed.
         self.currentSenderId = None
         self.currentSenderId = None
 
 
+        # Explicitly-requested interest zones.
+        self.interestZones = []
+
     def handleSetDoIdrange(self, di):
     def handleSetDoIdrange(self, di):
         self.doIdBase = di.getUint32()
         self.doIdBase = di.getUint32()
         self.doIdLast = self.doIdBase + di.getUint32()
         self.doIdLast = self.doIdBase + di.getUint32()
@@ -136,6 +139,12 @@ class ClientRepository(ClientRepositoryBase):
         assert self.isLocalId(doId)
         assert self.isLocalId(doId)
         self.doIdAllocator.free(doId)
         self.doIdAllocator.free(doId)
 
 
+    def storeObjectLocation(self, object, parentId, zoneId):
+        # The CMU implementation doesn't use the DoCollectionManager
+        # much.
+        object.parentId = parentId
+        object.zoneId = zoneId
+
     def createDistributedObject(self, className = None, distObj = None,
     def createDistributedObject(self, className = None, distObj = None,
                                 zoneId = 0, optionalFields = None,
                                 zoneId = 0, optionalFields = None,
                                 doId = None):
                                 doId = None):
@@ -230,7 +239,7 @@ class ClientRepository(ClientRepositoryBase):
     def setInterestZones(self, interestZoneIds):
     def setInterestZones(self, interestZoneIds):
         """ Changes the set of zones that this particular client is
         """ Changes the set of zones that this particular client is
         interested in hearing about. """
         interested in hearing about. """
-        
+
         datagram = PyDatagram()
         datagram = PyDatagram()
         # Add message type
         # Add message type
         datagram.addUint16(CLIENT_SET_INTEREST_CMU)
         datagram.addUint16(CLIENT_SET_INTEREST_CMU)
@@ -240,6 +249,7 @@ class ClientRepository(ClientRepositoryBase):
 
 
         # send the message
         # send the message
         self.send(datagram)
         self.send(datagram)
+        self.interestZones = interestZoneIds[:]
 
 
     def setObjectZone(self, distObj, zoneId):
     def setObjectZone(self, distObj, zoneId):
         """ Moves the object into the indicated zone. """
         """ Moves the object into the indicated zone. """

+ 8 - 0
direct/src/distributed/DistributedObjectAI.py

@@ -88,12 +88,20 @@ class DistributedObjectAI(DistributedObjectBase):
         if delEvent:
         if delEvent:
             messenger.send(delEvent)
             messenger.send(delEvent)
 
 
+    def getCacheable(self):
+        """ This method exists only to mirror the similar method on
+        DistributedObject.  AI objects aren't cacheable. """
+        return False
+
     def deleteOrDelay(self):
     def deleteOrDelay(self):
         """ This method exists only to mirror the similar method on
         """ This method exists only to mirror the similar method on
         DistributedObject.  AI objects don't have delayDelete, they
         DistributedObject.  AI objects don't have delayDelete, they
         just get deleted immediately. """
         just get deleted immediately. """
         self.delete()
         self.delete()
 
 
+    def getDelayDeleteCount(self):
+        return 0
+
     def delete(self):
     def delete(self):
         """
         """
         Inheritors should redefine this to take appropriate action on delete
         Inheritors should redefine this to take appropriate action on delete