mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
minor distributed object fixes
This commit is contained in:
parent
ba493a7a96
commit
d4679444ef
@ -40,6 +40,9 @@ class ClientRepository(ClientRepositoryBase):
|
||||
# processed.
|
||||
self.currentSenderId = None
|
||||
|
||||
# Explicitly-requested interest zones.
|
||||
self.interestZones = []
|
||||
|
||||
def handleSetDoIdrange(self, di):
|
||||
self.doIdBase = di.getUint32()
|
||||
self.doIdLast = self.doIdBase + di.getUint32()
|
||||
@ -136,6 +139,12 @@ class ClientRepository(ClientRepositoryBase):
|
||||
assert self.isLocalId(doId)
|
||||
self.doIdAllocator.free(doId)
|
||||
|
||||
def storeObjectLocation(self, object, parentId, zoneId):
|
||||
# The CMU implementation doesn't use the DoCollectionManager
|
||||
# much.
|
||||
object.parentId = parentId
|
||||
object.zoneId = zoneId
|
||||
|
||||
def createDistributedObject(self, className = None, distObj = None,
|
||||
zoneId = 0, optionalFields = None,
|
||||
doId = None):
|
||||
@ -230,7 +239,7 @@ class ClientRepository(ClientRepositoryBase):
|
||||
def setInterestZones(self, interestZoneIds):
|
||||
""" Changes the set of zones that this particular client is
|
||||
interested in hearing about. """
|
||||
|
||||
|
||||
datagram = PyDatagram()
|
||||
# Add message type
|
||||
datagram.addUint16(CLIENT_SET_INTEREST_CMU)
|
||||
@ -240,6 +249,7 @@ class ClientRepository(ClientRepositoryBase):
|
||||
|
||||
# send the message
|
||||
self.send(datagram)
|
||||
self.interestZones = interestZoneIds[:]
|
||||
|
||||
def setObjectZone(self, distObj, zoneId):
|
||||
""" Moves the object into the indicated zone. """
|
||||
|
@ -88,12 +88,20 @@ class DistributedObjectAI(DistributedObjectBase):
|
||||
if delEvent:
|
||||
messenger.send(delEvent)
|
||||
|
||||
def getCacheable(self):
|
||||
""" This method exists only to mirror the similar method on
|
||||
DistributedObject. AI objects aren't cacheable. """
|
||||
return False
|
||||
|
||||
def deleteOrDelay(self):
|
||||
""" This method exists only to mirror the similar method on
|
||||
DistributedObject. AI objects don't have delayDelete, they
|
||||
just get deleted immediately. """
|
||||
self.delete()
|
||||
|
||||
def getDelayDeleteCount(self):
|
||||
return 0
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
Inheritors should redefine this to take appropriate action on delete
|
||||
|
Loading…
x
Reference in New Issue
Block a user