mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
adding removeAIInterest() and _sendRemoveAIInterest() to allow client to close interests opened by the AI
This commit is contained in:
parent
481e53fd77
commit
265130ae80
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user