From 265130ae80d23563b6698db453698a3c95c00660 Mon Sep 17 00:00:00 2001 From: Josh Wilson Date: Thu, 21 Aug 2008 02:50:49 +0000 Subject: [PATCH] adding removeAIInterest() and _sendRemoveAIInterest() to allow client to close interests opened by the AI --- direct/src/distributed/DoInterestManager.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/direct/src/distributed/DoInterestManager.py b/direct/src/distributed/DoInterestManager.py index e5a32c8fa9..7a736e393d 100755 --- a/direct/src/distributed/DoInterestManager.py +++ b/direct/src/distributed/DoInterestManager.py @@ -314,6 +314,16 @@ class DoInterestManager(DirectObject.DirectObject): assert self.printInterestsIfDebug() return existed + @report(types = ['args'], dConfigParam = 'want-guildmgr-report') + def 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. + """ + self._sendRemoveAIInterest(handle) + def alterInterest(self, handle, parentId, zoneIdList, description=None, event=None): """ @@ -534,6 +544,17 @@ class DoInterestManager(DirectObject.DirectObject): "remove", state.desc, handle, contextId, state.parentId, state.zoneIdList) + def _sendRemoveAIInterest(self, handle): + """ + handle is a bare int, NOT an InterestHandle. Use this to + close an AI opened interest. + """ + datagram = PyDatagram() + # Add message type + datagram.addUint16(CLIENT_REMOVE_INTEREST) + datagram.addUint16((1<<15) + handle) + self.send(datagram) + def cleanupWaitAllInterestsComplete(self): if self._completeDelayedCallback is not None: self._completeDelayedCallback.destroy()