From 19efb2d55ee7c41224d2b8cf64a7257f57ad94c1 Mon Sep 17 00:00:00 2001 From: John Loehrlein Date: Mon, 20 Oct 2008 23:04:17 +0000 Subject: [PATCH] messages to non-existant dos rerouted to handles --- .../src/distributed/ClientRepositoryBase.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/direct/src/distributed/ClientRepositoryBase.py b/direct/src/distributed/ClientRepositoryBase.py index 4e9484d727..9ac9671c29 100644 --- a/direct/src/distributed/ClientRepositoryBase.py +++ b/direct/src/distributed/ClientRepositoryBase.py @@ -555,6 +555,7 @@ class ClientRepositoryBase(ConnectionRepository): else: # This object has been fully generated. It's OK to update. self.__doUpdate(doId, di, ovUpdated) + def __doUpdate(self, doId, di, ovUpdated): # Find the DO @@ -563,8 +564,22 @@ class ClientRepositoryBase(ConnectionRepository): # Let the dclass finish the job do.dclass.receiveUpdate(do, di) elif not ovUpdated: - self.notify.warning( - "Asked to update non-existent DistObj " + str(doId)) + # this next bit is looking for friend handles so that if you get an update + # for an avatar that isn't in your doId2do table but there is a + # friend handle for that object then it's messages will be forwarded to that + # object. We are currently using that for whisper echoing + # if you need a more general perpose system consider registering proxy objects on + # a dict and adding the friend handles to that dict when they are created + # then change/remove the old method. I didn't do that because I couldn't think + # of a use for it. -JML + handle = self.identifyAvatar(doId) + if handle: + dclass = self.dclassesByName[handle.dclassName] + dclass.receiveUpdate(handle, di) + + else: + self.notify.warning( + "Asked to update non-existent DistObj " + str(doId)) def __doUpdateOwner(self, doId, di): ovObj = self.doId2ownerView.get(doId)