From df4b19725c2ec632035b6beef92102719d716507 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Wed, 18 Apr 2007 06:31:13 +0000 Subject: [PATCH] log and send server event if DOAI is created with parentId of 4294967295 (32-bit -1, unsigned) --- direct/src/distributed/DistributedObjectAI.py | 9 +++++++++ direct/src/distributed/DoCollectionManager.py | 2 ++ 2 files changed, 11 insertions(+) diff --git a/direct/src/distributed/DistributedObjectAI.py b/direct/src/distributed/DistributedObjectAI.py index d3e2528d69..2ef09a50fb 100644 --- a/direct/src/distributed/DistributedObjectAI.py +++ b/direct/src/distributed/DistributedObjectAI.py @@ -198,11 +198,20 @@ class DistributedObjectAI(DistributedObjectBase, EnforcesCalldowns): def d_setLocation(self, parentId, zoneId): self.air.sendSetLocation(self, parentId, zoneId) + def checkFFparentId(self, parentId): + if parentId == 4294967295: + msg = 'DOAI.setLocation, parentId == 4294967295, doId = %s, class = %s, stack = %s' % ( + self.doId, self.__class__.__name__, PythonUtil.StackTrace().compact()) + print msg + self.air.writeServerEvent('parentIdFFFFFFFF', self.doId, msg) + def setLocation(self, parentId, zoneId): # Prevent Duplicate SetLocations for being Called if (self.parentId == parentId) and (self.zoneId == zoneId): return + self.checkFFparentId(parentId) + oldParentId = self.parentId oldZoneId = self.zoneId self.air.storeObjectLocation(self, parentId, zoneId) diff --git a/direct/src/distributed/DoCollectionManager.py b/direct/src/distributed/DoCollectionManager.py index 77921e7f90..ed7395521b 100755 --- a/direct/src/distributed/DoCollectionManager.py +++ b/direct/src/distributed/DoCollectionManager.py @@ -241,6 +241,8 @@ class DoCollectionManager: #assert len(self._doHierarchy) == len(self.doId2do) # Set the new parent and zone on the object + if hasattr(object, 'checkFFparentId'): + object.checkFFparentId(parentId) object.parentId = parentId object.zoneId = zoneId