mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
change some const unique_ptr to const NLPacket
This commit is contained in:
parent
885068bd6b
commit
922d6413d5
4 changed files with 7 additions and 7 deletions
|
@ -356,7 +356,7 @@ void OctreeQueryNode::dumpOutOfView() {
|
|||
}
|
||||
}
|
||||
|
||||
void OctreeQueryNode::packetSent(const std::unique_ptr<NLPacket>& packet) {
|
||||
void OctreeQueryNode::packetSent(const NLPacket& packet) {
|
||||
_sentPacketHistory.packetSent(_sequenceNumber, packet);
|
||||
_sequenceNumber++;
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public:
|
|||
bool isShuttingDown() const { return _isShuttingDown; }
|
||||
|
||||
void octreePacketSent() { packetSent(_octreePacket); }
|
||||
void packetSent(const std::unique_ptr<NLPacket>& packet);
|
||||
void packetSent(const NLPacket& packet);
|
||||
|
||||
OCTREE_PACKET_SEQUENCE getSequenceNumber() const { return _sequenceNumber; }
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ SentPacketHistory::SentPacketHistory(int size)
|
|||
|
||||
}
|
||||
|
||||
void SentPacketHistory::packetSent(uint16_t sequenceNumber, const std::unique_ptr<NLPacket>& packet) {
|
||||
void SentPacketHistory::packetSent(uint16_t sequenceNumber, const NLPacket& packet) {
|
||||
|
||||
// check if given seq number has the expected value. if not, something's wrong with
|
||||
// the code calling this function
|
||||
|
@ -38,7 +38,7 @@ void SentPacketHistory::packetSent(uint16_t sequenceNumber, const std::unique_pt
|
|||
_sentPackets.insert(NLPacket::createCopy(packet));
|
||||
}
|
||||
|
||||
const std::unique_ptr<NLPacket>& SentPacketHistory::getPacket(uint16_t sequenceNumber) const {
|
||||
const NLPacket& SentPacketHistory::getPacket(uint16_t sequenceNumber) const {
|
||||
|
||||
const int UINT16_RANGE = std::numeric_limits<uint16_t>::max() + 1;
|
||||
|
||||
|
@ -49,5 +49,5 @@ const std::unique_ptr<NLPacket>& SentPacketHistory::getPacket(uint16_t sequenceN
|
|||
seqDiff += UINT16_RANGE;
|
||||
}
|
||||
|
||||
return *_sentPackets.get(seqDiff);
|
||||
return *_sentPackets.get(seqDiff).get();
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ class SentPacketHistory {
|
|||
public:
|
||||
SentPacketHistory(int size = MAX_REASONABLE_SEQUENCE_GAP);
|
||||
|
||||
void packetSent(uint16_t sequenceNumber, const std::unique_ptr<NLPacket>& packet);
|
||||
const std::unique_ptr<NLPacket>& getPacket(uint16_t sequenceNumber) const;
|
||||
void packetSent(uint16_t sequenceNumber, const NLPacket& packet);
|
||||
const NLPacket& getPacket(uint16_t sequenceNumber) const;
|
||||
|
||||
private:
|
||||
RingBufferHistory<std::unique_ptr<NLPacket>> _sentPackets; // circular buffer
|
||||
|
|
Loading…
Reference in a new issue