mirror of
https://github.com/overte-org/overte.git
synced 2025-08-11 09:20:48 +02:00
Merge pull request #10784 from huffman/feat/pal-replicated
Disable silence + ban buttons for replicated users
This commit is contained in:
commit
209a4f33b5
11 changed files with 39 additions and 9 deletions
|
@ -229,7 +229,7 @@ void AvatarMixer::start() {
|
||||||
auto start = usecTimestampNow();
|
auto start = usecTimestampNow();
|
||||||
nodeList->nestedEach([&](NodeList::const_iterator cbegin, NodeList::const_iterator cend) {
|
nodeList->nestedEach([&](NodeList::const_iterator cbegin, NodeList::const_iterator cend) {
|
||||||
std::for_each(cbegin, cend, [&](const SharedNodePointer& node) {
|
std::for_each(cbegin, cend, [&](const SharedNodePointer& node) {
|
||||||
if (node->getType() == NodeType::Agent && !node->isUpstream()) {
|
if (node->getType() == NodeType::Agent) {
|
||||||
manageIdentityData(node);
|
manageIdentityData(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,8 +325,8 @@ void AvatarMixer::manageIdentityData(const SharedNodePointer& node) {
|
||||||
sendIdentity = true;
|
sendIdentity = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sendIdentity) {
|
if (sendIdentity && !node->isUpstream()) {
|
||||||
|
sendIdentityPacket(nodeData, node); // Tell node whose name changed about its new session display name or avatar.
|
||||||
// since this packet includes a change to either the skeleton model URL or the display name
|
// since this packet includes a change to either the skeleton model URL or the display name
|
||||||
// it needs a new sequence number
|
// it needs a new sequence number
|
||||||
nodeData->getAvatar().pushIdentitySequenceNumber();
|
nodeData->getAvatar().pushIdentitySequenceNumber();
|
||||||
|
|
|
@ -81,7 +81,7 @@ int AvatarMixerSlave::sendIdentityPacket(const AvatarMixerClientData* nodeData,
|
||||||
|
|
||||||
int AvatarMixerSlave::sendReplicatedIdentityPacket(const Node& agentNode, const AvatarMixerClientData* nodeData, const Node& destinationNode) {
|
int AvatarMixerSlave::sendReplicatedIdentityPacket(const Node& agentNode, const AvatarMixerClientData* nodeData, const Node& destinationNode) {
|
||||||
if (AvatarMixer::shouldReplicateTo(agentNode, destinationNode)) {
|
if (AvatarMixer::shouldReplicateTo(agentNode, destinationNode)) {
|
||||||
QByteArray individualData = nodeData->getConstAvatarData()->identityByteArray();
|
QByteArray individualData = nodeData->getConstAvatarData()->identityByteArray(true);
|
||||||
individualData.replace(0, NUM_BYTES_RFC4122_UUID, nodeData->getNodeID().toRfc4122()); // FIXME, this looks suspicious
|
individualData.replace(0, NUM_BYTES_RFC4122_UUID, nodeData->getNodeID().toRfc4122()); // FIXME, this looks suspicious
|
||||||
auto identityPacket = NLPacketList::create(PacketType::ReplicatedAvatarIdentity, QByteArray(), true, true);
|
auto identityPacket = NLPacketList::create(PacketType::ReplicatedAvatarIdentity, QByteArray(), true, true);
|
||||||
identityPacket->write(individualData);
|
identityPacket->write(individualData);
|
||||||
|
|
|
@ -43,6 +43,7 @@ Item {
|
||||||
property bool selected: false
|
property bool selected: false
|
||||||
property bool isAdmin: false
|
property bool isAdmin: false
|
||||||
property bool isPresent: true
|
property bool isPresent: true
|
||||||
|
property bool isReplicated: false
|
||||||
property string placeName: ""
|
property string placeName: ""
|
||||||
property string profilePicBorderColor: (connectionStatus == "connection" ? hifi.colors.indigoAccent : (connectionStatus == "friend" ? hifi.colors.greenHighlight : "transparent"))
|
property string profilePicBorderColor: (connectionStatus == "connection" ? hifi.colors.indigoAccent : (connectionStatus == "friend" ? hifi.colors.greenHighlight : "transparent"))
|
||||||
property alias avImage: avatarImage
|
property alias avImage: avatarImage
|
||||||
|
|
|
@ -473,6 +473,7 @@ Rectangle {
|
||||||
visible: !isCheckBox && !isButton && !isAvgAudio;
|
visible: !isCheckBox && !isButton && !isAvgAudio;
|
||||||
uuid: model ? model.sessionId : "";
|
uuid: model ? model.sessionId : "";
|
||||||
selected: styleData.selected;
|
selected: styleData.selected;
|
||||||
|
isReplicated: model.isReplicated;
|
||||||
isAdmin: model && model.admin;
|
isAdmin: model && model.admin;
|
||||||
isPresent: model && model.isPresent;
|
isPresent: model && model.isPresent;
|
||||||
// Size
|
// Size
|
||||||
|
@ -553,6 +554,7 @@ Rectangle {
|
||||||
id: actionButton;
|
id: actionButton;
|
||||||
color: 2; // Red
|
color: 2; // Red
|
||||||
visible: isButton;
|
visible: isButton;
|
||||||
|
enabled: !nameCard.isReplicated;
|
||||||
anchors.centerIn: parent;
|
anchors.centerIn: parent;
|
||||||
width: 32;
|
width: 32;
|
||||||
height: 32;
|
height: 32;
|
||||||
|
|
|
@ -1509,6 +1509,7 @@ void AvatarData::processAvatarIdentity(const QByteArray& identityData, bool& ide
|
||||||
>> identity.attachmentData
|
>> identity.attachmentData
|
||||||
>> identity.displayName
|
>> identity.displayName
|
||||||
>> identity.sessionDisplayName
|
>> identity.sessionDisplayName
|
||||||
|
>> identity.isReplicated
|
||||||
>> identity.avatarEntityData;
|
>> identity.avatarEntityData;
|
||||||
|
|
||||||
// set the store identity sequence number to match the incoming identity
|
// set the store identity sequence number to match the incoming identity
|
||||||
|
@ -1531,6 +1532,11 @@ void AvatarData::processAvatarIdentity(const QByteArray& identityData, bool& ide
|
||||||
}
|
}
|
||||||
maybeUpdateSessionDisplayNameFromTransport(identity.sessionDisplayName);
|
maybeUpdateSessionDisplayNameFromTransport(identity.sessionDisplayName);
|
||||||
|
|
||||||
|
if (identity.isReplicated != _isReplicated) {
|
||||||
|
_isReplicated = identity.isReplicated;
|
||||||
|
identityChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (identity.attachmentData != _attachmentData) {
|
if (identity.attachmentData != _attachmentData) {
|
||||||
setAttachmentData(identity.attachmentData);
|
setAttachmentData(identity.attachmentData);
|
||||||
identityChanged = true;
|
identityChanged = true;
|
||||||
|
@ -1561,7 +1567,7 @@ void AvatarData::processAvatarIdentity(const QByteArray& identityData, bool& ide
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray AvatarData::identityByteArray() const {
|
QByteArray AvatarData::identityByteArray(bool setIsReplicated) const {
|
||||||
QByteArray identityData;
|
QByteArray identityData;
|
||||||
QDataStream identityStream(&identityData, QIODevice::Append);
|
QDataStream identityStream(&identityData, QIODevice::Append);
|
||||||
const QUrl& urlToSend = cannonicalSkeletonModelURL(emptyURL); // depends on _skeletonModelURL
|
const QUrl& urlToSend = cannonicalSkeletonModelURL(emptyURL); // depends on _skeletonModelURL
|
||||||
|
@ -1576,6 +1582,7 @@ QByteArray AvatarData::identityByteArray() const {
|
||||||
<< _attachmentData
|
<< _attachmentData
|
||||||
<< _displayName
|
<< _displayName
|
||||||
<< getSessionDisplayNameForTransport() // depends on _sessionDisplayName
|
<< getSessionDisplayNameForTransport() // depends on _sessionDisplayName
|
||||||
|
<< (_isReplicated || setIsReplicated)
|
||||||
<< _avatarEntityData;
|
<< _avatarEntityData;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -531,6 +531,7 @@ public:
|
||||||
QVector<AttachmentData> attachmentData;
|
QVector<AttachmentData> attachmentData;
|
||||||
QString displayName;
|
QString displayName;
|
||||||
QString sessionDisplayName;
|
QString sessionDisplayName;
|
||||||
|
bool isReplicated;
|
||||||
AvatarEntityMap avatarEntityData;
|
AvatarEntityMap avatarEntityData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -539,7 +540,7 @@ public:
|
||||||
void processAvatarIdentity(const QByteArray& identityData, bool& identityChanged,
|
void processAvatarIdentity(const QByteArray& identityData, bool& identityChanged,
|
||||||
bool& displayNameChanged, bool& skeletonModelUrlChanged);
|
bool& displayNameChanged, bool& skeletonModelUrlChanged);
|
||||||
|
|
||||||
QByteArray identityByteArray() const;
|
QByteArray identityByteArray(bool setIsReplicated = false) const;
|
||||||
|
|
||||||
const QUrl& getSkeletonModelURL() const { return _skeletonModelURL; }
|
const QUrl& getSkeletonModelURL() const { return _skeletonModelURL; }
|
||||||
const QString& getDisplayName() const { return _displayName; }
|
const QString& getDisplayName() const { return _displayName; }
|
||||||
|
@ -629,6 +630,8 @@ public:
|
||||||
|
|
||||||
float getDensity() const { return _density; }
|
float getDensity() const { return _density; }
|
||||||
|
|
||||||
|
bool getIsReplicated() const { return _isReplicated; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void displayNameChanged();
|
void displayNameChanged();
|
||||||
|
|
||||||
|
@ -665,6 +668,10 @@ protected:
|
||||||
bool hasParent() const { return !getParentID().isNull(); }
|
bool hasParent() const { return !getParentID().isNull(); }
|
||||||
bool hasFaceTracker() const { return _headData ? _headData->_isFaceTrackerConnected : false; }
|
bool hasFaceTracker() const { return _headData ? _headData->_isFaceTrackerConnected : false; }
|
||||||
|
|
||||||
|
// isReplicated will be true on downstream Avatar Mixers and their clients, but false on the upstream "master"
|
||||||
|
// Audio Mixer that the replicated avatar is connected to.
|
||||||
|
bool _isReplicated{ false };
|
||||||
|
|
||||||
glm::vec3 _handPosition;
|
glm::vec3 _handPosition;
|
||||||
virtual const QString& getSessionDisplayNameForTransport() const { return _sessionDisplayName; }
|
virtual const QString& getSessionDisplayNameForTransport() const { return _sessionDisplayName; }
|
||||||
virtual void maybeUpdateSessionDisplayNameFromTransport(const QString& sessionDisplayName) { } // No-op in AvatarMixer
|
virtual void maybeUpdateSessionDisplayNameFromTransport(const QString& sessionDisplayName) { } // No-op in AvatarMixer
|
||||||
|
|
|
@ -152,6 +152,15 @@ QString ScriptAvatarData::getSessionDisplayName() const {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ScriptAvatarData::getIsReplicated() const {
|
||||||
|
if (AvatarSharedPointer sharedAvatarData = _avatarData.lock()) {
|
||||||
|
return sharedAvatarData->getIsReplicated();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// IDENTIFIER PROPERTIES
|
// IDENTIFIER PROPERTIES
|
||||||
// END
|
// END
|
||||||
|
|
|
@ -45,6 +45,7 @@ class ScriptAvatarData : public QObject {
|
||||||
Q_PROPERTY(QUuid sessionUUID READ getSessionUUID)
|
Q_PROPERTY(QUuid sessionUUID READ getSessionUUID)
|
||||||
Q_PROPERTY(QString displayName READ getDisplayName NOTIFY displayNameChanged)
|
Q_PROPERTY(QString displayName READ getDisplayName NOTIFY displayNameChanged)
|
||||||
Q_PROPERTY(QString sessionDisplayName READ getSessionDisplayName)
|
Q_PROPERTY(QString sessionDisplayName READ getSessionDisplayName)
|
||||||
|
Q_PROPERTY(bool isReplicated READ getIsReplicated)
|
||||||
|
|
||||||
//
|
//
|
||||||
// ATTACHMENT AND JOINT PROPERTIES
|
// ATTACHMENT AND JOINT PROPERTIES
|
||||||
|
@ -95,6 +96,7 @@ public:
|
||||||
QUuid getSessionUUID() const;
|
QUuid getSessionUUID() const;
|
||||||
QString getDisplayName() const;
|
QString getDisplayName() const;
|
||||||
QString getSessionDisplayName() const;
|
QString getSessionDisplayName() const;
|
||||||
|
bool getIsReplicated() const;
|
||||||
|
|
||||||
//
|
//
|
||||||
// ATTACHMENT AND JOINT PROPERTIES
|
// ATTACHMENT AND JOINT PROPERTIES
|
||||||
|
|
|
@ -69,7 +69,7 @@ PacketVersion versionForPacketType(PacketType packetType) {
|
||||||
case PacketType::AvatarData:
|
case PacketType::AvatarData:
|
||||||
case PacketType::BulkAvatarData:
|
case PacketType::BulkAvatarData:
|
||||||
case PacketType::KillAvatar:
|
case PacketType::KillAvatar:
|
||||||
return static_cast<PacketVersion>(AvatarMixerPacketVersion::AvatarIdentitySequenceFront);
|
return static_cast<PacketVersion>(AvatarMixerPacketVersion::IsReplicatedInAvatarIdentity);
|
||||||
case PacketType::MessagesData:
|
case PacketType::MessagesData:
|
||||||
return static_cast<PacketVersion>(MessageDataVersion::TextOrBinaryData);
|
return static_cast<PacketVersion>(MessageDataVersion::TextOrBinaryData);
|
||||||
case PacketType::ICEServerHeartbeat:
|
case PacketType::ICEServerHeartbeat:
|
||||||
|
|
|
@ -247,7 +247,8 @@ enum class AvatarMixerPacketVersion : PacketVersion {
|
||||||
IdentityPacketsIncludeUpdateTime,
|
IdentityPacketsIncludeUpdateTime,
|
||||||
AvatarIdentitySequenceId,
|
AvatarIdentitySequenceId,
|
||||||
MannequinDefaultAvatar,
|
MannequinDefaultAvatar,
|
||||||
AvatarIdentitySequenceFront
|
AvatarIdentitySequenceFront,
|
||||||
|
IsReplicatedInAvatarIdentity
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class DomainConnectRequestVersion : PacketVersion {
|
enum class DomainConnectRequestVersion : PacketVersion {
|
||||||
|
|
|
@ -479,7 +479,8 @@ function populateNearbyUserList(selectData, oldAudioData) {
|
||||||
admin: false,
|
admin: false,
|
||||||
personalMute: !!id && Users.getPersonalMuteStatus(id), // expects proper boolean, not null
|
personalMute: !!id && Users.getPersonalMuteStatus(id), // expects proper boolean, not null
|
||||||
ignore: !!id && Users.getIgnoreStatus(id), // ditto
|
ignore: !!id && Users.getIgnoreStatus(id), // ditto
|
||||||
isPresent: true
|
isPresent: true,
|
||||||
|
isReplicated: avatar.isReplicated
|
||||||
};
|
};
|
||||||
if (id) {
|
if (id) {
|
||||||
addAvatarNode(id); // No overlay for ourselves
|
addAvatarNode(id); // No overlay for ourselves
|
||||||
|
|
Loading…
Reference in a new issue