mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 20:35:17 +02:00
cleanup logging, move packet parsing to mixers
This commit is contained in:
parent
441b6d2813
commit
095bd7e6c8
6 changed files with 29 additions and 16 deletions
|
@ -557,7 +557,10 @@ void AudioMixer::handleNodeKilled(SharedNodePointer killedNode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioMixer::handleNodeIgnoreRequestPacket(QSharedPointer<ReceivedMessage> packet, SharedNodePointer sendingNode) {
|
void AudioMixer::handleNodeIgnoreRequestPacket(QSharedPointer<ReceivedMessage> packet, SharedNodePointer sendingNode) {
|
||||||
sendingNode->handleNodeIgnoreRequest(packet);
|
// parse out the UUID being ignored from the packet
|
||||||
|
QUuid ignoredUUID = QUuid::fromRfc4122(packet->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
||||||
|
|
||||||
|
sendingNode->addIgnoredNode(ignoredUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudioMixer::removeHRTFsForFinishedInjector(const QUuid& streamID) {
|
void AudioMixer::removeHRTFsForFinishedInjector(const QUuid& streamID) {
|
||||||
|
|
|
@ -434,7 +434,10 @@ void AvatarMixer::handleKillAvatarPacket(QSharedPointer<ReceivedMessage> message
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarMixer::handleNodeIgnoreRequestPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode) {
|
void AvatarMixer::handleNodeIgnoreRequestPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode) {
|
||||||
senderNode->handleNodeIgnoreRequest(message);
|
// parse out the UUID being ignored from the packet
|
||||||
|
QUuid ignoredUUID = QUuid::fromRfc4122(packet->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
||||||
|
|
||||||
|
senderNode->addIgnoredNode(ignoredUUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarMixer::sendStatsPacket() {
|
void AvatarMixer::sendStatsPacket() {
|
||||||
|
|
|
@ -12,15 +12,17 @@
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <UUID.h>
|
|
||||||
|
|
||||||
#include "Node.h"
|
|
||||||
#include "SharedUtil.h"
|
|
||||||
#include "NodePermissions.h"
|
|
||||||
|
|
||||||
#include <QtCore/QDataStream>
|
#include <QtCore/QDataStream>
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
|
#include <UUID.h>
|
||||||
|
|
||||||
|
#include "NetworkLogging.h"
|
||||||
|
#include "NodePermissions.h"
|
||||||
|
#include "SharedUtil.h"
|
||||||
|
|
||||||
|
#include "Node.h"
|
||||||
|
|
||||||
const QString UNKNOWN_NodeType_t_NAME = "Unknown";
|
const QString UNKNOWN_NodeType_t_NAME = "Unknown";
|
||||||
|
|
||||||
int NodePtrMetaTypeId = qRegisterMetaType<Node*>("Node*");
|
int NodePtrMetaTypeId = qRegisterMetaType<Node*>("Node*");
|
||||||
|
@ -78,15 +80,16 @@ void Node::updateClockSkewUsec(qint64 clockSkewSample) {
|
||||||
_clockSkewUsec = (quint64)_clockSkewMovingPercentile.getValueAtPercentile();
|
_clockSkewUsec = (quint64)_clockSkewMovingPercentile.getValueAtPercentile();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Node::handleNodeIgnoreRequest(QSharedPointer<ReceivedMessage> packet) {
|
void Node::addIgnoredNode(const QUuid& otherNodeID) {
|
||||||
// parse out the UUID being ignored from the packet
|
if (otherNodeID != _uuid) {
|
||||||
QUuid ignoredUUID = QUuid::fromRfc4122(packet->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
qCDebug(networking) << "Adding" << uuidStringWithoutCurlyBraces(otherNodeID) << "to ignore set for"
|
||||||
|
|
||||||
qDebug() << "Adding" << uuidStringWithoutCurlyBraces(ignoredUUID) << "to ignore set for"
|
|
||||||
<< uuidStringWithoutCurlyBraces(_uuid);
|
<< uuidStringWithoutCurlyBraces(_uuid);
|
||||||
|
|
||||||
// add the session UUID to the set of ignored ones for this listening node
|
// add the session UUID to the set of ignored ones for this listening node
|
||||||
_ignoredNodeIDSet.insert(ignoredUUID);
|
_ignoredNodeIDSet.insert(otherNodeID);
|
||||||
|
} else {
|
||||||
|
qCWarning(networking) << "Node::addIgnoredNode called with ID of ignoring node - nodes cannot self-ignore.";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QDataStream& operator<<(QDataStream& out, const Node& node) {
|
QDataStream& operator<<(QDataStream& out, const Node& node) {
|
||||||
|
|
|
@ -70,7 +70,7 @@ public:
|
||||||
bool getCanRezTmp() const { return _permissions.canRezTemporaryEntities; }
|
bool getCanRezTmp() const { return _permissions.canRezTemporaryEntities; }
|
||||||
bool getCanWriteToAssetServer() const { return _permissions.canWriteToAssetServer; }
|
bool getCanWriteToAssetServer() const { return _permissions.canWriteToAssetServer; }
|
||||||
|
|
||||||
void handleNodeIgnoreRequest(QSharedPointer<ReceivedMessage> packet);
|
void addIgnoredNode(const QUuid& otherNodeID);
|
||||||
bool isIgnoringNodeWithID(const QUuid& nodeID) const { return _ignoredNodeIDSet.find(nodeID) != _ignoredNodeIDSet.cend(); }
|
bool isIgnoringNodeWithID(const QUuid& nodeID) const { return _ignoredNodeIDSet.find(nodeID) != _ignoredNodeIDSet.cend(); }
|
||||||
|
|
||||||
friend QDataStream& operator<<(QDataStream& out, const Node& node);
|
friend QDataStream& operator<<(QDataStream& out, const Node& node);
|
||||||
|
|
|
@ -38,4 +38,6 @@ void UsersScriptingInterface::ignore(const QUuid& nodeID) {
|
||||||
// send off this ignore packet reliably to the matching node
|
// send off this ignore packet reliably to the matching node
|
||||||
nodeList->sendPacket(std::move(ignorePacket), *destinationNode);
|
nodeList->sendPacket(std::move(ignorePacket), *destinationNode);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
emit ignoredNode(nodeID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,8 @@ class UsersScriptingInterface : public QObject, public Dependency {
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void ignore(const QUuid& nodeID);
|
void ignore(const QUuid& nodeID);
|
||||||
|
signals:
|
||||||
|
void ignoredNode(const QUuid& nodeID);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue