mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
hook to request user's location from data-server
This commit is contained in:
parent
625299e6e6
commit
52a21d4dfd
4 changed files with 13 additions and 3 deletions
|
@ -1049,8 +1049,14 @@ void Menu::goTo() {
|
||||||
|
|
||||||
// go to coordinate destination or to Username
|
// go to coordinate destination or to Username
|
||||||
if (!goToDestination(destination)) {
|
if (!goToDestination(destination)) {
|
||||||
// there's a username entered by the user, make a request to the data-server
|
JSONCallbackParameters callbackParams;
|
||||||
|
callbackParams.jsonCallbackReceiver = Application::getInstance()->getAvatar();
|
||||||
|
callbackParams.jsonCallbackMethod = "goToLocationFromResponse";
|
||||||
|
|
||||||
|
// there's a username entered by the user, make a request to the data-server for the associated location
|
||||||
|
AccountManager::getInstance().authenticatedRequest("/api/v1/users/" + gotoDialog.textValue() + "/location",
|
||||||
|
QNetworkAccessManager::GetOperation,
|
||||||
|
callbackParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1200,3 +1200,6 @@ void MyAvatar::updateLocationInDataServer() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyAvatar::goToLocationFromResponse(const QJsonObject& jsonObject) {
|
||||||
|
qDebug() << jsonObject;
|
||||||
|
}
|
||||||
|
|
|
@ -90,6 +90,7 @@ public slots:
|
||||||
void resetSize();
|
void resetSize();
|
||||||
|
|
||||||
void updateLocationInDataServer();
|
void updateLocationInDataServer();
|
||||||
|
void goToLocationFromResponse(const QJsonObject& jsonObject);
|
||||||
|
|
||||||
// Set/Get update the thrust that will move the avatar around
|
// Set/Get update the thrust that will move the avatar around
|
||||||
void addThrust(glm::vec3 newThrust) { _thrust += newThrust; };
|
void addThrust(glm::vec3 newThrust) { _thrust += newThrust; };
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
static AccountManager& getInstance();
|
static AccountManager& getInstance();
|
||||||
|
|
||||||
void authenticatedRequest(const QString& path,
|
void authenticatedRequest(const QString& path,
|
||||||
QNetworkAccessManager::Operation operation,
|
QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
|
||||||
const JSONCallbackParameters& callbackParams = JSONCallbackParameters(),
|
const JSONCallbackParameters& callbackParams = JSONCallbackParameters(),
|
||||||
const QByteArray& dataByteArray = QByteArray());
|
const QByteArray& dataByteArray = QByteArray());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue