log and send server event if DOAI is created with parentId of 4294967295 (32-bit -1, unsigned)

This commit is contained in:
Darren Ranalli 2007-04-18 06:31:13 +00:00
parent c6fdac34e3
commit df4b19725c
2 changed files with 11 additions and 0 deletions

View File

@ -198,11 +198,20 @@ class DistributedObjectAI(DistributedObjectBase, EnforcesCalldowns):
def d_setLocation(self, parentId, zoneId): def d_setLocation(self, parentId, zoneId):
self.air.sendSetLocation(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): def setLocation(self, parentId, zoneId):
# Prevent Duplicate SetLocations for being Called # Prevent Duplicate SetLocations for being Called
if (self.parentId == parentId) and (self.zoneId == zoneId): if (self.parentId == parentId) and (self.zoneId == zoneId):
return return
self.checkFFparentId(parentId)
oldParentId = self.parentId oldParentId = self.parentId
oldZoneId = self.zoneId oldZoneId = self.zoneId
self.air.storeObjectLocation(self, parentId, zoneId) self.air.storeObjectLocation(self, parentId, zoneId)

View File

@ -241,6 +241,8 @@ class DoCollectionManager:
#assert len(self._doHierarchy) == len(self.doId2do) #assert len(self._doHierarchy) == len(self.doId2do)
# Set the new parent and zone on the object # Set the new parent and zone on the object
if hasattr(object, 'checkFFparentId'):
object.checkFFparentId(parentId)
object.parentId = parentId object.parentId = parentId
object.zoneId = zoneId object.zoneId = zoneId