copy version in Packet move ctor/assignment

This commit is contained in:
Stephen Birarda 2015-07-22 11:17:50 -07:00
parent 8363b0d522
commit 3fbda89f1d
2 changed files with 4 additions and 2 deletions

View file

@ -77,8 +77,8 @@ void OctreePacketProcessor::processPacket(QSharedPointer<NLPacket> packet, Share
const QUuid& senderUUID = packet->getSourceID();
if (!versionDebugSuppressMap.contains(senderUUID, packetType)) {
qDebug() << "Packet version mismatch on" << packetType << "- Sender"
<< senderUUID << "sent" << (int) packetType << "but"
qDebug() << "OctreePacketProcessor - piggyback packet version mismatch on" << packetType << "- Sender"
<< senderUUID << "sent" << (int) packet->getVersion() << "but"
<< (int) versionForPacketType(packetType) << "expected.";
emit packetVersionMismatch();

View file

@ -104,6 +104,7 @@ Packet::Packet(const Packet& other) :
Packet& Packet::operator=(const Packet& other) {
_type = other._type;
_version = other._version;
_packetSize = other._packetSize;
_packet = std::unique_ptr<char>(new char[_packetSize]);
@ -129,6 +130,7 @@ Packet::Packet(Packet&& other) {
Packet& Packet::operator=(Packet&& other) {
_type = other._type;
_version = other._version;
_packetSize = other._packetSize;
_packet = std::move(other._packet);