mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:38:02 +02:00
Fix the bug
This commit is contained in:
parent
d2c7342a62
commit
e22c1ac30e
1 changed files with 9 additions and 9 deletions
|
@ -780,12 +780,12 @@ void DomainServerSettingsManager::processNodeKickRequestPacket(QSharedPointer<Re
|
||||||
|
|
||||||
// This function processes the "Get Username from ID" request.
|
// This function processes the "Get Username from ID" request.
|
||||||
void DomainServerSettingsManager::processUsernameFromIDRequestPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) {
|
void DomainServerSettingsManager::processUsernameFromIDRequestPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) {
|
||||||
// Before we do any processing on this packet, make sure it comes from a node that is allowed to kick (is an admin)
|
// From the packet, pull the UUID we're identifying
|
||||||
if (sendingNode->getCanKick()) {
|
QUuid nodeUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
||||||
// From the packet, pull the UUID we're identifying
|
if (!nodeUUID.isNull()) {
|
||||||
QUuid nodeUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
// Before we do any processing on this packet, make sure it comes from a node that is allowed to kick (is an admin)
|
||||||
|
// OR from a node whose UUID matches the one in the packet
|
||||||
if (!nodeUUID.isNull()) {
|
if (sendingNode->getCanKick() || nodeUUID == sendingNode->getUUID()) {
|
||||||
// First, make sure we actually have a node with this UUID
|
// First, make sure we actually have a node with this UUID
|
||||||
auto limitedNodeList = DependencyManager::get<LimitedNodeList>();
|
auto limitedNodeList = DependencyManager::get<LimitedNodeList>();
|
||||||
auto matchingNode = limitedNodeList->nodeWithUUID(nodeUUID);
|
auto matchingNode = limitedNodeList->nodeWithUUID(nodeUUID);
|
||||||
|
@ -813,12 +813,12 @@ void DomainServerSettingsManager::processUsernameFromIDRequestPacket(QSharedPoin
|
||||||
qWarning() << "Node username request received for unknown node. Refusing to process.";
|
qWarning() << "Node username request received for unknown node. Refusing to process.";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "Node username request received for invalid node ID. Refusing to process.";
|
qWarning() << "Refusing to process a username request packet from node" << uuidStringWithoutCurlyBraces(sendingNode->getUUID())
|
||||||
|
<< ". Either node doesn't have kick permissions or is requesting a username not from their UUID.";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "Refusing to process a username request packet from node" << uuidStringWithoutCurlyBraces(sendingNode->getUUID())
|
qWarning() << "Node username request received for invalid node ID. Refusing to process.";
|
||||||
<< "that does not have kick permissions.";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue