mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
distributed: Make a few slight cleanliness changes
I brought all of these over from the Astron fork
This commit is contained in:
parent
aaeb925e84
commit
97368ec321
@ -2,6 +2,8 @@ from direct.distributed.CachedDOData import CachedDOData
|
|||||||
from panda3d.core import ConfigVariableInt
|
from panda3d.core import ConfigVariableInt
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = ["CRDataCache"]
|
||||||
|
|
||||||
class CRDataCache:
|
class CRDataCache:
|
||||||
# Stores cached data for DistributedObjects between instantiations on the client
|
# Stores cached data for DistributedObjects between instantiations on the client
|
||||||
|
|
||||||
|
@ -263,7 +263,7 @@ class ClientRepositoryBase(ConnectionRepository):
|
|||||||
distObj.setLocation(parentId, zoneId)
|
distObj.setLocation(parentId, zoneId)
|
||||||
distObj.updateRequiredFields(dclass, di)
|
distObj.updateRequiredFields(dclass, di)
|
||||||
# updateRequiredFields calls announceGenerate
|
# updateRequiredFields calls announceGenerate
|
||||||
print("New DO:%s, dclass:%s"%(doId, dclass.getName()))
|
self.notify.debug("New DO:%s, dclass:%s" % (doId, dclass.getName()))
|
||||||
return distObj
|
return distObj
|
||||||
|
|
||||||
def generateWithRequiredOtherFields(self, dclass, doId, di,
|
def generateWithRequiredOtherFields(self, dclass, doId, di,
|
||||||
|
@ -10,6 +10,7 @@ from .PyDatagramIterator import PyDatagramIterator
|
|||||||
import types
|
import types
|
||||||
import gc
|
import gc
|
||||||
|
|
||||||
|
__all__ = ["ConnectionRepository", "GCTrigger"]
|
||||||
|
|
||||||
class ConnectionRepository(
|
class ConnectionRepository(
|
||||||
DoInterestManager, DoCollectionManager, CConnectionRepository):
|
DoInterestManager, DoCollectionManager, CConnectionRepository):
|
||||||
|
@ -15,6 +15,8 @@ class DistributedNode(DistributedObject.DistributedObject, NodePath):
|
|||||||
self.DistributedNode_initialized = 1
|
self.DistributedNode_initialized = 1
|
||||||
self.gotStringParentToken = 0
|
self.gotStringParentToken = 0
|
||||||
DistributedObject.DistributedObject.__init__(self, cr)
|
DistributedObject.DistributedObject.__init__(self, cr)
|
||||||
|
if not self.this:
|
||||||
|
NodePath.__init__(self, "DistributedNode")
|
||||||
|
|
||||||
# initialize gridParent
|
# initialize gridParent
|
||||||
self.gridParent = None
|
self.gridParent = None
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
#from otp.ai.AIBaseGlobal import *
|
|
||||||
from .DistributedObjectUD import DistributedObjectUD
|
from .DistributedObjectUD import DistributedObjectUD
|
||||||
|
|
||||||
class DistributedNodeUD(DistributedObjectUD):
|
class DistributedNodeUD(DistributedObjectUD):
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
from direct.showbase.DirectObject import DirectObject
|
from direct.showbase.DirectObject import DirectObject
|
||||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||||
|
|
||||||
@ -93,3 +92,11 @@ class DistributedObjectBase(DirectObject):
|
|||||||
|
|
||||||
def hasParentingRules(self):
|
def hasParentingRules(self):
|
||||||
return self.dclass.getFieldByName('setParentingRules') != None
|
return self.dclass.getFieldByName('setParentingRules') != None
|
||||||
|
|
||||||
|
def delete(self):
|
||||||
|
"""
|
||||||
|
Override this to handle cleanup right before this object
|
||||||
|
gets deleted.
|
||||||
|
"""
|
||||||
|
|
||||||
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user