History

Merge pull request #4107 from huffman/fix-update-my-avatar

Fix issue with avatar data being sent too often

Philip Rosedale committed 11 years ago

Commit 67c3f9a2 parents e811479 00487fb2 files · +12 −1Browse files

Showing the changes to interface/src/Application.cpp (1 of 2 files). Show all

Unified · Split

interface/src/Application.cpp+6−1
@@ -2137,12 +2137,17 @@ void Application::updateMyAvatar(float deltaTime) { · 2136 unmodified lines
21372137
21382138 _myAvatar->update(deltaTime);
21392139
2140− {
2140+ quint64 now = usecTimestampNow();
2141+ quint64 dt = now - _lastSendAvatarDataTime;
2142+
2143+ if (dt > MIN_TIME_BETWEEN_MY_AVATAR_DATA_SENDS) {
21412144 // send head/hand data to the avatar mixer and voxel server
21422145 PerformanceTimer perfTimer("send");
21432146 QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeAvatarData);
21442147 packet.append(_myAvatar->toByteArray());
21452148 controlledBroadcastToNodes(packet, NodeSet() << NodeType::AvatarMixer);
2149+
2150+ _lastSendAvatarDataTime = now;
21462151 }
21472152 }
21482153

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t