Panda3D
Loading...
Searching...
No Matches
DoInterestManager Class Reference
Inheritance diagram for DoInterestManager:
DirectObject ConnectionRepository ClientRepositoryBase ClientRepository

Public Member Functions

 __init__ (self)
 
 addAutoInterest (self, parentId, zoneIdList, description)
 
 addInterest (self, parentId, zoneIdList, description, event=None)
 
 alterInterest (self, handle, parentId, zoneIdList, description=None, event=None)
 
 cleanupWaitAllInterestsComplete (self)
 
 closeAutoInterests (self, obj)
 
 getAllInterestsCompleteEvent (self)
 
 handleInterestDoneMessage (self, di)
 
 isValidInterestHandle (self, handle)
 
 noNewInterests (self)
 
 openAutoInterests (self, obj)
 
 printInterestHistory (self)
 
 printInterests (self)
 
 printInterestSets (self)
 
 printInterestsIfDebug (self)
 
 queueAllInterestsCompleteEvent (self, frames=5)
 
 removeAIInterest (self, handle)
 
 removeAutoInterest (self, handle)
 
 removeInterest (self, handle, event=None)
 
 resetInterestStateForConnectionLoss (self)
 
 setAllInterestsCompleteCallback (self, callback)
 
 setNoNewInterests (self, flag)
 
 updateInterestDescription (self, handle, desc)
 
- Public Member Functions inherited from DirectObject
 __init__ (self)
 
 accept (self, event, method, extraArgs=[])
 
 acceptOnce (self, event, method, extraArgs=[])
 
 addTask (self, *args, **kwargs)
 
 detectLeaks (self)
 
 doMethodLater (self, *args, **kwargs)
 
 getAllAccepting (self)
 
 ignore (self, event)
 
 ignoreAll (self)
 
 isAccepting (self, event)
 
 isIgnoring (self, event)
 
 removeAllTasks (self)
 
 removeTask (self, taskOrName)
 

Static Public Attributes

 InterestDebug = ConfigVariableBool('interest-debug', False)
 
 notify = directNotify.newCategory("DoInterestManager")
 
- Static Public Attributes inherited from DirectObject
 accept_once = acceptOnce
 
 add_task = addTask
 
 detect_leaks = detectLeaks
 
 do_method_later = doMethodLater
 
 get_all_accepting = getAllAccepting
 
 ignore_all = ignoreAll
 
 is_accepting = isAccepting
 
 is_ignoring = isIgnoring
 
 remove_all_tasks = removeAllTasks
 
 remove_task = removeTask
 

Protected Member Functions

 _addDebugInterestHistory (self, action, description, handle, contextId, parentId, zoneIdList)
 
 _considerRemoveInterest (self, handle)
 
 _getAddInterestEvent (self)
 
 _getAnonymousEvent (self, desc)
 
 _getInterestState (self, handle)
 
 _getNextContextId (self)
 
 _getNextHandle (self)
 
 _getRemoveInterestEvent (self)
 
 _sendAddInterest (self, handle, contextId, parentId, zoneIdList, description, action=None)
 
 _sendRemoveAIInterest (self, handle)
 
 _sendRemoveInterest (self, handle, contextId)
 
- Protected Member Functions inherited from DirectObject
 _addTask (self, task)
 
 _clearTask (self, task)
 

Protected Attributes

 _addInterestEvent = uniqueName('DoInterestManager-Add')
 
list _allInterestsCompleteCallbacks = []
 
 _completeDelayedCallback = None
 
 _completeEventCount = ScratchPad(num=0)
 
bool _noNewInterests = False
 
 _removeInterestEvent = uniqueName('DoInterestManager-Remove')
 
- Protected Attributes inherited from DirectObject
dict _taskList = {}
 

Static Protected Attributes

int _ContextIdMask = 0x3FFFFFFF
 
int _ContextIdSerialNum = 100
 
list _debug_interestHistory = []
 
int _debug_maxDescriptionLen = 40
 
int _HandleMask = 0x7FFF
 
int _HandleSerialNum = 0
 
dict _interests = {}
 
 _SerialGen = SerialNumGen()
 
 _SerialNum = serialNum()
 

Detailed Description

Top level Interest Manager

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)

Member Function Documentation

◆ _addDebugInterestHistory()

_addDebugInterestHistory ( self,
action,
description,
handle,
contextId,
parentId,
zoneIdList )
protected

◆ _considerRemoveInterest()

_considerRemoveInterest ( self,
handle )
protected
Consider whether we should cull the interest set.

◆ _getAddInterestEvent()

_getAddInterestEvent ( self)
protected

◆ _getAnonymousEvent()

_getAnonymousEvent ( self,
desc )
protected

◆ _getInterestState()

_getInterestState ( self,
handle )
protected

◆ _getNextContextId()

_getNextContextId ( self)
protected

