mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
using DistributedObjectBase
This commit is contained in:
parent
0d55c51db5
commit
484fb2bd52
@ -1,9 +1,9 @@
|
|||||||
"""DistributedObject module: contains the DistributedObject class"""
|
"""DistributedObject module: contains the DistributedObject class"""
|
||||||
|
|
||||||
from direct.showbase.PandaObject import *
|
|
||||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||||
from PyDatagram import PyDatagram
|
from direct.distributed.DistributedObjectBase import DistributedObjectBase
|
||||||
from PyDatagramIterator import PyDatagramIterator
|
#from PyDatagram import PyDatagram
|
||||||
|
#from PyDatagramIterator import PyDatagramIterator
|
||||||
|
|
||||||
# Values for DistributedObject.activeState
|
# Values for DistributedObject.activeState
|
||||||
|
|
||||||
@ -14,7 +14,7 @@ ESDisabled = 4 # values here and lower are considered "disabled"
|
|||||||
ESGenerating = 5 # values here and greater are considered "generated"
|
ESGenerating = 5 # values here and greater are considered "generated"
|
||||||
ESGenerated = 6
|
ESGenerated = 6
|
||||||
|
|
||||||
class DistributedObject(PandaObject):
|
class DistributedObject(DistributedObjectBase):
|
||||||
"""
|
"""
|
||||||
The Distributed Object class is the base class for all network based
|
The Distributed Object class is the base class for all network based
|
||||||
(i.e. distributed) objects. These will usually (always?) have a
|
(i.e. distributed) objects. These will usually (always?) have a
|
||||||
@ -34,8 +34,7 @@ class DistributedObject(PandaObject):
|
|||||||
self.DistributedObject_initialized
|
self.DistributedObject_initialized
|
||||||
except:
|
except:
|
||||||
self.DistributedObject_initialized = 1
|
self.DistributedObject_initialized = 1
|
||||||
self.cr = cr
|
DistributedObjectBase.__init__(self, cr)
|
||||||
self.children = {}
|
|
||||||
|
|
||||||
# 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
|
||||||
@ -64,11 +63,9 @@ class DistributedObject(PandaObject):
|
|||||||
# This is used by doneBarrier().
|
# This is used by doneBarrier().
|
||||||
self.__barrierContext = None
|
self.__barrierContext = None
|
||||||
|
|
||||||
#zone of the distributed object, default to 0
|
## TODO: This should probably be move to a derived class for CMU
|
||||||
self.zone = 0
|
## #zone of the distributed object, default to 0
|
||||||
|
## self.zone = 0
|
||||||
self.parentId = None
|
|
||||||
self.zoneId = None
|
|
||||||
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
def status(self, indent=0):
|
def status(self, indent=0):
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
"""DistributedObjectAI module: contains the DistributedObjectAI class"""
|
"""DistributedObjectAI module: contains the DistributedObjectAI class"""
|
||||||
|
|
||||||
from direct.directnotify.DirectNotifyGlobal import *
|
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||||
|
from direct.distributed.DistributedObjectBase import DistributedObjectBase
|
||||||
from direct.showbase import PythonUtil
|
from direct.showbase import PythonUtil
|
||||||
from direct.showbase.DirectObject import DirectObject
|
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
from PyDatagram import PyDatagram
|
#from PyDatagram import PyDatagram
|
||||||
from PyDatagramIterator import PyDatagramIterator
|
#from PyDatagramIterator import PyDatagramIterator
|
||||||
|
|
||||||
class DistributedObjectAI(DirectObject):
|
class DistributedObjectAI(DistributedObjectBase):
|
||||||
notify = directNotify.newCategory("DistributedObjectAI")
|
notify = directNotify.newCategory("DistributedObjectAI")
|
||||||
QuietZone = 1
|
QuietZone = 1
|
||||||
|
|
||||||
@ -16,13 +16,11 @@ class DistributedObjectAI(DirectObject):
|
|||||||
self.DistributedObjectAI_initialized
|
self.DistributedObjectAI_initialized
|
||||||
except:
|
except:
|
||||||
self.DistributedObjectAI_initialized = 1
|
self.DistributedObjectAI_initialized = 1
|
||||||
|
DistributedObjectBase.__init__(self, air)
|
||||||
|
|
||||||
self.accountName=''
|
self.accountName=''
|
||||||
# Record the repository
|
# Record the repository
|
||||||
self.air = air
|
self.air = air
|
||||||
# Record our parentId and zoneId
|
|
||||||
self.parentId = None
|
|
||||||
self.zoneId = None
|
|
||||||
|
|
||||||
# Record our distributed class
|
# Record our distributed class
|
||||||
className = self.__class__.__name__
|
className = self.__class__.__name__
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
from direct.showbase.PandaObject import *
|
|
||||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
|
||||||
|
|
||||||
from PyDatagram import PyDatagram
|
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||||
from PyDatagramIterator import PyDatagramIterator
|
from direct.distributed.DistributedObjectBase import DistributedObjectBase
|
||||||
|
|
||||||
|
#from PyDatagram import PyDatagram
|
||||||
|
#from PyDatagramIterator import PyDatagramIterator
|
||||||
|
|
||||||
# Values for DistributedObjectOV.activeState
|
# Values for DistributedObjectOV.activeState
|
||||||
# these should match DistributedObject.ES*
|
# these should match DistributedObject.ES*
|
||||||
@ -14,7 +15,7 @@ ESDisabled = 4 # values here and lower are considered "disabled"
|
|||||||
ESGenerating = 5 # values here and greater are considered "generated"
|
ESGenerating = 5 # values here and greater are considered "generated"
|
||||||
ESGenerated = 6
|
ESGenerated = 6
|
||||||
|
|
||||||
class DistributedObjectOV(PandaObject):
|
class DistributedObjectOV(DistributedObjectBase):
|
||||||
"""
|
"""
|
||||||
Implementation of the 'owner view' (OV) of a distributed object;
|
Implementation of the 'owner view' (OV) of a distributed object;
|
||||||
"""
|
"""
|
||||||
@ -26,7 +27,7 @@ class DistributedObjectOV(PandaObject):
|
|||||||
self.DistributedObjectOV_initialized
|
self.DistributedObjectOV_initialized
|
||||||
except:
|
except:
|
||||||
self.DistributedObjectOV_initialized = 1
|
self.DistributedObjectOV_initialized = 1
|
||||||
self.cr = cr
|
DistributedObjectBase.__init__(self, cr)
|
||||||
|
|
||||||
# This count tells whether the object can be deleted right away,
|
# This count tells whether the object can be deleted right away,
|
||||||
# or not.
|
# or not.
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
"""DistributedObjectUD module: contains the DistributedObjectUD class"""
|
"""DistributedObjectUD module: contains the DistributedObjectUD class"""
|
||||||
|
|
||||||
from direct.directnotify.DirectNotifyGlobal import *
|
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||||
|
from direct.distributed.DistributedObjectBase import DistributedObjectBase
|
||||||
from direct.showbase import PythonUtil
|
from direct.showbase import PythonUtil
|
||||||
from direct.showbase.DirectObject import DirectObject
|
|
||||||
from pandac.PandaModules import *
|
from pandac.PandaModules import *
|
||||||
from PyDatagram import PyDatagram
|
#from PyDatagram import PyDatagram
|
||||||
from PyDatagramIterator import PyDatagramIterator
|
#from PyDatagramIterator import PyDatagramIterator
|
||||||
|
|
||||||
class DistributedObjectUD(DirectObject):
|
class DistributedObjectUD(DistributedObjectBase):
|
||||||
notify = directNotify.newCategory("DistributedObjectUD")
|
notify = directNotify.newCategory("DistributedObjectUD")
|
||||||
QuietZone = 1
|
QuietZone = 1
|
||||||
|
|
||||||
@ -16,13 +16,11 @@ class DistributedObjectUD(DirectObject):
|
|||||||
self.DistributedObjectUD_initialized
|
self.DistributedObjectUD_initialized
|
||||||
except:
|
except:
|
||||||
self.DistributedObjectUD_initialized = 1
|
self.DistributedObjectUD_initialized = 1
|
||||||
|
DistributedObjectBase.__init__(self, air)
|
||||||
|
|
||||||
self.accountName=''
|
self.accountName=''
|
||||||
# Record the repository
|
# Record the repository
|
||||||
self.air = air
|
self.air = air
|
||||||
# Record our parentId and zoneId
|
|
||||||
self.parentId = None
|
|
||||||
self.zoneId = None
|
|
||||||
|
|
||||||
# Record our distributed class
|
# Record our distributed class
|
||||||
className = self.__class__.__name__
|
className = self.__class__.__name__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user