mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
grab URL for script from payload if it exists
This commit is contained in:
parent
142932bed0
commit
a137dd0362
1 changed files with 11 additions and 6 deletions
|
@ -148,14 +148,19 @@ void Agent::run() {
|
|||
<< NodeType::ParticleServer);
|
||||
|
||||
// figure out the URL for the script for this agent assignment
|
||||
QString scriptURLString("http://%1:8080/assignment/%2");
|
||||
scriptURLString = scriptURLString.arg(NodeList::getInstance()->getDomainHandler().getIP().toString(),
|
||||
uuidStringWithoutCurlyBraces(_uuid));
|
||||
|
||||
QUrl scriptURL;
|
||||
if (_payload.isEmpty()) {
|
||||
scriptURL = QUrl(QString("http://%1:8080/assignment/%2")
|
||||
.arg(NodeList::getInstance()->getDomainHandler().getIP().toString(),
|
||||
uuidStringWithoutCurlyBraces(_uuid)));
|
||||
} else {
|
||||
scriptURL = QUrl(_payload);
|
||||
}
|
||||
|
||||
QNetworkAccessManager *networkManager = new QNetworkAccessManager(this);
|
||||
QNetworkReply *reply = networkManager->get(QNetworkRequest(QUrl(scriptURLString)));
|
||||
QNetworkReply *reply = networkManager->get(QNetworkRequest(scriptURL));
|
||||
|
||||
qDebug() << "Downloading script at" << scriptURLString;
|
||||
qDebug() << "Downloading script at" << scriptURL.toString();
|
||||
|
||||
QEventLoop loop;
|
||||
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
|
|
Loading…
Reference in a new issue