mirror of
https://github.com/lubosz/overte.git
synced 2025-04-07 15:22:09 +02:00
Always stop challenge timer from the right thread
This commit is contained in:
parent
3c35433f86
commit
3b734b2222
3 changed files with 13 additions and 1 deletions
|
@ -499,6 +499,8 @@ void AvatarMixer::handleAvatarKilled(SharedNodePointer avatarNode) {
|
|||
} else {
|
||||
_sessionDisplayNames.erase(displayNameIter);
|
||||
}
|
||||
|
||||
nodeData->getAvatar().stopChallengeTimer();
|
||||
}
|
||||
|
||||
std::unique_ptr<NLPacket> killPacket;
|
||||
|
|
|
@ -332,7 +332,7 @@ void MixerAvatar::sendOwnerChallenge() {
|
|||
void MixerAvatar::processChallengeResponse(ReceivedMessage& response) {
|
||||
QByteArray avatarID;
|
||||
QMutexLocker certifyLocker(&_avatarCertifyLock);
|
||||
QMetaObject::invokeMethod(&_challengeTimer, &QTimer::stop);
|
||||
stopChallengeTimer();
|
||||
if (_verifyState == challengeClient) {
|
||||
QByteArray responseData = response.readAll();
|
||||
if (responseData.length() < 8) {
|
||||
|
@ -365,3 +365,11 @@ void MixerAvatar::processChallengeResponse(ReceivedMessage& response) {
|
|||
qCDebug(avatars) << "WARNING: Unexpected avatar challenge-response in state" << stateToName(_verifyState);
|
||||
}
|
||||
}
|
||||
|
||||
void MixerAvatar::stopChallengeTimer() {
|
||||
if (QThread::currentThread() == thread()) {
|
||||
_challengeTimer.stop();
|
||||
} else {
|
||||
QMetaObject::invokeMethod(&_challengeTimer, &QTimer::stop);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ public:
|
|||
void processCertifyEvents();
|
||||
void processChallengeResponse(ReceivedMessage& response);
|
||||
|
||||
void stopChallengeTimer();
|
||||
|
||||
// Avatar certification/verification:
|
||||
enum VerifyState {
|
||||
nonCertified, requestingFST, receivedFST, staticValidation, requestingOwner, ownerResponse,
|
||||
|
|
Loading…
Reference in a new issue