mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 10:17:40 +02:00
handle storage of user location in new format
This commit is contained in:
parent
16261a5fc1
commit
92b8cd2d1e
2 changed files with 15 additions and 5 deletions
|
@ -3124,23 +3124,32 @@ void Application::updateWindowTitle(){
|
||||||
void Application::updateLocationInServer() {
|
void Application::updateLocationInServer() {
|
||||||
|
|
||||||
AccountManager& accountManager = AccountManager::getInstance();
|
AccountManager& accountManager = AccountManager::getInstance();
|
||||||
|
AddressManager::SharedPointer addressManager = DependencyManager::get<AddressManager>();
|
||||||
DomainHandler& domainHandler = NodeList::getInstance()->getDomainHandler();
|
DomainHandler& domainHandler = NodeList::getInstance()->getDomainHandler();
|
||||||
|
|
||||||
if (accountManager.isLoggedIn() && domainHandler.isConnected() && !domainHandler.getUUID().isNull()) {
|
if (accountManager.isLoggedIn() && domainHandler.isConnected()
|
||||||
|
&& (!addressManager->getRootPlaceID().isNull() || !domainHandler.getUUID().isNull())) {
|
||||||
|
|
||||||
// construct a QJsonObject given the user's current address information
|
// construct a QJsonObject given the user's current address information
|
||||||
QJsonObject rootObject;
|
QJsonObject rootObject;
|
||||||
|
|
||||||
QJsonObject locationObject;
|
QJsonObject locationObject;
|
||||||
|
|
||||||
QString pathString = DependencyManager::get<AddressManager>()->currentPath();
|
QString pathString = addressManager->currentPath();
|
||||||
|
|
||||||
const QString LOCATION_KEY_IN_ROOT = "location";
|
const QString LOCATION_KEY_IN_ROOT = "location";
|
||||||
const QString PATH_KEY_IN_LOCATION = "path";
|
|
||||||
const QString DOMAIN_ID_KEY_IN_LOCATION = "domain_id";
|
|
||||||
|
|
||||||
|
const QString PATH_KEY_IN_LOCATION = "path";
|
||||||
locationObject.insert(PATH_KEY_IN_LOCATION, pathString);
|
locationObject.insert(PATH_KEY_IN_LOCATION, pathString);
|
||||||
locationObject.insert(DOMAIN_ID_KEY_IN_LOCATION, domainHandler.getUUID().toString());
|
|
||||||
|
if (!addressManager->getRootPlaceID().isNull()) {
|
||||||
|
const QString PLACE_ID_KEY_IN_LOCATION = "place_id";
|
||||||
|
locationObject.insert(PLACE_ID_KEY_IN_LOCATION, addressManager->getRootPlaceID().toString());
|
||||||
|
|
||||||
|
} else {
|
||||||
|
const QString DOMAIN_ID_KEY_IN_LOCATION = "domain_id";
|
||||||
|
locationObject.insert(DOMAIN_ID_KEY_IN_LOCATION, domainHandler.getUUID().toString());
|
||||||
|
}
|
||||||
|
|
||||||
rootObject.insert(LOCATION_KEY_IN_ROOT, locationObject);
|
rootObject.insert(LOCATION_KEY_IN_ROOT, locationObject);
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ public:
|
||||||
const QUrl currentAddress() const;
|
const QUrl currentAddress() const;
|
||||||
const QString currentPath(bool withOrientation = true) const;
|
const QString currentPath(bool withOrientation = true) const;
|
||||||
|
|
||||||
|
const QUuid& getRootPlaceID() const { return _rootPlaceID; }
|
||||||
const QString& getRootPlaceName() const { return _rootPlaceName; }
|
const QString& getRootPlaceName() const { return _rootPlaceName; }
|
||||||
|
|
||||||
void attemptPlaceNameLookup(const QString& lookupString);
|
void attemptPlaceNameLookup(const QString& lookupString);
|
||||||
|
|
Loading…
Reference in a new issue