mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 14:21:10 +02:00
some initial debugging on tpose avatars
This commit is contained in:
parent
b77917b8d1
commit
e89b6c5d2c
11 changed files with 53 additions and 13 deletions
|
@ -341,6 +341,8 @@ void Avatar::updateAvatarEntities() {
|
||||||
void Avatar::simulate(float deltaTime, bool inView) {
|
void Avatar::simulate(float deltaTime, bool inView) {
|
||||||
PROFILE_RANGE(simulation, "simulate");
|
PROFILE_RANGE(simulation, "simulate");
|
||||||
|
|
||||||
|
//qDebug() << __FUNCTION__ << "skeleton download attempts:" << _skeletonModel->getResourceDownloadAttempts();
|
||||||
|
|
||||||
_simulationRate.increment();
|
_simulationRate.increment();
|
||||||
if (inView) {
|
if (inView) {
|
||||||
_simulationInViewRate.increment();
|
_simulationInViewRate.increment();
|
||||||
|
@ -1112,11 +1114,16 @@ void Avatar::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
||||||
|
|
||||||
void Avatar::setModelURLFinished(bool success) {
|
void Avatar::setModelURLFinished(bool success) {
|
||||||
if (!success && _skeletonModelURL != AvatarData::defaultFullAvatarModelUrl()) {
|
if (!success && _skeletonModelURL != AvatarData::defaultFullAvatarModelUrl()) {
|
||||||
qCWarning(interfaceapp) << "Using default after failing to load Avatar model: " << _skeletonModelURL;
|
// FIXME --
|
||||||
// call _skeletonModel.setURL, but leave our copy of _skeletonModelURL alone. This is so that
|
if (_skeletonModel->getResourceDownloadAttempts() > 4) {
|
||||||
// we don't redo this every time we receive an identity packet from the avatar with the bad url.
|
qCWarning(interfaceapp) << "Using default after failing to load Avatar model: " << _skeletonModelURL;
|
||||||
QMetaObject::invokeMethod(_skeletonModel.get(), "setURL",
|
// call _skeletonModel.setURL, but leave our copy of _skeletonModelURL alone. This is so that
|
||||||
Qt::QueuedConnection, Q_ARG(QUrl, AvatarData::defaultFullAvatarModelUrl()));
|
// we don't redo this every time we receive an identity packet from the avatar with the bad url.
|
||||||
|
QMetaObject::invokeMethod(_skeletonModel.get(), "setURL",
|
||||||
|
Qt::QueuedConnection, Q_ARG(QUrl, AvatarData::defaultFullAvatarModelUrl()));
|
||||||
|
} else {
|
||||||
|
qCWarning(interfaceapp) << "Avatar model: " << _skeletonModelURL << "failed to load... attempts:" << _skeletonModel->getResourceDownloadAttempts();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1468,6 +1468,7 @@ QUrl AvatarData::cannonicalSkeletonModelURL(const QUrl& emptyURL) const {
|
||||||
void AvatarData::processAvatarIdentity(const Identity& identity, bool& identityChanged, bool& displayNameChanged) {
|
void AvatarData::processAvatarIdentity(const Identity& identity, bool& identityChanged, bool& displayNameChanged) {
|
||||||
|
|
||||||
if (_firstSkeletonCheck || (identity.skeletonModelURL != cannonicalSkeletonModelURL(emptyURL))) {
|
if (_firstSkeletonCheck || (identity.skeletonModelURL != cannonicalSkeletonModelURL(emptyURL))) {
|
||||||
|
qDebug() << __FUNCTION__ << "about to call setSkeletonModelURL(identity.skeletonModelURL);... identity.skeletonModelURL:" << identity.skeletonModelURL;
|
||||||
setSkeletonModelURL(identity.skeletonModelURL);
|
setSkeletonModelURL(identity.skeletonModelURL);
|
||||||
identityChanged = true;
|
identityChanged = true;
|
||||||
if (_firstSkeletonCheck) {
|
if (_firstSkeletonCheck) {
|
||||||
|
@ -1514,6 +1515,10 @@ QByteArray AvatarData::identityByteArray() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarData::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
void AvatarData::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
||||||
|
if (skeletonModelURL.isEmpty()) {
|
||||||
|
qDebug() << __FUNCTION__ << "caller called with empty URL.";
|
||||||
|
}
|
||||||
|
|
||||||
const QUrl& expanded = skeletonModelURL.isEmpty() ? AvatarData::defaultFullAvatarModelUrl() : skeletonModelURL;
|
const QUrl& expanded = skeletonModelURL.isEmpty() ? AvatarData::defaultFullAvatarModelUrl() : skeletonModelURL;
|
||||||
if (expanded == _skeletonModelURL) {
|
if (expanded == _skeletonModelURL) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -126,6 +126,10 @@ AvatarSharedPointer AvatarHashMap::parseAvatarData(QSharedPointer<ReceivedMessag
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarHashMap::processAvatarIdentityPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) {
|
void AvatarHashMap::processAvatarIdentityPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode) {
|
||||||
|
qDebug() << __FUNCTION__ << "sendingNode:" << sendingNode << "message.failed():" << message->failed()
|
||||||
|
<< "isComplete:" << message->isComplete()
|
||||||
|
<< "messageNumber:" << message->getMessageNumber();
|
||||||
|
|
||||||
AvatarData::Identity identity;
|
AvatarData::Identity identity;
|
||||||
AvatarData::parseAvatarIdentityPacket(message->getMessage(), identity);
|
AvatarData::parseAvatarIdentityPacket(message->getMessage(), identity);
|
||||||
|
|
||||||
|
|
|
@ -112,6 +112,7 @@ public:
|
||||||
void setResource(GeometryResource::Pointer resource);
|
void setResource(GeometryResource::Pointer resource);
|
||||||
|
|
||||||
QUrl getURL() const { return (bool)_resource ? _resource->getURL() : QUrl(); }
|
QUrl getURL() const { return (bool)_resource ? _resource->getURL() : QUrl(); }
|
||||||
|
int getResourceDownloadAttempts() { return _resource ? _resource->getDownloadAttempts() : 0; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void startWatching();
|
void startWatching();
|
||||||
|
|
|
@ -75,10 +75,19 @@ void HTTPResourceRequest::onRequestFinished() {
|
||||||
|
|
||||||
switch(_reply->error()) {
|
switch(_reply->error()) {
|
||||||
case QNetworkReply::NoError:
|
case QNetworkReply::NoError:
|
||||||
_data = _reply->readAll();
|
{
|
||||||
_loadedFromCache = _reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool();
|
// For debugging, have a random chance of treating this like a failure
|
||||||
_result = Success;
|
bool randFailure = false; // _url.toString().contains(".fst") ? (rand() % 100) > 10 : false;
|
||||||
break;
|
|
||||||
|
if (!randFailure) {
|
||||||
|
_data = _reply->readAll();
|
||||||
|
_loadedFromCache = _reply->attribute(QNetworkRequest::SourceIsFromCacheAttribute).toBool();
|
||||||
|
_result = Success;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// else fall through to timeout
|
||||||
|
qDebug() << "**** Randomly pretending to timeout instead of successfully download HTTP resource:" << _url << " ******************************";
|
||||||
|
}
|
||||||
|
|
||||||
case QNetworkReply::TimeoutError:
|
case QNetworkReply::TimeoutError:
|
||||||
_result = Timeout;
|
_result = Timeout;
|
||||||
|
|
|
@ -27,7 +27,8 @@ ReceivedMessage::ReceivedMessage(const NLPacketList& packetList)
|
||||||
_packetType(packetList.getType()),
|
_packetType(packetList.getType()),
|
||||||
_packetVersion(packetList.getVersion()),
|
_packetVersion(packetList.getVersion()),
|
||||||
_senderSockAddr(packetList.getSenderSockAddr()),
|
_senderSockAddr(packetList.getSenderSockAddr()),
|
||||||
_isComplete(true)
|
_isComplete(true),
|
||||||
|
_messageNumber(packetList.getMessageNumber())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +40,8 @@ ReceivedMessage::ReceivedMessage(NLPacket& packet)
|
||||||
_packetType(packet.getType()),
|
_packetType(packet.getType()),
|
||||||
_packetVersion(packet.getVersion()),
|
_packetVersion(packet.getVersion()),
|
||||||
_senderSockAddr(packet.getSenderSockAddr()),
|
_senderSockAddr(packet.getSenderSockAddr()),
|
||||||
_isComplete(packet.getPacketPosition() == NLPacket::ONLY)
|
_isComplete(packet.getPacketPosition() == NLPacket::ONLY),
|
||||||
|
_messageNumber(packet.getMessageNumber())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,8 @@ public:
|
||||||
|
|
||||||
qint64 getBytesLeftToRead() const { return _data.size() - _position; }
|
qint64 getBytesLeftToRead() const { return _data.size() - _position; }
|
||||||
|
|
||||||
|
qint64 getMessageNumber() const { return _messageNumber; }
|
||||||
|
|
||||||
void seek(qint64 position) { _position = position; }
|
void seek(qint64 position) { _position = position; }
|
||||||
|
|
||||||
qint64 peek(char* data, qint64 size);
|
qint64 peek(char* data, qint64 size);
|
||||||
|
@ -98,6 +100,9 @@ private:
|
||||||
|
|
||||||
std::atomic<bool> _isComplete { true };
|
std::atomic<bool> _isComplete { true };
|
||||||
std::atomic<bool> _failed { false };
|
std::atomic<bool> _failed { false };
|
||||||
|
|
||||||
|
udt::Packet::MessageNumber _messageNumber { 0 };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(ReceivedMessage*)
|
Q_DECLARE_METATYPE(ReceivedMessage*)
|
||||||
|
|
|
@ -724,10 +724,11 @@ void Resource::handleReplyFinished() {
|
||||||
} else {
|
} else {
|
||||||
switch (result) {
|
switch (result) {
|
||||||
case ResourceRequest::Result::Timeout: {
|
case ResourceRequest::Result::Timeout: {
|
||||||
qCDebug(networking) << "Timed out loading" << _url << "received" << _bytesReceived << "total" << _bytesTotal;
|
qCDebug(networking) << "Timed out loading" << _url << "received" << _bytesReceived << "total" << _bytesTotal << "attempt:" << _attempts << "of" << MAX_ATTEMPTS;
|
||||||
// Fall through to other cases
|
// Fall through to other cases
|
||||||
}
|
}
|
||||||
case ResourceRequest::Result::ServerUnavailable: {
|
case ResourceRequest::Result::ServerUnavailable: {
|
||||||
|
qCDebug(networking) << "Server Unavailable loading" << _url << "attempt:" << _attempts << "of" << MAX_ATTEMPTS;
|
||||||
// retry with increasing delays
|
// retry with increasing delays
|
||||||
const int BASE_DELAY_MS = 1000;
|
const int BASE_DELAY_MS = 1000;
|
||||||
if (_attempts++ < MAX_ATTEMPTS) {
|
if (_attempts++ < MAX_ATTEMPTS) {
|
||||||
|
@ -742,7 +743,7 @@ void Resource::handleReplyFinished() {
|
||||||
// fall through to final failure
|
// fall through to final failure
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
qCDebug(networking) << "Error loading " << _url;
|
qCDebug(networking) << "Error loading " << _url << "attempt:" << _attempts << "of" << MAX_ATTEMPTS;
|
||||||
auto error = (result == ResourceRequest::Timeout) ? QNetworkReply::TimeoutError
|
auto error = (result == ResourceRequest::Timeout) ? QNetworkReply::TimeoutError
|
||||||
: QNetworkReply::UnknownNetworkError;
|
: QNetworkReply::UnknownNetworkError;
|
||||||
emit failed(error);
|
emit failed(error);
|
||||||
|
|
|
@ -395,6 +395,9 @@ public:
|
||||||
|
|
||||||
const QUrl& getURL() const { return _url; }
|
const QUrl& getURL() const { return _url; }
|
||||||
|
|
||||||
|
int getDownloadAttempts() { return _attempts; }
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/// Fired when the resource begins downloading.
|
/// Fired when the resource begins downloading.
|
||||||
void loading();
|
void loading();
|
||||||
|
|
|
@ -43,6 +43,8 @@ public:
|
||||||
size_t getDataSize() const;
|
size_t getDataSize() const;
|
||||||
size_t getMessageSize() const;
|
size_t getMessageSize() const;
|
||||||
QByteArray getMessage() const;
|
QByteArray getMessage() const;
|
||||||
|
udt::Packet::MessageNumber getMessageNumber() const { return _messageNumber; }
|
||||||
|
|
||||||
|
|
||||||
QByteArray getExtendedHeader() const { return _extendedHeader; }
|
QByteArray getExtendedHeader() const { return _extendedHeader; }
|
||||||
|
|
||||||
|
|
|
@ -252,6 +252,7 @@ public:
|
||||||
|
|
||||||
void renderDebugMeshBoxes(gpu::Batch& batch);
|
void renderDebugMeshBoxes(gpu::Batch& batch);
|
||||||
|
|
||||||
|
int getResourceDownloadAttempts() { return _renderWatcher.getResourceDownloadAttempts(); }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void loadURLFinished(bool success);
|
void loadURLFinished(bool success);
|
||||||
|
|
Loading…
Reference in a new issue