Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
DoCollectionManager Class Reference
Inheritance diagram for DoCollectionManager:
ConnectionRepository ClientRepositoryBase ClientRepository

Public Member Functions

 __init__ (self)
 
 addDOToTables (self, do, location=None, ownerView=False)
 
 callbackWithDo (self, doId, callback)
 
 callbackWithOwnerView (self, doId, callback)
 
 countObjects (self, classType)
 
 deleteDistributedObjects (self)
 
 deleteObjectLocation (self, object, parentId, zoneId)
 
 doByDistance (self)
 
 doFind (self, str)
 
 doFindAll (self, str)
 
 doFindAllInstances (self, cls)
 
 doFindAllMatching (self, str)
 
 doFindAllOfType (self, query)
 
 dosByDistance (self)
 
 findAnyOfType (self, type)
 
 getAllOfType (self, type)
 
 getDo (self, doId)
 
 getDoIdList (self, parentId, zoneId=None, classType=None)
 
 getDoList (self, parentId, zoneId=None, classType=None)
 
 getDoTable (self, ownerView)
 
 getGameDoId (self)
 
 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)
 
 getObjectsOfClassInZone (self, parentId, zoneId, objClass)
 
 getOwnerView (self, doId)
 
 getOwnerViewDoIdList (self, classType)
 
 getOwnerViewDoList (self, classType)
 
 handleObjectLocation (self, di)
 
 handleSetLocation (self, di)
 
 hasOwnerViewDoId (self, doId)
 
 isInDoTables (self, doId)
 
 isValidLocationTuple (self, location)
 
 printObjectCount (self)
 
 printObjects (self)
 
 removeDOFromTables (self, do)
 
 storeObjectLocation (self, object, parentId, zoneId)
 
 webPrintObjectCount (self)
 

Public Attributes

 doId2do
 
 doId2ownerView
 self.zoneId2doIds={}
 
 getDo
 

Protected Member Functions

 _compareDistance (self, do1, do2)
 
 _getDistanceFromLA (self, do)
 
 _printObjects (self, table)
 
 _returnObjects (self, table)
 

Protected Attributes

 _doHierarchy
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)

Member Function Documentation

◆ _compareDistance()

_compareDistance ( self,
do1,
do2 )
protected

◆ _getDistanceFromLA()

_getDistanceFromLA ( self,
do )
protected

◆ _printObjects()

_printObjects ( self,
table )
protected

◆ _returnObjects()

_returnObjects ( self,
table )
protected

◆ addDOToTables()

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

◆ callbackWithDo()

callbackWithDo ( self,
doId,
callback )

◆ callbackWithOwnerView()

callbackWithOwnerView ( self,
doId,
callback )

◆ countObjects()

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

◆ deleteDistributedObjects()

deleteDistributedObjects ( self)

◆ deleteObjectLocation()

deleteObjectLocation ( self,
object,
parentId,
zoneId )

◆ doByDistance()

doByDistance ( self)

◆ doFind()

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

◆ doFindAll()

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

◆ doFindAllInstances()

doFindAllInstances ( self,
cls )

◆ doFindAllMatching()

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

◆ doFindAllOfType()

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

◆ dosByDistance()

dosByDistance ( self)

◆ findAnyOfType()

findAnyOfType ( self,
type )

◆ getAllOfType()

getAllOfType ( self,
type )

◆ getDo()

getDo ( self,
doId )

◆ getDoIdList()

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

◆ getDoList()

getDoList ( self,
parentId,
zoneId = None,
classType = None )
Args:
    parentId: any distributed object id.
    zoneId: 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: 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()

getDoTable ( self,
ownerView )

◆ getGameDoId()

getGameDoId ( self)

◆ getObjectsInZone()

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()

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()

getOwnerView ( self,
doId )

◆ getOwnerViewDoIdList()

getOwnerViewDoIdList ( self,
classType )

◆ getOwnerViewDoList()

getOwnerViewDoList ( self,
classType )

◆ handleObjectLocation()

handleObjectLocation ( self,
di )

◆ handleSetLocation()

handleSetLocation ( self,
di )

◆ hasOwnerViewDoId()

hasOwnerViewDoId ( self,
doId )

◆ isInDoTables()

isInDoTables ( self,
doId )

◆ isValidLocationTuple()

isValidLocationTuple ( self,
location )

◆ printObjectCount()

printObjectCount ( self)

◆ printObjects()

printObjects ( self)

◆ removeDOFromTables()

removeDOFromTables ( self,
do )

◆ storeObjectLocation()

storeObjectLocation ( self,
object,
parentId,
zoneId )

Reimplemented in ClientRepository.

◆ webPrintObjectCount()

webPrintObjectCount ( self)

Member Data Documentation

◆ _doHierarchy

_doHierarchy
protected

◆ doId2do

doId2do

◆ doId2ownerView

doId2ownerView

self.zoneId2doIds={}

◆ getDo

getDo