pass const NLPacket& for all sendUnreliablePacket calls

This commit is contained in:
Stephen Birarda 2015-07-09 11:42:18 -07:00
parent a49b985dad
commit a363f42bb2
6 changed files with 8 additions and 13 deletions

View file

@ -1029,7 +1029,7 @@ void DomainServer::broadcastNewNode(const SharedNodePointer& addedNode) {
addNodePacket->write(rfcConnectionSecret); addNodePacket->write(rfcConnectionSecret);
// send off this packet to the node // send off this packet to the node
limitedNodeList->sendUnreliablePacket(addNodePacket, node); limitedNodeList->sendUnreliablePacket(*addNodePacket, node);
} }
); );
} }
@ -1093,7 +1093,7 @@ void DomainServer::readAvailableDatagrams() {
assignmentStream << uniqueAssignment; assignmentStream << uniqueAssignment;
limitedNodeList->sendUnreliablePacket(assignmentPacket, senderSockAddr); limitedNodeList->sendUnreliablePacket(*assignmentPacket, senderSockAddr);
// add the information for that deployed assignment to the hash of pending assigned nodes // add the information for that deployed assignment to the hash of pending assigned nodes
PendingAssignedNodeData* pendingNodeData = new PendingAssignedNodeData(assignmentToDeploy->getUUID(), PendingAssignedNodeData* pendingNodeData = new PendingAssignedNodeData(assignmentToDeploy->getUUID(),
@ -1124,7 +1124,7 @@ void DomainServer::readAvailableDatagrams() {
dtlsRequiredPacket->writePrimitive(dtlsPort); dtlsRequiredPacket->writePrimitive(dtlsPort);
} }
limitedNodeList->sendUnreliablePacket(dtlsRequiredPacket, senderSockAddr); limitedNodeList->sendUnreliablePacket(*dtlsRequiredPacket, senderSockAddr);
} }
} }
} }

View file

@ -2891,7 +2891,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType::Value packetTyp
queryPacket->setSizeUsed(packetSize); queryPacket->setSizeUsed(packetSize);
// make sure we still have an active socket // make sure we still have an active socket
nodeList->sendUnreliablePacket(queryPacket, node); nodeList->sendUnreliablePacket(*queryPacket, node);
} }
}); });
} }

View file

@ -882,7 +882,7 @@ void AudioClient::handleAudioInput() {
nodeList->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SendAudioPacket); nodeList->flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SendAudioPacket);
nodeList->sendUnreliablePacket(_audioPacket, audioMixer); nodeList->sendUnreliablePacket(*_audioPacket, audioMixer);
_outgoingAvatarAudioSequenceNumber++; _outgoingAvatarAudioSequenceNumber++;
} }

View file

@ -238,7 +238,7 @@ void AudioInjector::injectToMixer() {
SharedNodePointer audioMixer = nodeList->soloNodeOfType(NodeType::AudioMixer); SharedNodePointer audioMixer = nodeList->soloNodeOfType(NodeType::AudioMixer);
// send off this audio packet // send off this audio packet
nodeList->sendUnreliablePacket(audioPacket, audioMixer); nodeList->sendUnreliablePacket(*audioPacket, audioMixer);
outgoingInjectedAudioSequenceNumber++; outgoingInjectedAudioSequenceNumber++;
_currentSendPosition += bytesToCopy; _currentSendPosition += bytesToCopy;

View file

@ -144,16 +144,11 @@ public:
// qint64 writeUnverifiedDatagram(const char* data, qint64 size, const SharedNodePointer& destinationNode, // qint64 writeUnverifiedDatagram(const char* data, qint64 size, const SharedNodePointer& destinationNode,
// const HifiSockAddr& overridenSockAddr = HifiSockAddr()); // const HifiSockAddr& overridenSockAddr = HifiSockAddr());
// //
qint64 sendUnreliablePacket(const NLPacket& packet, const SharedNodePointer& destinationNode) qint64 sendUnreliablePacket(const NLPacket& packet, const SharedNodePointer& destinationNode)
{ assert(false); return 0; } { assert(false); return 0; }
qint64 sendUnreliablePacket(const NLPacket& packet, const HifiSockAddr& sockAddr) qint64 sendUnreliablePacket(const NLPacket& packet, const HifiSockAddr& sockAddr)
{ assert(false); return 0; } { assert(false); return 0; }
// TODO remove those
qint64 sendUnreliablePacket(std::unique_ptr<NLPacket>& packet, const SharedNodePointer& destinationNode)
{ assert(false); return 0; }
qint64 sendUnreliablePacket(std::unique_ptr<NLPacket>& packet, const HifiSockAddr& sockAddr)
{ assert(false); return 0; }
qint64 sendPacket(std::unique_ptr<NLPacket> packet, const SharedNodePointer& destinationNode) qint64 sendPacket(std::unique_ptr<NLPacket> packet, const SharedNodePointer& destinationNode)
{ assert(false); return 0; } { assert(false); return 0; }

View file

@ -272,7 +272,7 @@ bool PacketSender::nonThreadedProcess() {
unlock(); unlock();
// send the packet through the NodeList... // send the packet through the NodeList...
DependencyManager::get<NodeList>()->sendUnreliablePacket(packetPair.second, packetPair.first); DependencyManager::get<NodeList>()->sendUnreliablePacket(*(packetPair.second), packetPair.first);
packetsSentThisCall++; packetsSentThisCall++;
_packetsOverCheckInterval++; _packetsOverCheckInterval++;