mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 11:14:25 +02:00
PR comments; need particular fix on Master for full QA
This commit is contained in:
parent
e940daf5b4
commit
a912fec496
5 changed files with 10 additions and 19 deletions
|
@ -755,7 +755,6 @@ void DomainServerSettingsManager::processUsernameFromIDRequestPacket(QSharedPoin
|
|||
// From the packet, pull the UUID we're identifying
|
||||
QUuid nodeUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
||||
|
||||
// If the UUID isn't NULL...
|
||||
if (!nodeUUID.isNull()) {
|
||||
// First, make sure we actually have a node with this UUID
|
||||
auto limitedNodeList = DependencyManager::get<LimitedNodeList>();
|
||||
|
@ -766,33 +765,25 @@ void DomainServerSettingsManager::processUsernameFromIDRequestPacket(QSharedPoin
|
|||
// It's time to figure out the username
|
||||
QString verifiedUsername = matchingNode->getPermissions().getVerifiedUserName();
|
||||
|
||||
// If the verified username is Empty...
|
||||
if (verifiedUsername.isEmpty()) {
|
||||
// Make sure we're using an empty string as the Verified Username
|
||||
verifiedUsername = "";
|
||||
}
|
||||
// Setup the packet
|
||||
auto usernameFromIDReplyPacket = NLPacket::create(PacketType::UsernameFromIDReply, NUM_BYTES_RFC4122_UUID + sizeof(verifiedUsername), true);
|
||||
|
||||
// write the node ID to the packet
|
||||
usernameFromIDReplyPacket->write(nodeUUID.toRfc4122());
|
||||
// write the username to the packet
|
||||
usernameFromIDReplyPacket->writeString(verifiedUsername);
|
||||
|
||||
// Ship it!
|
||||
limitedNodeList->sendPacket(std::move(usernameFromIDReplyPacket), *sendingNode);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
qWarning() << "Node username request received for unknown node. Refusing to process.";
|
||||
}
|
||||
}
|
||||
else {
|
||||
// This isn't a UUID we can use
|
||||
} else {
|
||||
qWarning() << "Node username request received for invalid node ID. Refusing to process.";
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
qWarning() << "Refusing to process a username request packet from node" << uuidStringWithoutCurlyBraces(sendingNode->getUUID())
|
||||
<< "that does not have kick permissions.";
|
||||
}
|
||||
|
|
|
@ -76,18 +76,18 @@ Rectangle {
|
|||
case 'updateUsername':
|
||||
// The User ID (UUID) is the first parameter in the message.
|
||||
var userId = message.params[0];
|
||||
// The Username String (name + UUID) is the second parameter in the message.
|
||||
// The text that goes in the userName field is the second parameter in the message.
|
||||
var userName = message.params[1];
|
||||
// If the userId is empty, we're updating "myData".
|
||||
if (!userId) {
|
||||
myData.userName = userName;
|
||||
myCard.userName = userName;
|
||||
myCard.userName = userName; // Defensive programming
|
||||
} else {
|
||||
// Get the index in userModel and userData associated with the passed UUID
|
||||
var userIndex = findSessionIndex(userId);
|
||||
// Set the userName appropriately
|
||||
userModel.get(userIndex).userName = userName;
|
||||
userData[userIndex].userName = userName;
|
||||
userData[userIndex].userName = userName; // Defensive programming
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -907,8 +907,7 @@ void NodeList::requestUsernameFromSessionID(const QUuid& nodeID) {
|
|||
qDebug() << "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."
|
||||
<< "Request to get the username of node" << uuidStringWithoutCurlyBraces(nodeID) << "will not be sent";
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ const QSet<PacketType> NON_SOURCED_PACKETS = QSet<PacketType>()
|
|||
PacketVersion versionForPacketType(PacketType packetType) {
|
||||
switch (packetType) {
|
||||
case PacketType::DomainList:
|
||||
return static_cast<PacketVersion>(DomainListVersion::PermissionsGrid);
|
||||
return static_cast<PacketVersion>(DomainListVersion::GetUsernameFromUUIDSupport);
|
||||
case PacketType::EntityAdd:
|
||||
case PacketType::EntityEdit:
|
||||
case PacketType::EntityData:
|
||||
|
|
|
@ -228,7 +228,8 @@ enum class DomainServerAddedNodeVersion : PacketVersion {
|
|||
|
||||
enum class DomainListVersion : PacketVersion {
|
||||
PrePermissionsGrid = 18,
|
||||
PermissionsGrid
|
||||
PermissionsGrid,
|
||||
GetUsernameFromUUIDSupport
|
||||
};
|
||||
|
||||
enum class AudioVersion : PacketVersion {
|
||||
|
|
Loading…
Reference in a new issue