direct.distributed.DoInterestManager

from direct.distributed.DoInterestManager import AsyncTestCase, AsyncTestLoader, AsyncTestSuite, AsyncTextTestRunner, DoInterestManager, InterestHandle, InterestState, TestInterestAddRemove, runTests

The DoInterestManager keeps track of which parent/zones that we currently have interest in. When you want to “look” into a zone you add an interest to that zone. When you want to get rid of, or ignore, the objects in that zone, remove interest in that zone.

p.s. A great deal of this code is just code moved from ClientRepository.py.

Inheritance diagram

Inheritance diagram of direct.distributed.DoInterestManager

class AsyncTestCase(methodName='runTest')[source]

Bases: TestCase

isCompleted(self)[source]
setCompleted(self)[source]
class AsyncTestLoader[source]

Bases: TestLoader

suiteClass

alias of AsyncTestSuite

class AsyncTestSuite(tests=())[source]

Bases: TestSuite

class AsyncTextTestRunner(stream=None, descriptions=True, verbosity=1, failfast=False, buffer=False, resultclass=None, warnings=None, *, tb_locals=False)[source]

Bases: TextTestRunner

run(self, testCase)[source]
class DoInterestManager[source]

Bases: DirectObject

Top level Interest Manager

InterestDebug = 0
__init__(self)[source]
addAutoInterest(self, parentId, zoneIdList, description)[source]

Look into a (set of) zone(s).

addInterest(self, parentId, zoneIdList, description, event=None)[source]

Look into a (set of) zone(s).

alterInterest(self, handle, parentId, zoneIdList, description=None, event=None)[source]

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(self)[source]
closeAutoInterests(self, obj)[source]
getAllInterestsCompleteEvent(self)[source]
handleInterestDoneMessage(self, di)[source]

This handles the interest done messages and may dispatch an event

isValidInterestHandle(self, handle)[source]
noNewInterests(self)[source]
notify = <direct.directnotify.Notifier.Notifier object>
openAutoInterests(self, obj)[source]
printInterestHistory(self)[source]
printInterestSets(self)[source]
printInterests(self)[source]
printInterestsIfDebug(self)[source]
queueAllInterestsCompleteEvent(self, frames=5)[source]
removeAIInterest(self, handle)[source]

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(self, handle)[source]

Stop looking in a (set of) zone(s)

removeInterest(self, handle, event=None)[source]

Stop looking in a (set of) zone(s)

resetInterestStateForConnectionLoss(self)[source]
setAllInterestsCompleteCallback(self, callback)[source]
setNoNewInterests(self, flag)[source]
updateInterestDescription(self, handle, desc)[source]
class InterestHandle(id)[source]

Bases: object

This class helps to ensure that valid handles get passed in to DoInterestManager funcs

__init__(self, id)[source]
asInt(self)[source]
class InterestState(desc, state, context, event, parentId, zoneIdList, eventCounter, auto=False)[source]

Bases: object

StateActive = 'Active'
StatePendingDel = 'PendingDel'
__init__(self, desc, state, context, event, parentId, zoneIdList, eventCounter, auto=False)[source]
addEvent(self, event)[source]
clearEvents(self)[source]
getEvents(self)[source]
isPendingDelete(self)[source]
sendEvents(self)[source]
setDesc(self, desc)[source]
class TestInterestAddRemove(methodName='runTest')[source]

Bases: AsyncTestCase, DirectObject

gotInterestAddResponse(self)[source]
gotInterestRemoveResponse(self)[source]
testInterestAdd(self)[source]
runTests()[source]