From 18dd61ec7e9e047d2341c78f15e6c10df9edf51a Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Tue, 7 Jul 2015 12:09:54 -0700 Subject: [PATCH] Update JurisdictionListener to use NLPacket --- libraries/octree/src/JurisdictionListener.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libraries/octree/src/JurisdictionListener.cpp b/libraries/octree/src/JurisdictionListener.cpp index 71c4feda96..a86130b005 100644 --- a/libraries/octree/src/JurisdictionListener.cpp +++ b/libraries/octree/src/JurisdictionListener.cpp @@ -33,17 +33,15 @@ void JurisdictionListener::nodeKilled(SharedNodePointer node) { } bool JurisdictionListener::queueJurisdictionRequest() { - static unsigned char buffer[MAX_PACKET_SIZE]; - unsigned char* bufferOut = &buffer[0]; + auto packet = NLPacket::create(PacketType::JurisdictionRequest, 0); auto nodeList = DependencyManager::get(); - int sizeOut = nodeList->populatePacketHeader(reinterpret_cast(bufferOut), PacketTypeJurisdictionRequest); int nodeCount = 0; nodeList->eachNode([&](const SharedNodePointer& node) { if (node->getType() == getNodeType() && node->getActiveSocket()) { - _packetSender.queuePacketForSending(node, QByteArray(reinterpret_cast(bufferOut), sizeOut)); + _packetSender.queuePacketForSending(node, packet); nodeCount++; } });