mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -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
|
||||
|
||||
|
||||
__all__ = ["CRDataCache"]
|
||||
|
||||
class CRDataCache:
|
||||
# Stores cached data for DistributedObjects between instantiations on the client
|
||||
|
||||
|
@ -263,7 +263,7 @@ class ClientRepositoryBase(ConnectionRepository):
|
||||
distObj.setLocation(parentId, zoneId)
|
||||
distObj.updateRequiredFields(dclass, di)
|
||||
# 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
|
||||
|
||||
def generateWithRequiredOtherFields(self, dclass, doId, di,
|
||||
|
@ -10,6 +10,7 @@ from .PyDatagramIterator import PyDatagramIterator
|
||||
import types
|
||||
import gc
|
||||
|
||||
__all__ = ["ConnectionRepository", "GCTrigger"]
|
||||
|
||||
class ConnectionRepository(
|
||||
DoInterestManager, DoCollectionManager, CConnectionRepository):
|
||||
|
@ -15,6 +15,8 @@ class DistributedNode(DistributedObject.DistributedObject, NodePath):
|
||||
self.DistributedNode_initialized = 1
|
||||
self.gotStringParentToken = 0
|
||||
DistributedObject.DistributedObject.__init__(self, cr)
|
||||
if not self.this:
|
||||
NodePath.__init__(self, "DistributedNode")
|
||||
|
||||
# initialize gridParent
|
||||
self.gridParent = None
|
||||
|
@ -1,4 +1,3 @@
|
||||
#from otp.ai.AIBaseGlobal import *
|
||||
from .DistributedObjectUD import DistributedObjectUD
|
||||
|
||||
class DistributedNodeUD(DistributedObjectUD):
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
|
||||
@ -93,3 +92,11 @@ class DistributedObjectBase(DirectObject):
|
||||
|
||||
def hasParentingRules(self):
|
||||
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