mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 06:32:35 +02:00
More robust handling of the avatar verify-failed property
This commit is contained in:
parent
03e3f38ff1
commit
150b4e45d4
6 changed files with 24 additions and 7 deletions
|
@ -1866,6 +1866,9 @@ public:
|
|||
// also clears internal reaction triggers
|
||||
void updateRigControllerParameters(Rig::ControllerParameters& params);
|
||||
|
||||
// Don't substitute verify-fail:
|
||||
virtual const QUrl& getSkeletonModelURL() const override { return _skeletonModelURL; }
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
|
|
|
@ -830,9 +830,14 @@ void Wallet::handleChallengeOwnershipPacket(QSharedPointer<ReceivedMessage> pack
|
|||
}
|
||||
|
||||
void Wallet::sendChallengeOwnershipResponses() {
|
||||
if (_pendingChallenges.size() == 0 || getSalt().length() == 0) {
|
||||
if (_pendingChallenges.size() == 0) {
|
||||
return;
|
||||
}
|
||||
if (getSalt().length() == 0) {
|
||||
qCDebug(commerce) << "Not responding to ownership challenge due to missing Wallet salt";
|
||||
return;
|
||||
}
|
||||
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
EC_KEY* ec = readKeys(keyFilePath());
|
||||
|
|
|
@ -1511,7 +1511,7 @@ void Avatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
|||
}
|
||||
indicateLoadingStatus(LoadingStatus::LoadModel);
|
||||
|
||||
_skeletonModel->setURL(_skeletonModelURL);
|
||||
_skeletonModel->setURL(getSkeletonModelURL());
|
||||
}
|
||||
|
||||
void Avatar::setModelURLFinished(bool success) {
|
||||
|
|
|
@ -1988,6 +1988,7 @@ void AvatarData::processAvatarIdentity(QDataStream& packetStream, bool& identity
|
|||
if (flagValue != _verificationFailed) {
|
||||
_verificationFailed = flagValue;
|
||||
identityChanged = true;
|
||||
setSkeletonModelURL(_skeletonModelURL);
|
||||
}
|
||||
|
||||
if (identity.attachmentData != _attachmentData) {
|
||||
|
@ -2016,6 +2017,18 @@ QUrl AvatarData::getWireSafeSkeletonModelURL() const {
|
|||
return QUrl();
|
||||
}
|
||||
}
|
||||
|
||||
static const QString VERIFY_FAIL_MODEL { "/meshes/verifyFailed.fst" };
|
||||
|
||||
const QUrl& AvatarData::getSkeletonModelURL() const {
|
||||
if (_verificationFailed) {
|
||||
static QUrl VERIFY_FAIL_MODEL_URL = PathUtils::resourcesUrl(VERIFY_FAIL_MODEL);
|
||||
return VERIFY_FAIL_MODEL_URL;
|
||||
} else {
|
||||
return _skeletonModelURL;
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray AvatarData::packSkeletonData() const {
|
||||
// Send an avatar trait packet with the skeleton data before the mesh is loaded
|
||||
int avatarDataSize = 0;
|
||||
|
|
|
@ -1205,7 +1205,7 @@ public:
|
|||
QByteArray identityByteArray(bool setIsReplicated = false) const;
|
||||
|
||||
QUrl getWireSafeSkeletonModelURL() const;
|
||||
const QUrl& getSkeletonModelURL() const { return _skeletonModelURL; }
|
||||
virtual const QUrl& getSkeletonModelURL() const;
|
||||
|
||||
const QString& getDisplayName() const { return _displayName; }
|
||||
const QString& getSessionDisplayName() const { return _sessionDisplayName; }
|
||||
|
|
|
@ -330,10 +330,6 @@ void AvatarHashMap::processAvatarIdentityPacket(QSharedPointer<ReceivedMessage>
|
|||
bool displayNameChanged = false;
|
||||
// In this case, the "sendingNode" is the Avatar Mixer.
|
||||
avatar->processAvatarIdentity(avatarIdentityStream, identityChanged, displayNameChanged);
|
||||
if (avatar->isCertifyFailed() && identityUUID != EMPTY) {
|
||||
qCDebug(avatars) << "Avatar" << avatar->getSessionDisplayName() << "marked as VERIFY-FAILED";
|
||||
avatar->setSkeletonModelURL(PathUtils::resourcesUrl(VERIFY_FAIL_MODEL));
|
||||
}
|
||||
_replicas.processAvatarIdentity(identityUUID, message->getMessage(), identityChanged, displayNameChanged);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue