diff --git a/direct/src/distributed/ClientRepository.py b/direct/src/distributed/ClientRepository.py index a95eda3656..c19a375e74 100644 --- a/direct/src/distributed/ClientRepository.py +++ b/direct/src/distributed/ClientRepository.py @@ -713,9 +713,9 @@ 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) + datagram.addUint32(base.localAvatar.defaultShard) # Add zone id datagram.addUint32(zoneId) # if we have an explicit list of visible zones, add them @@ -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. diff --git a/direct/src/distributed/MsgTypes.py b/direct/src/distributed/MsgTypes.py index 8d36ade356..e7038e47cf 100644 --- a/direct/src/distributed/MsgTypes.py +++ b/direct/src/distributed/MsgTypes.py @@ -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