|
@@ -37,7 +37,7 @@ class DistributedObject(PandaObject):
|
|
|
self.cr = cr
|
|
self.cr = cr
|
|
|
if wantOtpServer:
|
|
if wantOtpServer:
|
|
|
# Location stores the parentId, zoneId of this object
|
|
# Location stores the parentId, zoneId of this object
|
|
|
- self.__location = (None, None)
|
|
|
|
|
|
|
+ self.location = (None, None)
|
|
|
|
|
|
|
|
# Most DistributedObjects are simple and require no real
|
|
# Most DistributedObjects are simple and require no real
|
|
|
# effort to load. Some, particularly actors, may take
|
|
# effort to load. Some, particularly actors, may take
|
|
@@ -156,8 +156,8 @@ class DistributedObject(PandaObject):
|
|
|
self.activeState = ESDisabled
|
|
self.activeState = ESDisabled
|
|
|
self.__callbacks = {}
|
|
self.__callbacks = {}
|
|
|
if wantOtpServer:
|
|
if wantOtpServer:
|
|
|
- #self.cr.deleteObjectLocation(self.doId, self.__location[0], self.__location[1])
|
|
|
|
|
- self.__location = (None, None)
|
|
|
|
|
|
|
+ #self.cr.deleteObjectLocation(self.doId, self.location[0], self.location[1])
|
|
|
|
|
+ self.location = (None, None)
|
|
|
# TODO: disable my children
|
|
# TODO: disable my children
|
|
|
|
|
|
|
|
def isDisabled(self):
|
|
def isDisabled(self):
|
|
@@ -349,13 +349,13 @@ class DistributedObject(PandaObject):
|
|
|
self.cr.sendSetLocation(self.doId, parentId, zoneId)
|
|
self.cr.sendSetLocation(self.doId, parentId, zoneId)
|
|
|
|
|
|
|
|
def setLocation(self, parentId, zoneId):
|
|
def setLocation(self, parentId, zoneId):
|
|
|
- self.notify.info("setLocation: %s parentId: %s zoneId: %s" % (self.doId, parentId, zoneId))
|
|
|
|
|
|
|
+ #self.notify.info("setLocation: %s parentId: %s zoneId: %s" % (self.doId, parentId, zoneId))
|
|
|
# The store must run first so we know the old location
|
|
# The store must run first so we know the old location
|
|
|
#self.cr.storeObjectLocation(self.doId, parentId, zoneId)
|
|
#self.cr.storeObjectLocation(self.doId, parentId, zoneId)
|
|
|
- self.__location = (parentId, zoneId)
|
|
|
|
|
- # init the parentId and zoneId
|
|
|
|
|
|
|
+ self.location = (parentId, zoneId)
|
|
|
self.parentId = parentId
|
|
self.parentId = parentId
|
|
|
self.zoneId = zoneId
|
|
self.zoneId = zoneId
|
|
|
|
|
+
|
|
|
# Give the parent a chance to run code when a new child
|
|
# Give the parent a chance to run code when a new child
|
|
|
# sets location to it. For example, the parent may want to
|
|
# sets location to it. For example, the parent may want to
|
|
|
# scene graph reparent the child to some subnode it owns.
|
|
# scene graph reparent the child to some subnode it owns.
|
|
@@ -364,7 +364,7 @@ class DistributedObject(PandaObject):
|
|
|
parentObj.handleChildSetLocation(self, zoneId)
|
|
parentObj.handleChildSetLocation(self, zoneId)
|
|
|
|
|
|
|
|
def getLocation(self):
|
|
def getLocation(self):
|
|
|
- return self.__location
|
|
|
|
|
|
|
+ return self.location
|
|
|
|
|
|
|
|
def handleChildSetLocation(self, childObj, zoneId):
|
|
def handleChildSetLocation(self, childObj, zoneId):
|
|
|
self.notify.info("handleChildSetLocation: %s childId: %s zoneId: %s" %
|
|
self.notify.info("handleChildSetLocation: %s childId: %s zoneId: %s" %
|