mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
repairs for NetworkPacket removal
This commit is contained in:
parent
1cfa65a3df
commit
7a9dbd7f2f
2 changed files with 9 additions and 8 deletions
|
@ -267,19 +267,20 @@ bool PacketSender::nonThreadedProcess() {
|
|||
while ((packetsSentThisCall < packetsToSendThisCall) && (packetsLeft > 0)) {
|
||||
lock();
|
||||
|
||||
NodePacketPair& packetPair = _packets.pop_front();
|
||||
NodePacketPair packetPair = std::move(_packets.front());
|
||||
_packets.pop_front();
|
||||
packetsLeft = _packets.size();
|
||||
|
||||
unlock();
|
||||
|
||||
// send the packet through the NodeList...
|
||||
DependencyManager::get<NodeList>()->sendUnreliablePacket(packetPair->second(), packetPair->first());
|
||||
DependencyManager::get<NodeList>()->sendUnreliablePacket(packetPair.second, packetPair.first);
|
||||
|
||||
packetsSentThisCall++;
|
||||
_packetsOverCheckInterval++;
|
||||
_totalPacketsSent++;
|
||||
|
||||
int packetSize = packetPair->second()->getSizeWithHeader();
|
||||
int packetSize = packetPair.second->getSizeWithHeader();
|
||||
|
||||
_totalBytesSent += packetSize;
|
||||
emit packetSent(packetSize);
|
||||
|
|
|
@ -47,19 +47,19 @@ bool ReceivedPacketProcessor::process() {
|
|||
}
|
||||
|
||||
lock();
|
||||
QVector<NetworkPacket> currentPackets;
|
||||
std::list<NodePacketPair> currentPackets;
|
||||
currentPackets.swap(_packets);
|
||||
unlock();
|
||||
|
||||
foreach(auto& packet, currentPackets) {
|
||||
foreach(auto& packetPair, currentPackets) {
|
||||
// TODO: Replace QByteArray() once NLPacket is coming through on receive side
|
||||
processPacket(packet->first(), QByteArray());
|
||||
processPacket(packetPair.first, QByteArray());
|
||||
midProcess();
|
||||
}
|
||||
|
||||
lock();
|
||||
foreach(auto& packet, currentPackets) {
|
||||
_nodePacketCounts[packet.getNode()->getUUID()]--;
|
||||
foreach(auto& packetPair, currentPackets) {
|
||||
_nodePacketCounts[packetPair.first->getUUID()]--;
|
||||
}
|
||||
unlock();
|
||||
|
||||
|
|
Loading…
Reference in a new issue