resolve conflicts on merge with origin/protocol

This commit is contained in:
Stephen Birarda 2015-08-27 14:47:35 -07:00
commit eae90cbe8a
25 changed files with 51 additions and 30 deletions

View file

@ -1,5 +1,6 @@
// //
// AssetServer.cpp // AssetServer.cpp
// assignment-client/src/assets
// //
// Created by Ryan Huffman on 2015/07/21 // Created by Ryan Huffman on 2015/07/21
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// AssetServer.h // AssetServer.h
// assignment-client/src/assets
// //
// Created by Ryan Huffman on 2015/07/21 // Created by Ryan Huffman on 2015/07/21
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// SendAssetTask.cpp // SendAssetTask.cpp
// assignment-client/src/assets
// //
// Created by Ryan Huffman on 2015/08/26 // Created by Ryan Huffman on 2015/08/26
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// SendAssetTask.h // SendAssetTask.h
// assignment-client/src/assets
// //
// Created by Ryan Huffman on 2015/08/26 // Created by Ryan Huffman on 2015/08/26
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// AssetClient.cpp // AssetClient.cpp
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/21 // Created by Ryan Huffman on 2015/07/21
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// AssetClient.h // AssetClient.h
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/21 // Created by Ryan Huffman on 2015/07/21
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// AssetRequest.cpp // AssetRequest.cpp
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/24 // Created by Ryan Huffman on 2015/07/24
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// AssetRequest.h // AssetRequest.h
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/24 // Created by Ryan Huffman on 2015/07/24
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// AssetResourceRequest.cpp // AssetResourceRequest.cpp
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// AssetResourceRequest.h // AssetResourceRequest.h
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// AssetUtils.h // AssetUtils.h
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/30 // Created by Ryan Huffman on 2015/07/30
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// FileResourceRequest.cpp // FileResourceRequest.cpp
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// FileResourceRequest.h // FileResourceRequest.h
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// HTTPResourceRequest.cpp // HTTPResourceRequest.cpp
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// HTTPResourceRequest.h // HTTPResourceRequest.h
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -154,14 +154,18 @@ void ResourceCache::clearUnusedResource() {
void ResourceCache::attemptRequest(Resource* resource) { void ResourceCache::attemptRequest(Resource* resource) {
auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>(); auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>();
// if (_requestLimit <= 0) { if (_requestLimit <= 0) {
// qDebug() << "REQUEST LIMIT REACHED (" << _requestLimit << "), queueing: " << resource->getURL(); qDebug() << "REQUEST LIMIT REACHED (" << _requestLimit << "), queueing: " << resource->getURL();
// // wait until a slot becomes available // wait until a slot becomes available
// sharedItems->_pendingRequests.append(resource); sharedItems->_pendingRequests.append(resource);
// return; return;
// } }
qDebug() << "-- Decreasing limit for : " << resource->getURL(); qDebug() << "-- Decreasing limit for : " << resource->getURL();
_requestLimit--;
// Disable request limiting for ATP
if (resource->getURL() != URL_SCHEME_ATP) {
_requestLimit--;
}
sharedItems->_loadingRequests.append(resource); sharedItems->_loadingRequests.append(resource);
resource->makeRequest(); resource->makeRequest();
} }
@ -171,7 +175,9 @@ void ResourceCache::requestCompleted(Resource* resource) {
auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>(); auto sharedItems = DependencyManager::get<ResourceCacheSharedItems>();
sharedItems->_loadingRequests.removeOne(resource); sharedItems->_loadingRequests.removeOne(resource);
qDebug() << "++ Increasing limit after finished: " << resource->getURL(); qDebug() << "++ Increasing limit after finished: " << resource->getURL();
_requestLimit++; if (resource->getURL() != URL_SCHEME_ATP) {
_requestLimit++;
}
// look for the highest priority pending request // look for the highest priority pending request
int highestIndex = -1; int highestIndex = -1;
@ -206,7 +212,7 @@ Resource::Resource(const QUrl& url, bool delayLoad) :
// start loading immediately unless instructed otherwise // start loading immediately unless instructed otherwise
if (!(_startedLoading || delayLoad)) { if (!(_startedLoading || delayLoad)) {
QTimer::singleShot(1, this, &Resource::attemptRequest); QTimer::singleShot(0, this, &Resource::ensureLoading);
} }
} }
@ -333,8 +339,6 @@ void Resource::reinsert() {
void Resource::makeRequest() { void Resource::makeRequest() {
Q_ASSERT(!_request); Q_ASSERT(!_request);
static const int REPLY_TIMEOUT_MS = 5000;
_request = ResourceManager::createResourceRequest(this, _activeUrl); _request = ResourceManager::createResourceRequest(this, _activeUrl);
if (!_request) { if (!_request) {
@ -360,13 +364,12 @@ void Resource::handleDownloadProgress(uint64_t bytesReceived, uint64_t bytesTota
} }
void Resource::handleReplyFinished() { void Resource::handleReplyFinished() {
QString u = _url.path();
Q_ASSERT(_request); Q_ASSERT(_request);
auto result = _request->getResult(); auto result = _request->getResult();
if (result == ResourceRequest::SUCCESS) { if (result == ResourceRequest::SUCCESS) {
_data = _request->getData(); _data = _request->getData();
qDebug() << "Reqeust finsihed for " << _url << ", " << _activeUrl; qDebug() << "Request finished for " << _url << ", " << _activeUrl;
_request->disconnect(this); _request->disconnect(this);
_request->deleteLater(); _request->deleteLater();
@ -383,8 +386,7 @@ void Resource::handleReplyFinished() {
_request = nullptr; _request = nullptr;
if (result == ResourceRequest::Result::TIMEOUT) { if (result == ResourceRequest::Result::TIMEOUT) {
qDebug() << "Timed out loading" << _url << qDebug() << "Timed out loading" << _url << "received" << _bytesReceived << "total" << _bytesTotal;
"received" << _bytesReceived << "total" << _bytesTotal;
} else { } else {
qDebug() << "Error loading " << _url; qDebug() << "Error loading " << _url;
} }
@ -408,7 +410,8 @@ void Resource::handleReplyFinished() {
break; break;
} }
emit failed(QNetworkReply::UnknownNetworkError); auto error = result == ResourceRequest::TIMEOUT ? QNetworkReply::TimeoutError : QNetworkReply::UnknownNetworkError;
emit failed(error);
if (!retry) { if (!retry) {
ResourceCache::requestCompleted(this); ResourceCache::requestCompleted(this);

View file

@ -1,5 +1,6 @@
// //
// ResourceManager.cpp // ResourceManager.cpp
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.
@ -16,12 +17,6 @@
#include <SharedUtil.h> #include <SharedUtil.h>
const QString URL_SCHEME_FILE = "file";
const QString URL_SCHEME_HTTP = "http";
const QString URL_SCHEME_HTTPS = "https";
const QString URL_SCHEME_FTP = "ftp";
const QString URL_SCHEME_ATP = "atp";
ResourceRequest* ResourceManager::createResourceRequest(QObject* parent, const QUrl& url) { ResourceRequest* ResourceManager::createResourceRequest(QObject* parent, const QUrl& url) {
auto scheme = url.scheme(); auto scheme = url.scheme();
if (scheme == URL_SCHEME_FILE) { if (scheme == URL_SCHEME_FILE) {

View file

@ -1,5 +1,6 @@
// //
// ResourceManager.h // ResourceManager.h
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.
@ -15,6 +16,12 @@
#include "ResourceRequest.h" #include "ResourceRequest.h"
const QString URL_SCHEME_FILE = "file";
const QString URL_SCHEME_HTTP = "http";
const QString URL_SCHEME_HTTPS = "https";
const QString URL_SCHEME_FTP = "ftp";
const QString URL_SCHEME_ATP = "atp";
class ResourceManager { class ResourceManager {
public: public:
static ResourceRequest* createResourceRequest(QObject* parent, const QUrl& url); static ResourceRequest* createResourceRequest(QObject* parent, const QUrl& url);

View file

@ -1,5 +1,6 @@
// //
// ResourceRequest.cpp // ResourceRequest.cpp
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -1,5 +1,6 @@
// //
// ResourceRequest.h // ResourceRequest.h
// libraries/networking/src
// //
// Created by Ryan Huffman on 2015/07/23 // Created by Ryan Huffman on 2015/07/23
// Copyright 2015 High Fidelity, Inc. // Copyright 2015 High Fidelity, Inc.

View file

@ -625,8 +625,12 @@ void Connection::processNAK(std::unique_ptr<ControlPacket> controlPacket) {
} }
void Connection::processHandshake(std::unique_ptr<ControlPacket> controlPacket) { void Connection::processHandshake(std::unique_ptr<ControlPacket> controlPacket) {
// server sent us a handshake - we need to assume this means state should be reset
resetReceiveState(); if (!_hasReceivedHandshake || _hasReceivedFirstPacket) {
// server sent us a handshake - we need to assume this means state should be reset
// as long as we haven't received a handshake yet or we have and we've received some data
resetReceiveState();
}
// immediately respond with a handshake ACK // immediately respond with a handshake ACK
static auto handshakeACK = ControlPacket::create(ControlPacket::HandshakeACK, 0); static auto handshakeACK = ControlPacket::create(ControlPacket::HandshakeACK, 0);

View file

@ -143,7 +143,7 @@ qint64 PacketList::writeData(const char* data, qint64 maxSize) {
// this is an unsupported case - the segment is bigger than the size of an individual packet // this is an unsupported case - the segment is bigger than the size of an individual packet
// but the PacketList is not going to be sent ordered // but the PacketList is not going to be sent ordered
qDebug() << "Error in PacketList::writeData - attempted to write a segment to an unordered packet that is" qDebug() << "Error in PacketList::writeData - attempted to write a segment to an unordered packet that is"
<< "larger than the payload size."; << "larger than the payload size.";
Q_ASSERT(false); Q_ASSERT(false);
} }

View file

@ -1354,9 +1354,7 @@ void Model::inverseKinematics(int endIndex, glm::vec3 targetPosition, const glm:
} }
bool Model::restoreJointPosition(int jointIndex, float fraction, float priority) { bool Model::restoreJointPosition(int jointIndex, float fraction, float priority) {
QString url = _url.path();
const FBXGeometry& geometry = _geometry->getFBXGeometry(); const FBXGeometry& geometry = _geometry->getFBXGeometry();
return true;
const QVector<int>& freeLineage = geometry.joints.at(jointIndex).freeLineage; const QVector<int>& freeLineage = geometry.joints.at(jointIndex).freeLineage;
return _rig->restoreJointPosition(jointIndex, fraction, priority, freeLineage); return _rig->restoreJointPosition(jointIndex, fraction, priority, freeLineage);
} }

View file

@ -294,7 +294,6 @@ public:
void ImageReader::run() { void ImageReader::run() {
QSharedPointer<Resource> texture = _texture.toStrongRef(); QSharedPointer<Resource> texture = _texture.toStrongRef();
if (texture.isNull()) { if (texture.isNull()) {
qDebug() << "TEXTURE IS NULL";
return; return;
} }

View file

@ -27,8 +27,6 @@ ScriptCache::ScriptCache(QObject* parent) {
} }
QString ScriptCache::getScript(const QUrl& url, ScriptUser* scriptUser, bool& isPending, bool reload) { QString ScriptCache::getScript(const QUrl& url, ScriptUser* scriptUser, bool& isPending, bool reload) {
//assert(!_scriptCache.contains(url) || !reload);
QString scriptContents; QString scriptContents;
if (_scriptCache.contains(url) && !reload) { if (_scriptCache.contains(url) && !reload) {
qCDebug(scriptengine) << "Found script in cache:" << url.toString(); qCDebug(scriptengine) << "Found script in cache:" << url.toString();