◆ _getNextHandle()

_getNextHandle ( self)
protected

◆ _getRemoveInterestEvent()

_getRemoveInterestEvent ( self)
protected

◆ _sendAddInterest()

_sendAddInterest ( self,
handle,
contextId,
parentId,
zoneIdList,
description,
action = None )
protected
Part of the new otp-server code.

handle is a client-side created number that refers to
        a set of interests.  The same handle number doesn't
        necessarily have any relationship to the same handle
        on another client.

◆ _sendRemoveAIInterest()

_sendRemoveAIInterest ( self,
handle )
protected
handle is a bare int, NOT an InterestHandle.  Use this to
close an AI opened interest.

◆ _sendRemoveInterest()

_sendRemoveInterest ( self,
handle,
contextId )
protected
handle is a client-side created number that refers to
        a set of interests.  The same handle number doesn't
        necessarily have any relationship to the same handle
        on another client.

◆ addAutoInterest()

addAutoInterest ( self,
parentId,
zoneIdList,
description )
Look into a (set of) zone(s).

◆ addInterest()

addInterest ( self,
parentId,
zoneIdList,
description,
event = None )
Look into a (set of) zone(s).

◆ alterInterest()

alterInterest ( self,
handle,
parentId,
zoneIdList,
description = None,
event = None )
Removes old interests and adds new interests.

Note that when an interest is changed, only the most recent
change's event will be triggered. Previous events are abandoned.
If this is a problem, consider opening multiple interests.

◆ cleanupWaitAllInterestsComplete()

cleanupWaitAllInterestsComplete ( self)

◆ closeAutoInterests()

closeAutoInterests ( self,
obj )

◆ getAllInterestsCompleteEvent()

getAllInterestsCompleteEvent ( self)

◆ handleInterestDoneMessage()

handleInterestDoneMessage ( self,
di )
This handles the interest done messages and may dispatch an event

◆ isValidInterestHandle()

isValidInterestHandle ( self,
handle )

◆ noNewInterests()

noNewInterests ( self)

◆ openAutoInterests()

openAutoInterests ( self,
obj )

◆ printInterestHistory()

printInterestHistory ( self)

◆ printInterests()

printInterests ( self)

◆ printInterestSets()

printInterestSets ( self)

◆ printInterestsIfDebug()

printInterestsIfDebug ( self)

◆ queueAllInterestsCompleteEvent()

queueAllInterestsCompleteEvent ( self,
frames = 5 )

◆ removeAIInterest()

removeAIInterest ( self,
handle )
handle is NOT an InterestHandle.  It's just a bare integer representing an
AI opened interest. We're making the client close down this interest since
the AI has trouble removing interests(that its opened) when the avatar goes
offline.  See GuildManager(UD) for how it's being used.

◆ removeAutoInterest()

removeAutoInterest ( self,
handle )
Stop looking in a (set of) zone(s)

◆ removeInterest()

removeInterest ( self,
handle,
event = None )
Stop looking in a (set of) zone(s)

◆ resetInterestStateForConnectionLoss()

resetInterestStateForConnectionLoss ( self)

◆ setAllInterestsCompleteCallback()

setAllInterestsCompleteCallback ( self,
callback )

◆ setNoNewInterests()

setNoNewInterests ( self,
flag )

◆ updateInterestDescription()

updateInterestDescription ( self,
handle,
desc )

Member Data Documentation

◆ _addInterestEvent

_addInterestEvent = uniqueName('DoInterestManager-Add')
protected

◆ _allInterestsCompleteCallbacks

list _allInterestsCompleteCallbacks = []
protected

◆ _completeDelayedCallback

_completeDelayedCallback = None
protected

◆ _completeEventCount

_completeEventCount = ScratchPad(num=0)
protected

◆ _ContextIdMask

int _ContextIdMask = 0x3FFFFFFF
staticprotected

◆ _ContextIdSerialNum

int _ContextIdSerialNum = 100
staticprotected

◆ _debug_interestHistory

list _debug_interestHistory = []
staticprotected

◆ _debug_maxDescriptionLen

int _debug_maxDescriptionLen = 40
staticprotected

◆ _HandleMask

int _HandleMask = 0x7FFF
staticprotected

◆ _HandleSerialNum

int _HandleSerialNum = 0
staticprotected

◆ _interests

dict _interests = {}
staticprotected

◆ _noNewInterests

bool _noNewInterests = False
protected

◆ _removeInterestEvent

_removeInterestEvent = uniqueName('DoInterestManager-Remove')
protected

◆ _SerialGen

_SerialGen = SerialNumGen()
staticprotected

◆ _SerialNum

_SerialNum = serialNum()
staticprotected

◆ InterestDebug

InterestDebug = ConfigVariableBool('interest-debug', False)
static

◆ notify

notify = directNotify.newCategory("DoInterestManager")
static