mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-07 22:11:05 +02:00
fix a cast, move a packet
This commit is contained in:
parent
c5840d085c
commit
cf15cbc62f
3 changed files with 11 additions and 11 deletions
|
@ -2885,7 +2885,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType::Value packetTyp
|
|||
}
|
||||
|
||||
// encode the query data
|
||||
int packetSize = _octreeQuery.getBroadcastData(queryPacket->getPayload());
|
||||
int packetSize = _octreeQuery.getBroadcastData(reinterpret_cast<unsigned char*>(queryPacket->getPayload()));
|
||||
queryPacket->setSizeUsed(packetSize);
|
||||
|
||||
// make sure we still have an active socket
|
||||
|
|
|
@ -866,7 +866,7 @@ int MyAvatar::parseDataAtOffset(const QByteArray& packet, int offset) {
|
|||
|
||||
void MyAvatar::sendKillAvatar() {
|
||||
auto killPacket = NLPacket::create(PacketType::KillAvatar, 0);
|
||||
DependencyManager::get<NodeList>()->broadcastToNodes(killPacket, NodeSet() << NodeType::AvatarMixer);
|
||||
DependencyManager::get<NodeList>()->broadcastToNodes(std::move(killPacket), NodeSet() << NodeType::AvatarMixer);
|
||||
}
|
||||
|
||||
void MyAvatar::updateLookAtTargetAvatar() {
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
void OctreePacketProcessor::processPacket(const SharedNodePointer& sendingNode, const QByteArray& packet) {
|
||||
PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
|
||||
"OctreePacketProcessor::processPacket()");
|
||||
|
||||
|
||||
QByteArray mutablePacket = packet;
|
||||
|
||||
const int WAY_BEHIND = 300;
|
||||
|
@ -34,7 +34,7 @@ void OctreePacketProcessor::processPacket(const SharedNodePointer& sendingNode,
|
|||
|
||||
|
||||
PacketType::Value voxelPacketType = packetTypeForPacket(mutablePacket);
|
||||
|
||||
|
||||
// note: PacketType_OCTREE_STATS can have PacketType_VOXEL_DATA
|
||||
// immediately following them inside the same packet. So, we process the PacketType_OCTREE_STATS first
|
||||
// then process any remaining bytes as if it was another packet
|
||||
|
@ -43,7 +43,7 @@ void OctreePacketProcessor::processPacket(const SharedNodePointer& sendingNode,
|
|||
wasStatsPacket = true;
|
||||
if (messageLength > statsMessageLength) {
|
||||
mutablePacket = mutablePacket.mid(statsMessageLength);
|
||||
|
||||
|
||||
// TODO: this does not look correct, the goal is to test the packet version for the piggyback, but
|
||||
// this is testing the version and hash of the original packet
|
||||
if (!DependencyManager::get<NodeList>()->packetVersionAndHashMatch(packet)) {
|
||||
|
@ -54,28 +54,28 @@ void OctreePacketProcessor::processPacket(const SharedNodePointer& sendingNode,
|
|||
return; // bail since no piggyback data
|
||||
}
|
||||
} // fall through to piggyback message
|
||||
|
||||
|
||||
voxelPacketType = packetTypeForPacket(mutablePacket);
|
||||
PacketVersion packetVersion = mutablePacket[1];
|
||||
PacketVersion expectedVersion = versionForPacketType(voxelPacketType);
|
||||
|
||||
|
||||
// check version of piggyback packet against expected version
|
||||
if (packetVersion != expectedVersion) {
|
||||
static QMultiMap<QUuid, PacketType> versionDebugSuppressMap;
|
||||
|
||||
static QMultiMap<QUuid, PacketType::Value> versionDebugSuppressMap;
|
||||
|
||||
QUuid senderUUID = uuidFromPacketHeader(packet);
|
||||
if (!versionDebugSuppressMap.contains(senderUUID, voxelPacketType)) {
|
||||
qDebug() << "Packet version mismatch on" << voxelPacketType << "- Sender"
|
||||
<< senderUUID << "sent" << (int)packetVersion << "but"
|
||||
<< (int)expectedVersion << "expected.";
|
||||
|
||||
|
||||
emit packetVersionMismatch();
|
||||
|
||||
versionDebugSuppressMap.insert(senderUUID, voxelPacketType);
|
||||
}
|
||||
return; // bail since piggyback version doesn't match
|
||||
}
|
||||
|
||||
|
||||
app->trackIncomingOctreePacket(mutablePacket, sendingNode, wasStatsPacket);
|
||||
|
||||
if (sendingNode) {
|
||||
|
|
Loading…
Reference in a new issue