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
- class AsyncTestLoader[source]
Bases:
TestLoader
- suiteClass
alias of
AsyncTestSuite
- class AsyncTextTestRunner(stream=None, descriptions=True, verbosity=1, failfast=False, buffer=False, resultclass=None, warnings=None, *, tb_locals=False)[source]
Bases:
TextTestRunner
- class DoInterestManager[source]
Bases:
DirectObject
Top level Interest Manager
- InterestDebug = 0
- 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.
- handleInterestDoneMessage(self, di)[source]
This handles the interest done messages and may dispatch an event
- notify = <direct.directnotify.Notifier.Notifier object>
- 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.
- class InterestHandle(id)[source]
Bases:
object
This class helps to ensure that valid handles get passed in to DoInterestManager funcs
- class InterestState(desc, state, context, event, parentId, zoneIdList, eventCounter, auto=False)[source]
Bases:
object
- StateActive = 'Active'
- StatePendingDel = 'PendingDel'
- class TestInterestAddRemove(methodName='runTest')[source]
Bases:
AsyncTestCase
,DirectObject