Panda3D
Public Member Functions | Public Attributes | List of all members
DoCollectionManager Class Reference
Inheritance diagram for DoCollectionManager:
ConnectionRepository ClientRepositoryBase ClientRepository

Public Member Functions

def __init__ (self)
 
def addDOToTables (self, do, location=None, ownerView=False)
 
def callbackWithDo (self, doId, callback)
 
def callbackWithOwnerView (self, doId, callback)
 
def countObjects (self, classType)
 
def deleteDistributedObjects (self)
 
def deleteObjectLocation (self, object, parentId, zoneId)
 
def doByDistance (self)
 
def doFind (self, str)
 
def doFindAll (self, str)
 
def doFindAllInstances (self, cls)
 
def doFindAllMatching (self, str)
 
def doFindAllOfType (self, query)
 
def dosByDistance (self)
 
def findAnyOfType (self, type)
 
def getAllOfType (self, type)
 
def getDo (self, doId)
 
def getDoIdList (self, parentId, zoneId=None, classType=None)
 
def getDoList (self, parentId, zoneId=None, classType=None)
 
def getDoTable (self, ownerView)
 
def getGameDoId (self)
 
def getObjectsInZone (self, parentId, zoneId)
 def changeDOZoneInTables(self, do, newParentId, newZoneId, oldParentId, oldZoneId): if 1: self.storeObjectLocation(do.doId, newParentId, newZoneId) else: #assert not hasattr(do, "isQueryAllResponse") or not do.isQueryAllResponse oldLocation = (oldParentId, oldZoneId) newLocation = (newParentId, newZoneId) More...
 
def getObjectsOfClassInZone (self, parentId, zoneId, objClass)
 
def getOwnerView (self, doId)
 
def getOwnerViewDoIdList (self, classType)
 
def getOwnerViewDoList (self, classType)
 
def handleObjectLocation (self, di)
 
def handleSetLocation (self, di)
 
def hasOwnerViewDoId (self, doId)
 
def isInDoTables (self, doId)
 
def isValidLocationTuple (self, location)
 
def printObjectCount (self)
 
def printObjects (self)
 
def removeDOFromTables (self, do)
 
def storeObjectLocation (self, object, parentId, zoneId)
 
def webPrintObjectCount (self)
 

Public Attributes

 doId2do
 
 doId2ownerView
 self.zoneId2doIds={} More...
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Member Function Documentation

◆ addDOToTables()

def addDOToTables (   self,
  do,
  location = None,
  ownerView = False 
)

◆ callbackWithDo()

def callbackWithDo (   self,
  doId,
  callback 
)

◆ callbackWithOwnerView()

def callbackWithOwnerView (   self,
  doId,
  callback 
)

◆ countObjects()

def countObjects (   self,
  classType 
)
Counts the number of objects of the given type in the
repository (for testing purposes)

◆ deleteDistributedObjects()

def deleteDistributedObjects (   self)

◆ deleteObjectLocation()

def deleteObjectLocation (   self,
  object,
  parentId,
  zoneId 
)

◆ doByDistance()

def doByDistance (   self)

◆ doFind()

def doFind (   self,
  str 
)
Returns list of distributed objects with matching str in value.

◆ doFindAll()

def doFindAll (   self,
  str 
)
Returns list of distributed objects with matching str in value.

◆ doFindAllInstances()

def doFindAllInstances (   self,
  cls 
)

◆ doFindAllMatching()

def doFindAllMatching (   self,
  str 
)
Returns list of distributed objects with matching str in value.

◆ doFindAllOfType()

def doFindAllOfType (   self,
  query 
)
Useful method for searching through the Distributed Object collection
for objects of a particular type

◆ dosByDistance()

def dosByDistance (   self)

◆ findAnyOfType()

def findAnyOfType (   self,
  type 
)

◆ getAllOfType()

def getAllOfType (   self,
  type 
)

◆ getDo()

def getDo (   self,
  doId 
)

◆ getDoIdList()

def getDoIdList (   self,
  parentId,
  zoneId = None,
  classType = None 
)

◆ getDoList()

def getDoList (   self,
  parentId,
  zoneId = None,
  classType = None 
)
parentId is any distributed object id.
zoneId is a uint32, defaults to None (all zones).  Try zone 2 if
    you're not sure which zone to use (0 is a bad/null zone and
    1 has had reserved use in the past as a no messages zone, while
    2 has traditionally been a global, uber, misc stuff zone).
dclassType is a distributed class type filter, defaults
    to None (no filter).

If dclassName is None then all objects in the zone are returned;
otherwise the list is filtered to only include objects of that type.

◆ getDoTable()

def getDoTable (   self,
  ownerView 
)

◆ getGameDoId()

def getGameDoId (   self)

◆ getObjectsInZone()

def getObjectsInZone (   self,
  parentId,
  zoneId 
)

def changeDOZoneInTables(self, do, newParentId, newZoneId, oldParentId, oldZoneId): if 1: self.storeObjectLocation(do.doId, newParentId, newZoneId) else: #assert not hasattr(do, "isQueryAllResponse") or not do.isQueryAllResponse oldLocation = (oldParentId, oldZoneId) newLocation = (newParentId, newZoneId)

HACK: DistributedGuildMemberUD starts in -1, -1, which isnt ever put in the

zoneId2doIds table

if self.isValidLocationTuple(oldLocation): assert self.notify.debugStateCall(self) assert oldLocation in self.zoneId2doIds assert do.doId in self.zoneId2doIds[oldLocation] assert do.doId not in self.zoneId2doIds.get(newLocation, {})

remove from old zone

del(self.zoneId2doIds[oldLocation][do.doId]) if len(self.zoneId2doIds[oldLocation]) == 0: del self.zoneId2doIds[oldLocation] if self.isValidLocationTuple(newLocation):

add to new zone

self.zoneId2doIds.setdefault(newLocation, {}) self.zoneId2doIds[newLocation][do.doId]=do

returns dict of doId:distObj for a zone.
returned dict is safely mutable.

◆ getObjectsOfClassInZone()

def getObjectsOfClassInZone (   self,
  parentId,
  zoneId,
  objClass 
)
returns dict of doId:object for a zone, containing all objects
that inherit from 'class'. returned dict is safely mutable.

◆ getOwnerView()

def getOwnerView (   self,
  doId 
)

◆ getOwnerViewDoIdList()

def getOwnerViewDoIdList (   self,
  classType 
)

◆ getOwnerViewDoList()

def getOwnerViewDoList (   self,
  classType 
)

◆ handleObjectLocation()

def handleObjectLocation (   self,
  di 
)

◆ handleSetLocation()

def handleSetLocation (   self,
  di 
)

◆ hasOwnerViewDoId()

def hasOwnerViewDoId (   self,
  doId 
)

◆ isInDoTables()

def isInDoTables (   self,
  doId 
)

◆ isValidLocationTuple()

def isValidLocationTuple (   self,
  location 
)

◆ printObjectCount()

def printObjectCount (   self)

◆ printObjects()

def printObjects (   self)

◆ removeDOFromTables()

def removeDOFromTables (   self,
  do 
)

◆ storeObjectLocation()

def storeObjectLocation (   self,
  object,
  parentId,
  zoneId 
)

Reimplemented in ClientRepository.

◆ webPrintObjectCount()

def webPrintObjectCount (   self)

Member Data Documentation

◆ doId2do

doId2do

◆ doId2ownerView

doId2ownerView

self.zoneId2doIds={}