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(nodeAdded(SharedNodePointer)), &_voxels, SLOT(nodeAdded(SharedNodePointer)));
connect(nodeList, SIGNAL(nodeKilled(SharedNodePointer)), &_voxels, SLOT(nodeKilled(SharedNodePointer))); connect(nodeList, SIGNAL(nodeKilled(SharedNodePointer)), &_voxels, SLOT(nodeKilled(SharedNodePointer)));
connect(nodeList, &NodeList::uuidChanged, this, &Application::updateWindowTitle); 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(nodeList, &NodeList::limitOfSilentDomainCheckInsReached, nodeList, &NodeList::reset);
// connect to appropriate slots on AccountManager // connect to appropriate slots on AccountManager
@ -1216,11 +1217,6 @@ void Application::timer() {
// ask the node list to check in with the domain server // ask the node list to check in with the domain server
NodeList::getInstance()->sendDomainServerCheckIn(); 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() { void Application::idle() {

View file

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

View file

@ -1,10 +1,15 @@
// //
// ScriptUUID.h // ScriptUUID.cpp
// 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. // 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> #include <QDebug>

View file

@ -1,17 +1,22 @@
// //
// ScriptUUID.h // 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. // 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__ #ifndef hifi_ScriptUUID_h
#define __hifi__ScriptUUID__ #define hifi_ScriptUUID_h
#include <QUuid> #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 { class ScriptUUID : public QObject {
Q_OBJECT Q_OBJECT
@ -24,6 +29,4 @@ public slots:
void print(const QString& lable, const QUuid& id); void print(const QString& lable, const QUuid& id);
}; };
#endif // hifi_ScriptUUID_h
#endif /* defined(__hifi__Vec3__) */