mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
alter interest work, and parent id fix
This commit is contained in:
parent
b63f81f92e
commit
9538bc5a39
@ -713,7 +713,7 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
||||
datagram.addUint16(CLIENT_SET_ZONE)
|
||||
# Add Parent
|
||||
if parent is not None:
|
||||
datagram.addUint32(zoneId)
|
||||
datagram.addUint32(parent)
|
||||
else:
|
||||
datagram.addUint32(base.localAvatar.defaultShard)
|
||||
# Add zone id
|
||||
@ -814,17 +814,21 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
||||
assert self.printInterests()
|
||||
return answer
|
||||
|
||||
def alterInterest(self, contextId, parentId, zoneId, description):
|
||||
def alterInterest(self, contextId, parentId, zoneId, description = None):
|
||||
"""
|
||||
Part of the new otp-server code.
|
||||
Removes old and adds new..
|
||||
"""
|
||||
print 'new'
|
||||
answer = 0
|
||||
if self._interests.has_key(contextId):
|
||||
self._interests[contextId] = description
|
||||
self._sendAlterInterest(contextId, parentId, zoneId)
|
||||
if description is not None:
|
||||
self._interests[contextId] = description
|
||||
self._sendAddInterest(contextId, parentId, zoneId)
|
||||
answer = 1
|
||||
assert self.printInterests()
|
||||
assert self.printInterests()
|
||||
else:
|
||||
self.notify.warning("alterInterest: contextId not found: %s" % (contextId))
|
||||
return answer
|
||||
|
||||
if __debug__:
|
||||
@ -855,23 +859,6 @@ class ClientRepository(ConnectionRepository.ConnectionRepository):
|
||||
datagram.addUint32(zoneId)
|
||||
self.send(datagram)
|
||||
|
||||
def _sendAlterInterest(self, contextId, parentId, zoneId):
|
||||
"""
|
||||
Part of the new otp-server code.
|
||||
|
||||
contextId is a client-side created number that refers to
|
||||
a set of interests. The same contextId number doesn't
|
||||
necessarily have any relationship to the same contextId
|
||||
on another client.
|
||||
"""
|
||||
datagram = PyDatagram()
|
||||
# Add message type
|
||||
datagram.addUint16(CLIENT_ALTER_INTEREST)
|
||||
datagram.addUint16(contextId)
|
||||
datagram.addUint32(parentId)
|
||||
datagram.addUint32(zoneId)
|
||||
self.send(datagram)
|
||||
|
||||
def _sendRemoveInterest(self, contextId):
|
||||
"""
|
||||
Part of the new otp-server code.
|
||||
|
@ -81,7 +81,8 @@ CLIENT_GET_PET_DETAILS_RESP = 82
|
||||
# (Proposed new message): CLIENT_SET_WORLD_POS = 83
|
||||
if wantOtpServer:
|
||||
CLIENT_ADD_INTEREST = 97
|
||||
CLIENT_ALTER_INTEREST = 98
|
||||
# This is no longer supported. Alter just calls ADD_INTEREST
|
||||
# CLIENT_ALTER_INTEREST = 98
|
||||
CLIENT_REMOVE_INTEREST = 99
|
||||
CLIENT_OBJECT_LOCATION = 102
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user