This commit is contained in:
Andrew Meadows 2014-04-09 14:36:22 -07:00
commit 5fa1fd6b81
4 changed files with 21 additions and 17 deletions

View file

@ -232,6 +232,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) :
connect(nodeList, SIGNAL(nodeAdded(SharedNodePointer)), &_voxels, SLOT(nodeAdded(SharedNodePointer)));
connect(nodeList, SIGNAL(nodeKilled(SharedNodePointer)), &_voxels, SLOT(nodeKilled(SharedNodePointer)));
connect(nodeList, &NodeList::uuidChanged, this, &Application::updateWindowTitle);
connect(nodeList, SIGNAL(uuidChanged(const QUuid&)), _myAvatar, SLOT(setSessionUUID(const QUuid&)));
connect(nodeList, &NodeList::limitOfSilentDomainCheckInsReached, nodeList, &NodeList::reset);
// connect to appropriate slots on AccountManager
@ -1216,11 +1217,6 @@ void Application::timer() {
// ask the node list to check in with the domain server
NodeList::getInstance()->sendDomainServerCheckIn();
// as soon as we have a valid sessionUUID, store it in the avatar for reference
if (_myAvatar->getSessionUUID().isNull()) {
_myAvatar->setSessionUUID(NodeList::getInstance()->getSessionUUID());
}
}
void Application::idle() {

View file

@ -102,7 +102,6 @@ public:
virtual ~AvatarData();
const QUuid& getSessionUUID() { return _sessionUUID; }
void setSessionUUID(const QUuid& id) { _sessionUUID = id; }
const glm::vec3& getPosition() const { return _position; }
void setPosition(const glm::vec3 position) { _position = position; }
@ -225,6 +224,7 @@ public slots:
void sendBillboardPacket();
void setBillboardFromNetworkReply();
void setJointMappingsFromNetworkReply();
void setSessionUUID(const QUuid& id) { _sessionUUID = id; }
protected:
QUuid _sessionUUID;
glm::vec3 _position;

View file

@ -1,10 +1,15 @@
//
// ScriptUUID.h
// hifi
// ScriptUUID.cpp
// libraries/script-engine/src/
//
// Created by Andrew Meadows on 2014.04.07
// Created by Andrew Meadows on 2014-04-07
// Copyright (c) 2014 High Fidelity, Inc. All rights reserved.
//
// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#include <QDebug>

View file

@ -1,17 +1,22 @@
//
// ScriptUUID.h
// hifi
// libraries/script-engine/src/
//
// Created by Andrew Meadows on 2014.04.07
// Created by Andrew Meadows on 2014-04-07
// Copyright (c) 2014 High Fidelity, Inc. All rights reserved.
//
// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef __hifi__ScriptUUID__
#define __hifi__ScriptUUID__
#ifndef hifi_ScriptUUID_h
#define hifi_ScriptUUID_h
#include <QUuid>
/// Scriptable interface a UUID helper class object. Used exclusively in the JavaScript API
/// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API
class ScriptUUID : public QObject {
Q_OBJECT
@ -24,6 +29,4 @@ public slots:
void print(const QString& lable, const QUuid& id);
};
#endif /* defined(__hifi__Vec3__) */
#endif // hifi_ScriptUUID_h