mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 17:01:18 +02:00
CR feedback
This commit is contained in:
parent
8a35afd3ac
commit
0ec01c0dc5
1 changed files with 13 additions and 17 deletions
|
@ -1040,25 +1040,20 @@ void NodeList::muteNodeBySessionID(const QUuid& nodeID) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeList::requestUsernameFromSessionID(const QUuid& nodeID) {
|
void NodeList::requestUsernameFromSessionID(const QUuid& nodeID) {
|
||||||
// send a request to domain-server to get the username associated with the given session ID
|
// send a request to domain-server to get the username/machine fingerprint/admin status associated with the given session ID
|
||||||
if (getThisNodeCanKick() || nodeID.isNull()) {
|
// If the requesting user isn't an admin, the username and machine fingerprint will return "".
|
||||||
// setup the packet
|
auto usernameFromIDRequestPacket = NLPacket::create(PacketType::UsernameFromIDRequest, NUM_BYTES_RFC4122_UUID, true);
|
||||||
auto usernameFromIDRequestPacket = NLPacket::create(PacketType::UsernameFromIDRequest, NUM_BYTES_RFC4122_UUID, true);
|
|
||||||
|
|
||||||
// write the node ID to the packet
|
// write the node ID to the packet
|
||||||
if (nodeID.isNull()) {
|
if (nodeID.isNull()) {
|
||||||
usernameFromIDRequestPacket->write(getSessionUUID().toRfc4122());
|
usernameFromIDRequestPacket->write(getSessionUUID().toRfc4122());
|
||||||
} else {
|
|
||||||
usernameFromIDRequestPacket->write(nodeID.toRfc4122());
|
|
||||||
}
|
|
||||||
|
|
||||||
qCDebug(networking) << "Sending packet to get username of node" << uuidStringWithoutCurlyBraces(nodeID);
|
|
||||||
|
|
||||||
sendPacket(std::move(usernameFromIDRequestPacket), _domainHandler.getSockAddr());
|
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "You do not have permissions to kick in this domain."
|
usernameFromIDRequestPacket->write(nodeID.toRfc4122());
|
||||||
<< "Request to get the username of node" << uuidStringWithoutCurlyBraces(nodeID) << "will not be sent";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qCDebug(networking) << "Sending packet to get username/fingerprint/admin status of node" << uuidStringWithoutCurlyBraces(nodeID);
|
||||||
|
|
||||||
|
sendPacket(std::move(usernameFromIDRequestPacket), _domainHandler.getSockAddr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void NodeList::processUsernameFromIDReply(QSharedPointer<ReceivedMessage> message) {
|
void NodeList::processUsernameFromIDReply(QSharedPointer<ReceivedMessage> message) {
|
||||||
|
@ -1071,7 +1066,8 @@ void NodeList::processUsernameFromIDReply(QSharedPointer<ReceivedMessage> messag
|
||||||
bool isAdmin;
|
bool isAdmin;
|
||||||
message->readPrimitive(&isAdmin);
|
message->readPrimitive(&isAdmin);
|
||||||
|
|
||||||
qCDebug(networking) << "Got username" << username << "and machine fingerprint" << machineFingerprintString << "for node" << nodeUUIDString;
|
qCDebug(networking) << "Got username" << username << "and machine fingerprint"
|
||||||
|
<< machineFingerprintString << "for node" << nodeUUIDString << ". isAdmin:" << isAdmin;
|
||||||
|
|
||||||
emit usernameFromIDReply(nodeUUIDString, username, machineFingerprintString, isAdmin);
|
emit usernameFromIDReply(nodeUUIDString, username, machineFingerprintString, isAdmin);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue