mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:24:47 +02:00
temporary removal of QtScript dependency for build on ec2 box
This commit is contained in:
parent
2846d170f7
commit
f29f8701a1
3 changed files with 0 additions and 124 deletions
|
@ -8,13 +8,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cm
|
||||||
|
|
||||||
set(TARGET_NAME avatars)
|
set(TARGET_NAME avatars)
|
||||||
|
|
||||||
find_package(Qt5Script REQUIRED)
|
|
||||||
|
|
||||||
include(${MACRO_DIR}/SetupHifiLibrary.cmake)
|
include(${MACRO_DIR}/SetupHifiLibrary.cmake)
|
||||||
setup_hifi_library(${TARGET_NAME})
|
setup_hifi_library(${TARGET_NAME})
|
||||||
|
|
||||||
qt5_use_modules(${TARGET_NAME} Script)
|
|
||||||
|
|
||||||
include(${MACRO_DIR}/IncludeGLM.cmake)
|
include(${MACRO_DIR}/IncludeGLM.cmake)
|
||||||
include_glm(${TARGET_NAME} ${ROOT_DIR})
|
include_glm(${TARGET_NAME} ${ROOT_DIR})
|
||||||
|
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
//
|
|
||||||
// Agent.cpp
|
|
||||||
// hifi
|
|
||||||
//
|
|
||||||
// Created by Stephen Birarda on 7/1/13.
|
|
||||||
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <QtScript/QScriptEngine>
|
|
||||||
#include <QtNetwork/QtNetwork>
|
|
||||||
|
|
||||||
#include <NodeList.h>
|
|
||||||
|
|
||||||
#include "AvatarData.h"
|
|
||||||
|
|
||||||
#include "Agent.h"
|
|
||||||
|
|
||||||
Agent::Agent() :
|
|
||||||
_shouldStop(false)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Agent::run(QUrl scriptURL) {
|
|
||||||
NodeList::getInstance()->setOwnerType(NODE_TYPE_AGENT);
|
|
||||||
NodeList::getInstance()->setNodeTypesOfInterest(&NODE_TYPE_AVATAR_MIXER, 1);
|
|
||||||
|
|
||||||
QNetworkAccessManager* manager = new QNetworkAccessManager();
|
|
||||||
|
|
||||||
qDebug() << "Attemping download of " << scriptURL;
|
|
||||||
|
|
||||||
QNetworkReply* reply = manager->get(QNetworkRequest(scriptURL));
|
|
||||||
|
|
||||||
QEventLoop loop;
|
|
||||||
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
|
||||||
loop.exec();
|
|
||||||
|
|
||||||
QString scriptString = QString(reply->readAll());
|
|
||||||
|
|
||||||
QScriptEngine engine;
|
|
||||||
|
|
||||||
AvatarData *testAvatarData = new AvatarData;
|
|
||||||
|
|
||||||
QScriptValue avatarDataValue = engine.newQObject(testAvatarData);
|
|
||||||
engine.globalObject().setProperty("Avatar", avatarDataValue);
|
|
||||||
|
|
||||||
QScriptValue agentValue = engine.newQObject(this);
|
|
||||||
engine.globalObject().setProperty("Agent", agentValue);
|
|
||||||
|
|
||||||
qDebug() << "Downloaded script:" << scriptString;
|
|
||||||
|
|
||||||
qDebug() << "Evaluated script:" << engine.evaluate(scriptString).toString();
|
|
||||||
|
|
||||||
timeval thisSend;
|
|
||||||
timeval lastDomainServerCheckIn = {};
|
|
||||||
int numMicrosecondsSleep = 0;
|
|
||||||
|
|
||||||
const float DATA_SEND_INTERVAL_USECS = (1 / 60.0f) * 1000 * 1000;
|
|
||||||
|
|
||||||
sockaddr_in senderAddress;
|
|
||||||
unsigned char receivedData[MAX_PACKET_SIZE];
|
|
||||||
ssize_t receivedBytes;
|
|
||||||
|
|
||||||
while (!_shouldStop) {
|
|
||||||
// update the thisSend timeval to the current time
|
|
||||||
gettimeofday(&thisSend, NULL);
|
|
||||||
|
|
||||||
// send a check in packet to the domain server if DOMAIN_SERVER_CHECK_IN_USECS has elapsed
|
|
||||||
if (usecTimestampNow() - usecTimestamp(&lastDomainServerCheckIn) >= DOMAIN_SERVER_CHECK_IN_USECS) {
|
|
||||||
gettimeofday(&lastDomainServerCheckIn, NULL);
|
|
||||||
NodeList::getInstance()->sendDomainServerCheckIn();
|
|
||||||
}
|
|
||||||
|
|
||||||
emit preSendCallback();
|
|
||||||
|
|
||||||
testAvatarData->sendData();
|
|
||||||
|
|
||||||
if (NodeList::getInstance()->getNodeSocket()->receive((sockaddr*) &senderAddress, receivedData, &receivedBytes)) {
|
|
||||||
NodeList::getInstance()->processNodeData((sockaddr*) &senderAddress, receivedData, receivedBytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
// sleep for the correct amount of time to have data send be consistently timed
|
|
||||||
if ((numMicrosecondsSleep = DATA_SEND_INTERVAL_USECS - (usecTimestampNow() - usecTimestamp(&thisSend))) > 0) {
|
|
||||||
usleep(numMicrosecondsSleep);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
//
|
|
||||||
// Agent.h
|
|
||||||
// hifi
|
|
||||||
//
|
|
||||||
// Created by Stephen Birarda on 7/1/13.
|
|
||||||
// Copyright (c) 2013 HighFidelity, Inc. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
#ifndef __hifi__Agent__
|
|
||||||
#define __hifi__Agent__
|
|
||||||
|
|
||||||
#include <glm/glm.hpp>
|
|
||||||
#include <glm/gtc/quaternion.hpp>
|
|
||||||
|
|
||||||
#include "SharedUtil.h"
|
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
|
||||||
#include <QtCore/QUrl>
|
|
||||||
|
|
||||||
class Agent : public QObject {
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
Agent();
|
|
||||||
|
|
||||||
bool volatile _shouldStop;
|
|
||||||
|
|
||||||
void run(QUrl scriptUrl);
|
|
||||||
signals:
|
|
||||||
void preSendCallback();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* defined(__hifi__Operative__) */
|
|
Loading…
Reference in a new issue