From b201d13e31ccb1ede0733bf0d8cab37436e2f30b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 11 Jul 2013 12:42:45 -0700 Subject: [PATCH] refactor ping packet sending to push past version byte --- interface/src/Application.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index cd74b9c6ab..eb2fd77a55 100755 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -904,15 +904,15 @@ void Application::wheelEvent(QWheelEvent* event) { void Application::sendPingPackets() { - char nodeTypesOfInterest[] = {NODE_TYPE_VOXEL_SERVER, NODE_TYPE_AUDIO_MIXER, NODE_TYPE_AVATAR_MIXER}; + const char nodesToPing[] = {NODE_TYPE_VOXEL_SERVER, NODE_TYPE_AUDIO_MIXER, NODE_TYPE_AVATAR_MIXER}; uint64_t currentTime = usecTimestampNow(); unsigned char pingPacket[numBytesForPacketHeader((unsigned char*) &PACKET_TYPE_PING) + sizeof(currentTime)]; int numHeaderBytes = populateTypeAndVersion(pingPacket, PACKET_TYPE_PING); - memcpy(&pingPacket[1], ¤tTime, sizeof(currentTime)); - getInstance()->controlledBroadcastToNodes(pingPacket, numHeaderBytes + sizeof(currentTime), - nodeTypesOfInterest, sizeof(nodeTypesOfInterest)); + memcpy(pingPacket + numHeaderBytes, ¤tTime, sizeof(currentTime)); + getInstance()->controlledBroadcastToNodes(pingPacket, sizeof(pingPacket), + nodesToPing, sizeof(nodesToPing)); } // Every second, check the frame rates and other stuff