mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:37:58 +02:00
Remove helper function
This commit is contained in:
parent
0b32a5d935
commit
cee1734006
1 changed files with 3 additions and 8 deletions
|
@ -214,19 +214,14 @@ bool LimitedNodeList::packetSourceAndHashMatch(const NLPacket& packet, SharedNod
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NLPacket helper for filling the header
|
qint64 LimitedNodeList::writeDatagram(const NLPacket& packet, const HifiSockAddr& destinationSockAddr,
|
||||||
void writePacketheader(const NLPacket& packet, const QUuid& sessionUUID = QUuid(), const QUuid& connectionSecret = QUuid()) {
|
const QUuid& connectionSecret) {
|
||||||
if (!NON_SOURCED_PACKETS.contains(packet.getType())) {
|
if (!NON_SOURCED_PACKETS.contains(packet.getType())) {
|
||||||
const_cast<NLPacket&>(packet).writeSourceID(sessionUUID);
|
const_cast<NLPacket&>(packet).writeSourceID(getSessionUUID());
|
||||||
}
|
}
|
||||||
if (!connectionSecret.isNull() && !NON_VERIFIED_PACKETS.contains(packet.getType())) {
|
if (!connectionSecret.isNull() && !NON_VERIFIED_PACKETS.contains(packet.getType())) {
|
||||||
const_cast<NLPacket&>(packet).writeVerificationHash(packet.payloadHashWithConnectionUUID(connectionSecret));
|
const_cast<NLPacket&>(packet).writeVerificationHash(packet.payloadHashWithConnectionUUID(connectionSecret));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
qint64 LimitedNodeList::writeDatagram(const NLPacket& packet, const HifiSockAddr& destinationSockAddr,
|
|
||||||
const QUuid& connectionSecret) {
|
|
||||||
writePacketheader(packet, getSessionUUID(), connectionSecret);
|
|
||||||
return writeDatagram({packet.getData(), static_cast<int>(packet.getSizeWithHeader())}, destinationSockAddr);
|
return writeDatagram({packet.getData(), static_cast<int>(packet.getSizeWithHeader())}, destinationSockAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue