Browse Source

make deleteObject

David Rose 24 years ago
parent
commit
cd26990977
1 changed files with 18 additions and 0 deletions
  1. 18 0
      direct/src/distributed/ClientRepository.py

+ 18 - 0
direct/src/distributed/ClientRepository.py

@@ -310,6 +310,24 @@ class ClientRepository(DirectObject.DirectObject):
     def handleDelete(self, di):
     def handleDelete(self, di):
         # Get the DO Id
         # Get the DO Id
         doId = di.getArg(STUint32)
         doId = di.getArg(STUint32)
+        self.deleteObject(doId)
+
+    def deleteObject(self, doId):
+        """deleteObject(self, doId)
+
+        Removes the object from the client's view of the world.  This
+        should normally not be called except in the case of error
+        recovery, since the server will normally be responsible for
+        deleting and disabling objects as they go out of scope.
+
+        After this is called, future updates by server on this object
+        will be ignored (with a warning message).  The object will
+        become valid again the next time the server sends a generate
+        message for this doId.
+
+        This is not a distributed message and does not delete the
+        object on the server or on any other client.
+        """
         # If it is in the dictionaries, remove it.
         # If it is in the dictionaries, remove it.
         if self.doId2do.has_key(doId):
         if self.doId2do.has_key(doId):
             obj = self.doId2do[doId]
             obj = self.doId2do[doId]