mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 03:50:40 +02:00
use packet version helpers for PACKET_TYPE_AVATAR_VOXEL_URL
This commit is contained in:
parent
a287d6d940
commit
202d446f07
1 changed files with 8 additions and 3 deletions
|
@ -993,7 +993,11 @@ void Application::sendAvatarVoxelURLMessage(const QUrl& url) {
|
||||||
return; // we don't yet know who we are
|
return; // we don't yet know who we are
|
||||||
}
|
}
|
||||||
QByteArray message;
|
QByteArray message;
|
||||||
message.append(PACKET_TYPE_AVATAR_VOXEL_URL);
|
|
||||||
|
char packetHeader[MAX_PACKET_HEADER_BYTES];
|
||||||
|
int numBytesPacketHeader = populateTypeAndVersion((unsigned char*) packetHeader, PACKET_TYPE_AVATAR_VOXEL_URL);
|
||||||
|
|
||||||
|
message.append(packetHeader, numBytesPacketHeader);
|
||||||
message.append((const char*)&ownerID, sizeof(ownerID));
|
message.append((const char*)&ownerID, sizeof(ownerID));
|
||||||
message.append(url.toEncoded());
|
message.append(url.toEncoded());
|
||||||
|
|
||||||
|
@ -1002,8 +1006,9 @@ void Application::sendAvatarVoxelURLMessage(const QUrl& url) {
|
||||||
|
|
||||||
void Application::processAvatarVoxelURLMessage(unsigned char *packetData, size_t dataBytes) {
|
void Application::processAvatarVoxelURLMessage(unsigned char *packetData, size_t dataBytes) {
|
||||||
// skip the header
|
// skip the header
|
||||||
packetData++;
|
int numBytesPacketHeader = numBytesForPacketHeader(packetData);
|
||||||
dataBytes--;
|
packetData += numBytesPacketHeader;
|
||||||
|
dataBytes -= numBytesPacketHeader;
|
||||||
|
|
||||||
// read the node id
|
// read the node id
|
||||||
uint16_t nodeID = *(uint16_t*)packetData;
|
uint16_t nodeID = *(uint16_t*)packetData;
|
||||||
|
|
Loading…
Reference in a new issue