History

use packet version helpers for PACKET_TYPE_AVATAR_VOXEL_URL

Stephen Birarda committed 13 years ago

Commit 202d4461 parent a287d6d1 file · +8 −3Browse files

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

Unified · Split

interface/src/Application.cpp+8−3
@@ -993,7 +993,11 @@ void Application::sendAvatarVoxelURLMessage(const QUrl& url) { · 992 unmodified lines
993 return; // we don't yet know who we are993 return; // we don't yet know who we are
994 }994 }
995 QByteArray message;995 QByteArray message;
996 message.append(PACKET_TYPE_AVATAR_VOXEL_URL);996
997 char packetHeader[MAX_PACKET_HEADER_BYTES];
998 int numBytesPacketHeader = populateTypeAndVersion((unsigned char*) packetHeader, PACKET_TYPE_AVATAR_VOXEL_URL);
999
1000 message.append(packetHeader, numBytesPacketHeader);
997 message.append((const char*)&ownerID, sizeof(ownerID));1001 message.append((const char*)&ownerID, sizeof(ownerID));
998 message.append(url.toEncoded());1002 message.append(url.toEncoded());
999 1003
@@ -1002,8 +1006,9 @@ void Application::sendAvatarVoxelURLMessage(const QUrl& url) { · 2 unmodified lines
1002 1006
1003void Application::processAvatarVoxelURLMessage(unsigned char *packetData, size_t dataBytes) {1007void Application::processAvatarVoxelURLMessage(unsigned char *packetData, size_t dataBytes) {
1004 // skip the header1008 // skip the header
1005 packetData++;1009 int numBytesPacketHeader = numBytesForPacketHeader(packetData);
1006 dataBytes--;1010 packetData += numBytesPacketHeader;
1011 dataBytes -= numBytesPacketHeader;
1007 1012
1008 // read the node id1013 // read the node id
1009 uint16_t nodeID = *(uint16_t*)packetData;1014 uint16_t nodeID = *(uint16_t*)packetData;

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