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