History

Fix issue with avatar data being sent too often

Ryan Huffman committed 11 years ago

Commit 00487fb1 parent 89967fb2 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
@@ -2135,12 +2135,17 @@ void Application::updateMyAvatar(float deltaTime) { · 2134 unmodified lines
21352135
21362136 _myAvatar->update(deltaTime);
21372137
2138− {
2138+ quint64 now = usecTimestampNow();
2139+ quint64 dt = now - _lastSendAvatarDataTime;
2140+
2141+ if (dt > MIN_TIME_BETWEEN_MY_AVATAR_DATA_SENDS) {
21392142 // send head/hand data to the avatar mixer and voxel server
21402143 PerformanceTimer perfTimer("send");
21412144 QByteArray packet = byteArrayWithPopulatedHeader(PacketTypeAvatarData);
21422145 packet.append(_myAvatar->toByteArray());
21432146 controlledBroadcastToNodes(packet, NodeSet() << NodeType::AvatarMixer);
2147+
2148+ _lastSendAvatarDataTime = now;
21442149 }
21452150 }
21462151

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