mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 02:03:11 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi
This commit is contained in:
commit
ea4524bcf0
4 changed files with 6 additions and 21 deletions
|
@ -63,7 +63,7 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QString& p
|
||||||
|
|
||||||
QFile localFile(filePath);
|
QFile localFile(filePath);
|
||||||
localFile.open(QIODevice::ReadOnly);
|
localFile.open(QIODevice::ReadOnly);
|
||||||
QString localFileString(localFile.readAll());
|
QByteArray localFileData = localFile.readAll();
|
||||||
|
|
||||||
QFileInfo localFileInfo(filePath);
|
QFileInfo localFileInfo(filePath);
|
||||||
|
|
||||||
|
@ -77,6 +77,7 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QString& p
|
||||||
|
|
||||||
int matchPosition = 0;
|
int matchPosition = 0;
|
||||||
|
|
||||||
|
QString localFileString(localFileData);
|
||||||
|
|
||||||
while ((matchPosition = includeRegExp.indexIn(localFileString, matchPosition)) != -1) {
|
while ((matchPosition = includeRegExp.indexIn(localFileString, matchPosition)) != -1) {
|
||||||
// check if this is a file or vitual include
|
// check if this is a file or vitual include
|
||||||
|
@ -105,9 +106,11 @@ bool HTTPManager::handleHTTPRequest(HTTPConnection* connection, const QString& p
|
||||||
// push the match position forward so we can check the next match
|
// push the match position forward so we can check the next match
|
||||||
matchPosition += includeRegExp.matchedLength();
|
matchPosition += includeRegExp.matchedLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
localFileData = localFileString.toLocal8Bit();
|
||||||
}
|
}
|
||||||
|
|
||||||
connection->respond(HTTPConnection::StatusCode200, localFileString.toLocal8Bit(),
|
connection->respond(HTTPConnection::StatusCode200, localFileData,
|
||||||
qPrintable(mimeDatabase.mimeTypeForFile(filePath).name()));
|
qPrintable(mimeDatabase.mimeTypeForFile(filePath).name()));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ bool JurisdictionSender::process() {
|
||||||
_nodesRequestingJurisdictions.pop();
|
_nodesRequestingJurisdictions.pop();
|
||||||
SharedNodePointer node = NodeList::getInstance()->nodeWithUUID(nodeUUID);
|
SharedNodePointer node = NodeList::getInstance()->nodeWithUUID(nodeUUID);
|
||||||
|
|
||||||
if (node->getActiveSocket() != NULL) {
|
if (node && node->getActiveSocket() != NULL) {
|
||||||
const HifiSockAddr* nodeAddress = node->getActiveSocket();
|
const HifiSockAddr* nodeAddress = node->getActiveSocket();
|
||||||
_packetSender.queuePacketForSending(*nodeAddress, QByteArray(reinterpret_cast<char *>(bufferOut), sizeOut));
|
_packetSender.queuePacketForSending(*nodeAddress, QByteArray(reinterpret_cast<char *>(bufferOut), sizeOut));
|
||||||
nodeCount++;
|
nodeCount++;
|
||||||
|
|
|
@ -24,7 +24,6 @@ static const float fingerVectorRadix = 4; // bits of precision when converting f
|
||||||
|
|
||||||
OctreeQuery::OctreeQuery() :
|
OctreeQuery::OctreeQuery() :
|
||||||
NodeData(),
|
NodeData(),
|
||||||
_uuid(),
|
|
||||||
_cameraPosition(0,0,0),
|
_cameraPosition(0,0,0),
|
||||||
_cameraOrientation(),
|
_cameraOrientation(),
|
||||||
_cameraFov(0.0f),
|
_cameraFov(0.0f),
|
||||||
|
@ -53,11 +52,6 @@ int OctreeQuery::getBroadcastData(unsigned char* destinationBuffer) {
|
||||||
// that can pack any type given the number of bytes
|
// that can pack any type given the number of bytes
|
||||||
// and return the number of bytes to push the pointer
|
// and return the number of bytes to push the pointer
|
||||||
|
|
||||||
// UUID
|
|
||||||
QByteArray uuidByteArray = _uuid.toRfc4122();
|
|
||||||
memcpy(destinationBuffer, uuidByteArray.constData(), uuidByteArray.size());
|
|
||||||
destinationBuffer += uuidByteArray.size();
|
|
||||||
|
|
||||||
// camera details
|
// camera details
|
||||||
memcpy(destinationBuffer, &_cameraPosition, sizeof(_cameraPosition));
|
memcpy(destinationBuffer, &_cameraPosition, sizeof(_cameraPosition));
|
||||||
destinationBuffer += sizeof(_cameraPosition);
|
destinationBuffer += sizeof(_cameraPosition);
|
||||||
|
@ -103,13 +97,6 @@ int OctreeQuery::parseData(const QByteArray& packet) {
|
||||||
const unsigned char* startPosition = reinterpret_cast<const unsigned char*>(packet.data());
|
const unsigned char* startPosition = reinterpret_cast<const unsigned char*>(packet.data());
|
||||||
const unsigned char* sourceBuffer = startPosition + numBytesPacketHeader;
|
const unsigned char* sourceBuffer = startPosition + numBytesPacketHeader;
|
||||||
|
|
||||||
// push past the node session UUID
|
|
||||||
sourceBuffer += NUM_BYTES_RFC4122_UUID;
|
|
||||||
|
|
||||||
// user UUID
|
|
||||||
_uuid = QUuid::fromRfc4122(QByteArray((char*) sourceBuffer, NUM_BYTES_RFC4122_UUID));
|
|
||||||
sourceBuffer += NUM_BYTES_RFC4122_UUID;
|
|
||||||
|
|
||||||
// camera details
|
// camera details
|
||||||
memcpy(&_cameraPosition, sourceBuffer, sizeof(_cameraPosition));
|
memcpy(&_cameraPosition, sourceBuffer, sizeof(_cameraPosition));
|
||||||
sourceBuffer += sizeof(_cameraPosition);
|
sourceBuffer += sizeof(_cameraPosition);
|
||||||
|
|
|
@ -57,9 +57,6 @@ public:
|
||||||
int getBroadcastData(unsigned char* destinationBuffer);
|
int getBroadcastData(unsigned char* destinationBuffer);
|
||||||
int parseData(const QByteArray& packet);
|
int parseData(const QByteArray& packet);
|
||||||
|
|
||||||
QUuid& getUUID() { return _uuid; }
|
|
||||||
void setUUID(const QUuid& uuid) { _uuid = uuid; }
|
|
||||||
|
|
||||||
// getters for camera details
|
// getters for camera details
|
||||||
const glm::vec3& getCameraPosition() const { return _cameraPosition; }
|
const glm::vec3& getCameraPosition() const { return _cameraPosition; }
|
||||||
const glm::quat& getCameraOrientation() const { return _cameraOrientation; }
|
const glm::quat& getCameraOrientation() const { return _cameraOrientation; }
|
||||||
|
@ -101,8 +98,6 @@ public slots:
|
||||||
void setBoundaryLevelAdjust(int boundaryLevelAdjust) { _boundaryLevelAdjust = boundaryLevelAdjust; }
|
void setBoundaryLevelAdjust(int boundaryLevelAdjust) { _boundaryLevelAdjust = boundaryLevelAdjust; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QUuid _uuid;
|
|
||||||
|
|
||||||
// camera details for the avatar
|
// camera details for the avatar
|
||||||
glm::vec3 _cameraPosition;
|
glm::vec3 _cameraPosition;
|
||||||
glm::quat _cameraOrientation;
|
glm::quat _cameraOrientation;
|
||||||
|
|
Loading…
Reference in a new issue