mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-28 07:19:55 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into wallet_autologout
This commit is contained in:
commit
dc1a33ba6e
5 changed files with 36 additions and 8 deletions
|
@ -53,6 +53,7 @@
|
||||||
#include <EntityScriptingInterface.h> // TODO: consider moving to scriptengine.h
|
#include <EntityScriptingInterface.h> // TODO: consider moving to scriptengine.h
|
||||||
|
|
||||||
#include "entities/AssignmentParentFinder.h"
|
#include "entities/AssignmentParentFinder.h"
|
||||||
|
#include "AssignmentDynamicFactory.h"
|
||||||
#include "RecordingScriptingInterface.h"
|
#include "RecordingScriptingInterface.h"
|
||||||
#include "AbstractAudioInterface.h"
|
#include "AbstractAudioInterface.h"
|
||||||
#include "AgentScriptingInterface.h"
|
#include "AgentScriptingInterface.h"
|
||||||
|
@ -67,6 +68,9 @@ Agent::Agent(ReceivedMessage& message) :
|
||||||
{
|
{
|
||||||
DependencyManager::set<ScriptableAvatar>();
|
DependencyManager::set<ScriptableAvatar>();
|
||||||
|
|
||||||
|
DependencyManager::registerInheritance<EntityDynamicFactoryInterface, AssignmentDynamicFactory>();
|
||||||
|
DependencyManager::set<AssignmentDynamicFactory>();
|
||||||
|
|
||||||
DependencyManager::set<AnimationCache>();
|
DependencyManager::set<AnimationCache>();
|
||||||
DependencyManager::set<AnimationCacheScriptingInterface>();
|
DependencyManager::set<AnimationCacheScriptingInterface>();
|
||||||
DependencyManager::set<EntityScriptingInterface>(false);
|
DependencyManager::set<EntityScriptingInterface>(false);
|
||||||
|
@ -860,6 +864,8 @@ void Agent::aboutToFinish() {
|
||||||
DependencyManager::destroy<recording::ClipCache>();
|
DependencyManager::destroy<recording::ClipCache>();
|
||||||
DependencyManager::destroy<ScriptEngine>();
|
DependencyManager::destroy<ScriptEngine>();
|
||||||
|
|
||||||
|
DependencyManager::destroy<AssignmentDynamicFactory>();
|
||||||
|
|
||||||
DependencyManager::destroy<ScriptableAvatar>();
|
DependencyManager::destroy<ScriptableAvatar>();
|
||||||
|
|
||||||
QMetaObject::invokeMethod(&_avatarAudioTimer, "stop");
|
QMetaObject::invokeMethod(&_avatarAudioTimer, "stop");
|
||||||
|
|
|
@ -541,7 +541,8 @@ void AvatarMixer::handleRequestsDomainListDataPacket(QSharedPointer<ReceivedMess
|
||||||
// ...For those nodes, reset the lastBroadcastTime to 0
|
// ...For those nodes, reset the lastBroadcastTime to 0
|
||||||
// so that the AvatarMixer will send Identity data to us
|
// so that the AvatarMixer will send Identity data to us
|
||||||
[&](const SharedNodePointer& node) {
|
[&](const SharedNodePointer& node) {
|
||||||
nodeData->setLastBroadcastTime(node->getUUID(), 0);
|
nodeData->setLastBroadcastTime(node->getUUID(), 0);
|
||||||
|
nodeData->resetSentTraitData(node->getLocalID());
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -588,10 +589,10 @@ void AvatarMixer::handleAvatarIdentityRequestPacket(QSharedPointer<ReceivedMessa
|
||||||
QUuid avatarID(QUuid::fromRfc4122(message->getMessage()) );
|
QUuid avatarID(QUuid::fromRfc4122(message->getMessage()) );
|
||||||
if (!avatarID.isNull()) {
|
if (!avatarID.isNull()) {
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
auto node = nodeList->nodeWithUUID(avatarID);
|
auto requestedNode = nodeList->nodeWithUUID(avatarID);
|
||||||
if (node) {
|
|
||||||
QMutexLocker lock(&node->getMutex());
|
if (requestedNode) {
|
||||||
AvatarMixerClientData* avatarClientData = dynamic_cast<AvatarMixerClientData*>(node->getLinkedData());
|
AvatarMixerClientData* avatarClientData = static_cast<AvatarMixerClientData*>(requestedNode->getLinkedData());
|
||||||
if (avatarClientData) {
|
if (avatarClientData) {
|
||||||
const AvatarData& avatarData = avatarClientData->getAvatar();
|
const AvatarData& avatarData = avatarClientData->getAvatar();
|
||||||
QByteArray serializedAvatar = avatarData.identityByteArray();
|
QByteArray serializedAvatar = avatarData.identityByteArray();
|
||||||
|
@ -600,6 +601,11 @@ void AvatarMixer::handleAvatarIdentityRequestPacket(QSharedPointer<ReceivedMessa
|
||||||
nodeList->sendPacketList(std::move(identityPackets), *senderNode);
|
nodeList->sendPacketList(std::move(identityPackets), *senderNode);
|
||||||
++_sumIdentityPackets;
|
++_sumIdentityPackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AvatarMixerClientData* senderData = static_cast<AvatarMixerClientData*>(senderNode->getLinkedData());
|
||||||
|
if (senderData) {
|
||||||
|
senderData->resetSentTraitData(requestedNode->getLocalID());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -625,23 +631,24 @@ void AvatarMixer::handleNodeIgnoreRequestPacket(QSharedPointer<ReceivedMessage>
|
||||||
while (message->getBytesLeftToRead()) {
|
while (message->getBytesLeftToRead()) {
|
||||||
// parse out the UUID being ignored from the packet
|
// parse out the UUID being ignored from the packet
|
||||||
QUuid ignoredUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
QUuid ignoredUUID = QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID));
|
||||||
|
auto ignoredNode = nodeList->nodeWithUUID(ignoredUUID);
|
||||||
if (nodeList->nodeWithUUID(ignoredUUID)) {
|
if (ignoredNode) {
|
||||||
if (nodeData) {
|
if (nodeData) {
|
||||||
// Reset the lastBroadcastTime for the ignored avatar to 0
|
// Reset the lastBroadcastTime for the ignored avatar to 0
|
||||||
// so the AvatarMixer knows it'll have to send identity data about the ignored avatar
|
// so the AvatarMixer knows it'll have to send identity data about the ignored avatar
|
||||||
// to the ignorer if the ignorer unignores.
|
// to the ignorer if the ignorer unignores.
|
||||||
nodeData->setLastBroadcastTime(ignoredUUID, 0);
|
nodeData->setLastBroadcastTime(ignoredUUID, 0);
|
||||||
|
nodeData->resetSentTraitData(ignoredNode->getLocalID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Reset the lastBroadcastTime for the ignorer (FROM THE PERSPECTIVE OF THE IGNORED) to 0
|
// Reset the lastBroadcastTime for the ignorer (FROM THE PERSPECTIVE OF THE IGNORED) to 0
|
||||||
// so the AvatarMixer knows it'll have to send identity data about the ignorer
|
// so the AvatarMixer knows it'll have to send identity data about the ignorer
|
||||||
// to the ignored if the ignorer unignores.
|
// to the ignored if the ignorer unignores.
|
||||||
auto ignoredNode = nodeList->nodeWithUUID(ignoredUUID);
|
|
||||||
AvatarMixerClientData* ignoredNodeData = reinterpret_cast<AvatarMixerClientData*>(ignoredNode->getLinkedData());
|
AvatarMixerClientData* ignoredNodeData = reinterpret_cast<AvatarMixerClientData*>(ignoredNode->getLinkedData());
|
||||||
if (ignoredNodeData) {
|
if (ignoredNodeData) {
|
||||||
ignoredNodeData->setLastBroadcastTime(senderNode->getUUID(), 0);
|
ignoredNodeData->setLastBroadcastTime(senderNode->getUUID(), 0);
|
||||||
|
ignoredNodeData->resetSentTraitData(senderNode->getLocalID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -228,6 +228,9 @@ void AvatarMixerClientData::ignoreOther(SharedNodePointer self, SharedNodePointe
|
||||||
killPacket->writePrimitive(KillAvatarReason::YourAvatarEnteredTheirBubble);
|
killPacket->writePrimitive(KillAvatarReason::YourAvatarEnteredTheirBubble);
|
||||||
}
|
}
|
||||||
setLastBroadcastTime(other->getUUID(), 0);
|
setLastBroadcastTime(other->getUUID(), 0);
|
||||||
|
|
||||||
|
resetSentTraitData(other->getLocalID());
|
||||||
|
|
||||||
DependencyManager::get<NodeList>()->sendPacket(std::move(killPacket), *self);
|
DependencyManager::get<NodeList>()->sendPacket(std::move(killPacket), *self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -238,6 +241,11 @@ void AvatarMixerClientData::removeFromRadiusIgnoringSet(SharedNodePointer self,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AvatarMixerClientData::resetSentTraitData(Node::LocalID nodeLocalID) {
|
||||||
|
_lastSentTraitsTimestamps[nodeLocalID] = TraitsCheckTimestamp();
|
||||||
|
_sentTraitVersions[nodeLocalID].reset();
|
||||||
|
}
|
||||||
|
|
||||||
void AvatarMixerClientData::readViewFrustumPacket(const QByteArray& message) {
|
void AvatarMixerClientData::readViewFrustumPacket(const QByteArray& message) {
|
||||||
_currentViewFrustums.clear();
|
_currentViewFrustums.clear();
|
||||||
|
|
||||||
|
|
|
@ -135,6 +135,8 @@ public:
|
||||||
|
|
||||||
AvatarTraits::TraitVersions& getLastSentTraitVersions(Node::LocalID otherAvatar) { return _sentTraitVersions[otherAvatar]; }
|
AvatarTraits::TraitVersions& getLastSentTraitVersions(Node::LocalID otherAvatar) { return _sentTraitVersions[otherAvatar]; }
|
||||||
|
|
||||||
|
void resetSentTraitData(Node::LocalID nodeID);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct PacketQueue : public std::queue<QSharedPointer<ReceivedMessage>> {
|
struct PacketQueue : public std::queue<QSharedPointer<ReceivedMessage>> {
|
||||||
QWeakPointer<Node> node;
|
QWeakPointer<Node> node;
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#include <EntityScriptClient.h> // for EntityScriptServerServices
|
#include <EntityScriptClient.h> // for EntityScriptServerServices
|
||||||
|
|
||||||
|
#include "../AssignmentDynamicFactory.h"
|
||||||
#include "EntityScriptServerLogging.h"
|
#include "EntityScriptServerLogging.h"
|
||||||
#include "../entities/AssignmentParentFinder.h"
|
#include "../entities/AssignmentParentFinder.h"
|
||||||
|
|
||||||
|
@ -56,6 +57,9 @@ int EntityScriptServer::_entitiesScriptEngineCount = 0;
|
||||||
EntityScriptServer::EntityScriptServer(ReceivedMessage& message) : ThreadedAssignment(message) {
|
EntityScriptServer::EntityScriptServer(ReceivedMessage& message) : ThreadedAssignment(message) {
|
||||||
qInstallMessageHandler(messageHandler);
|
qInstallMessageHandler(messageHandler);
|
||||||
|
|
||||||
|
DependencyManager::registerInheritance<EntityDynamicFactoryInterface, AssignmentDynamicFactory>();
|
||||||
|
DependencyManager::set<AssignmentDynamicFactory>();
|
||||||
|
|
||||||
DependencyManager::set<EntityScriptingInterface>(false)->setPacketSender(&_entityEditSender);
|
DependencyManager::set<EntityScriptingInterface>(false)->setPacketSender(&_entityEditSender);
|
||||||
DependencyManager::set<ResourceScriptingInterface>();
|
DependencyManager::set<ResourceScriptingInterface>();
|
||||||
|
|
||||||
|
@ -579,6 +583,7 @@ void EntityScriptServer::handleOctreePacket(QSharedPointer<ReceivedMessage> mess
|
||||||
void EntityScriptServer::aboutToFinish() {
|
void EntityScriptServer::aboutToFinish() {
|
||||||
shutdownScriptEngine();
|
shutdownScriptEngine();
|
||||||
|
|
||||||
|
DependencyManager::destroy<AssignmentDynamicFactory>();
|
||||||
DependencyManager::destroy<AssignmentParentFinder>();
|
DependencyManager::destroy<AssignmentParentFinder>();
|
||||||
|
|
||||||
DependencyManager::get<ResourceManager>()->cleanup();
|
DependencyManager::get<ResourceManager>()->cleanup();
|
||||||
|
|
Loading…
Reference in a new issue