Merge pull request #6395 from hyperlogic/tony/avatar-mixer-identity-fixes

AvatarMixer: remove redundant identity packet send
This commit is contained in:
Stephen Birarda 2015-11-16 10:35:42 -08:00
commit 8dcf245b74
3 changed files with 2 additions and 11 deletions

View file

@ -245,9 +245,8 @@ void AvatarMixer::broadcastAvatarData() {
return;
}
// if an avatar has just connected make sure we send out the mesh and billboard
bool forceSend = !nodeData->checkAndSetHasReceivedFirstPackets()
|| !otherNodeData->checkAndSetHasReceivedFirstPacketsFrom(node->getUUID());
// make sure we send out identity and billboard packets to and from new arrivals.
bool forceSend = !otherNodeData->checkAndSetHasReceivedFirstPacketsFrom(node->getUUID());
// we will also force a send of billboard or identity packet
// if either has changed in the last frame

View file

@ -21,12 +21,6 @@ int AvatarMixerClientData::parseData(NLPacket& packet) {
return _avatar.parseDataFromBuffer(packet.readWithoutCopy(packet.bytesLeftToRead()));
}
bool AvatarMixerClientData::checkAndSetHasReceivedFirstPackets() {
bool oldValue = _hasReceivedFirstPackets;
_hasReceivedFirstPackets = true;
return oldValue;
}
bool AvatarMixerClientData::checkAndSetHasReceivedFirstPacketsFrom(const QUuid& uuid) {
if (_hasReceivedFirstPacketsFrom.find(uuid) == _hasReceivedFirstPacketsFrom.end()) {
_hasReceivedFirstPacketsFrom.insert(uuid);

View file

@ -36,7 +36,6 @@ public:
int parseData(NLPacket& packet);
AvatarData& getAvatar() { return _avatar; }
bool checkAndSetHasReceivedFirstPackets();
bool checkAndSetHasReceivedFirstPacketsFrom(const QUuid& uuid);
uint16_t getLastBroadcastSequenceNumber(const QUuid& nodeUUID) const;
@ -87,7 +86,6 @@ private:
std::unordered_map<QUuid, uint16_t> _lastBroadcastSequenceNumbers;
std::unordered_set<QUuid> _hasReceivedFirstPacketsFrom;
bool _hasReceivedFirstPackets = false;
quint64 _billboardChangeTimestamp = 0;
quint64 _identityChangeTimestamp = 0;