mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:18:52 +02:00
only output version mismatch once per sender per packet
This commit is contained in:
parent
281f2c6614
commit
f86b793c96
1 changed files with 8 additions and 1 deletions
|
@ -88,9 +88,16 @@ bool NodeList::packetVersionAndHashMatch(const QByteArray& packet) {
|
||||||
PacketType mismatchType = packetTypeForPacket(packet);
|
PacketType mismatchType = packetTypeForPacket(packet);
|
||||||
int numPacketTypeBytes = numBytesArithmeticCodingFromBuffer(packet.data());
|
int numPacketTypeBytes = numBytesArithmeticCodingFromBuffer(packet.data());
|
||||||
|
|
||||||
qDebug() << "Packet version mismatch on" << packetTypeForPacket(packet) << "- Sender"
|
static QMultiMap<QUuid, PacketType> versionDebugSuppressMap;
|
||||||
|
|
||||||
|
QUuid senderUUID = uuidFromPacketHeader(packet);
|
||||||
|
if (!versionDebugSuppressMap.contains(senderUUID, checkType)) {
|
||||||
|
qDebug() << "Packet version mismatch on" << packetTypeForPacket(packet) << "- Sender"
|
||||||
<< uuidFromPacketHeader(packet) << "sent" << qPrintable(QString::number(packet[numPacketTypeBytes])) << "but"
|
<< uuidFromPacketHeader(packet) << "sent" << qPrintable(QString::number(packet[numPacketTypeBytes])) << "but"
|
||||||
<< qPrintable(QString::number(versionForPacketType(mismatchType))) << "expected.";
|
<< qPrintable(QString::number(versionForPacketType(mismatchType))) << "expected.";
|
||||||
|
|
||||||
|
versionDebugSuppressMap.insert(senderUUID, checkType);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue