mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
guarantee that announceGenerate is called before non-required fields are received.
This commit is contained in:
parent
0b96f7c651
commit
923bf3f465
@ -120,7 +120,7 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
||||
distObj = self.doId2do[doId]
|
||||
distObj.generate()
|
||||
distObj.updateRequiredFields(cdc, di)
|
||||
distObj.announceGenerate()
|
||||
# updateRequiredFields calls announceGenerate
|
||||
|
||||
# Is it in the cache? If so, pull it out, put it in the dictionaries,
|
||||
# and update it.
|
||||
@ -133,7 +133,7 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
||||
# and update it.
|
||||
distObj.generate()
|
||||
distObj.updateRequiredFields(cdc, di)
|
||||
distObj.announceGenerate()
|
||||
# updateRequiredFields calls announceGenerate
|
||||
|
||||
# If it is not in the dictionary or the cache, then...
|
||||
else:
|
||||
@ -148,7 +148,7 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
||||
distObj.generateInit() # Only called when constructed
|
||||
distObj.generate()
|
||||
distObj.updateRequiredFields(cdc, di)
|
||||
distObj.announceGenerate()
|
||||
# updateRequiredFields calls announceGenerate
|
||||
|
||||
return distObj
|
||||
|
||||
@ -159,7 +159,7 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
||||
distObj = self.doId2do[doId]
|
||||
distObj.generate()
|
||||
distObj.updateRequiredOtherFields(cdc, di)
|
||||
distObj.announceGenerate()
|
||||
# updateRequiredOtherFields calls announceGenerate
|
||||
|
||||
# Is it in the cache? If so, pull it out, put it in the dictionaries,
|
||||
# and update it.
|
||||
@ -172,7 +172,7 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
||||
# and update it.
|
||||
distObj.generate()
|
||||
distObj.updateRequiredOtherFields(cdc, di)
|
||||
distObj.announceGenerate()
|
||||
# updateRequiredOtherFields calls announceGenerate
|
||||
|
||||
# If it is not in the dictionary or the cache, then...
|
||||
else:
|
||||
@ -189,7 +189,7 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
||||
distObj.generateInit() # Only called when constructed
|
||||
distObj.generate()
|
||||
distObj.updateRequiredOtherFields(cdc, di)
|
||||
distObj.announceGenerate()
|
||||
# updateRequiredOtherFields calls announceGenerate
|
||||
|
||||
return distObj
|
||||
|
||||
|
@ -188,21 +188,27 @@ class DistributedObject(PandaObject):
|
||||
def updateRequiredFields(self, cdc, di):
|
||||
for i in cdc.broadcastRequiredCDU:
|
||||
i.updateField(cdc, self, di)
|
||||
self.announceGenerate()
|
||||
|
||||
def updateAllRequiredFields(self, cdc, di):
|
||||
for i in cdc.allRequiredCDU:
|
||||
i.updateField(cdc, self, di)
|
||||
self.announceGenerate()
|
||||
|
||||
def updateRequiredOtherFields(self, cdc, di):
|
||||
# First, update the required fields
|
||||
for i in cdc.broadcastRequiredCDU:
|
||||
i.updateField(cdc, self, di)
|
||||
|
||||
# Announce generate after updating all the required fields,
|
||||
# but before we update the non-required fields.
|
||||
self.announceGenerate()
|
||||
|
||||
# Determine how many other fields there are
|
||||
numberOfOtherFields = di.getArg(STUint16)
|
||||
# Update each of the other fields
|
||||
for i in range(numberOfOtherFields):
|
||||
cdc.updateField(self, di)
|
||||
return None
|
||||
|
||||
def sendUpdate(self, fieldName, args = [], sendToId = None):
|
||||
self.cr.sendUpdate(self, fieldName, args, sendToId)
|
||||
|
Loading…
x
Reference in New Issue
Block a user