mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 04:52:24 +02:00
initial commit
This commit is contained in:
parent
c0d7c06d4a
commit
36792e005a
5 changed files with 16 additions and 9 deletions
|
@ -800,7 +800,12 @@ void DomainServerSettingsManager::processUsernameFromIDRequestPacket(QSharedPoin
|
||||||
usernameFromIDReplyPacket->write(nodeUUID.toRfc4122());
|
usernameFromIDReplyPacket->write(nodeUUID.toRfc4122());
|
||||||
usernameFromIDReplyPacket->writeString(verifiedUsername);
|
usernameFromIDReplyPacket->writeString(verifiedUsername);
|
||||||
|
|
||||||
qDebug() << "Sending username" << verifiedUsername << "associated with node" << nodeUUID;
|
// now put in the machine fingerprint
|
||||||
|
DomainServerNodeData* nodeData = reinterpret_cast<DomainServerNodeData*>(matchingNode->getLinkedData());
|
||||||
|
QUuid machineFingerprint = nodeData ? nodeData->getMachineFingerprint() : QUuid();
|
||||||
|
usernameFromIDReplyPacket->write(machineFingerprint.toRfc4122());
|
||||||
|
|
||||||
|
qDebug() << "Sending username" << verifiedUsername << "and machine fingerprint" << machineFingerprint << "associated with node" << nodeUUID;
|
||||||
|
|
||||||
// Ship it!
|
// Ship it!
|
||||||
limitedNodeList->sendPacket(std::move(usernameFromIDReplyPacket), *sendingNode);
|
limitedNodeList->sendPacket(std::move(usernameFromIDReplyPacket), *sendingNode);
|
||||||
|
|
|
@ -923,8 +923,10 @@ void NodeList::processUsernameFromIDReply(QSharedPointer<ReceivedMessage> messag
|
||||||
QString nodeUUIDString = (QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID))).toString();
|
QString nodeUUIDString = (QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID))).toString();
|
||||||
// read the username from the packet
|
// read the username from the packet
|
||||||
QString username = message->readString();
|
QString username = message->readString();
|
||||||
|
// read the machine fingerprint from the packet
|
||||||
|
QString machineFingerprintString = (QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID))).toString();
|
||||||
|
|
||||||
qDebug() << "Got username" << username << "for node" << nodeUUIDString;
|
qDebug() << "Got username" << username << "and machine fingerprint" << machineFingerprintString << "for node" << nodeUUIDString;
|
||||||
|
|
||||||
emit usernameFromIDReply(nodeUUIDString, username);
|
emit usernameFromIDReply(nodeUUIDString, username, machineFingerprintString);
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ signals:
|
||||||
void receivedDomainServerList();
|
void receivedDomainServerList();
|
||||||
void ignoredNode(const QUuid& nodeID);
|
void ignoredNode(const QUuid& nodeID);
|
||||||
void ignoreRadiusEnabledChanged(bool isIgnored);
|
void ignoreRadiusEnabledChanged(bool isIgnored);
|
||||||
void usernameFromIDReply(const QString& nodeID, const QString& username);
|
void usernameFromIDReply(const QString& nodeID, const QString& username, const QString& machineFingerprint);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void stopKeepalivePingTimer();
|
void stopKeepalivePingTimer();
|
||||||
|
|
|
@ -101,10 +101,10 @@ signals:
|
||||||
void enteredIgnoreRadius();
|
void enteredIgnoreRadius();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Notifies scripts of the username associated with a UUID.
|
* Notifies scripts of the username and machine fingerprint associated with a UUID.
|
||||||
* @function Users.enteredIgnoreRadius
|
* @function Users.usernameFromIDReply
|
||||||
*/
|
*/
|
||||||
void usernameFromIDReply(const QString& nodeID, const QString& username);
|
void usernameFromIDReply(const QString& nodeID, const QString& username, const QString& machineFingerprint);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ function populateUserList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// The function that handles the reply from the server
|
// The function that handles the reply from the server
|
||||||
function usernameFromIDReply(id, username) {
|
function usernameFromIDReply(id, username, machineFingerprint) {
|
||||||
var data;
|
var data;
|
||||||
// If the ID we've received is our ID...
|
// If the ID we've received is our ID...
|
||||||
if (AvatarList.getAvatar('').sessionUUID === id) {
|
if (AvatarList.getAvatar('').sessionUUID === id) {
|
||||||
|
@ -145,7 +145,7 @@ function usernameFromIDReply(id, username) {
|
||||||
data = ['', username + ' (hidden)']
|
data = ['', username + ' (hidden)']
|
||||||
} else {
|
} else {
|
||||||
// Set the data to contain the ID and the username+ID concat string.
|
// Set the data to contain the ID and the username+ID concat string.
|
||||||
data = [id, username + '/' + id];
|
data = [id, username + '/' + machineFingerprint];
|
||||||
}
|
}
|
||||||
print('Username Data:', JSON.stringify(data));
|
print('Username Data:', JSON.stringify(data));
|
||||||
// Ship the data off to QML
|
// Ship the data off to QML
|
||||||
|
|
Loading…
Reference in a new issue