From 4b306401afd026e8a737af85d0520988c9998c9b Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 11:32:52 -0700 Subject: [PATCH 1/3] use slot to change AvatarData::_sessionUUID --- interface/src/Application.cpp | 6 +----- libraries/avatars/src/AvatarData.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 2a97e536e4..ae80cdef48 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -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() { diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index e8b287ceed..2b8dfe8861 100755 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -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; From 7304049f83df687ea9df7b11b5e7e4fa8c4011f2 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 12:55:29 -0700 Subject: [PATCH 2/3] update boiler plate to abide by new standard --- libraries/script-engine/src/ScriptUUID.cpp | 11 ++++++++--- libraries/script-engine/src/ScriptUUID.h | 19 +++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/libraries/script-engine/src/ScriptUUID.cpp b/libraries/script-engine/src/ScriptUUID.cpp index cea7247e90..f19ed99417 100644 --- a/libraries/script-engine/src/ScriptUUID.cpp +++ b/libraries/script-engine/src/ScriptUUID.cpp @@ -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 diff --git a/libraries/script-engine/src/ScriptUUID.h b/libraries/script-engine/src/ScriptUUID.h index 43e885cf98..32ab40a106 100644 --- a/libraries/script-engine/src/ScriptUUID.h +++ b/libraries/script-engine/src/ScriptUUID.h @@ -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 -/// 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 From 698e3783e0fb05fb172424c3459f0d1a81bc77a0 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 13:06:29 -0700 Subject: [PATCH 3/3] fixing formatting --- libraries/script-engine/src/ScriptUUID.cpp | 2 +- libraries/script-engine/src/ScriptUUID.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/script-engine/src/ScriptUUID.cpp b/libraries/script-engine/src/ScriptUUID.cpp index f19ed99417..9e00f9c095 100644 --- a/libraries/script-engine/src/ScriptUUID.cpp +++ b/libraries/script-engine/src/ScriptUUID.cpp @@ -5,7 +5,7 @@ // 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 +// 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 diff --git a/libraries/script-engine/src/ScriptUUID.h b/libraries/script-engine/src/ScriptUUID.h index 32ab40a106..db94b5082b 100644 --- a/libraries/script-engine/src/ScriptUUID.h +++ b/libraries/script-engine/src/ScriptUUID.h @@ -5,7 +5,7 @@ // 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 +// 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