mirror of
https://github.com/lubosz/overte.git
synced 2025-04-07 01:02:12 +02:00
The right way to restrict private user data:
This commit is contained in:
parent
e87381f431
commit
2ce9e9ee10
3 changed files with 11 additions and 6 deletions
|
@ -372,7 +372,7 @@ bool EntityTreeSendThread::traverseTreeAndBuildNextPacketPayload(EncodeBitstream
|
|||
// Record explicitly filtered-in entity so that extra entities can be flagged.
|
||||
entityNodeData->insertSentFilteredEntity(entityID);
|
||||
}
|
||||
OctreeElement::AppendState appendEntityState = entity->appendEntityData(&_packetData, params, _extraEncodeData);
|
||||
OctreeElement::AppendState appendEntityState = entity->appendEntityData(&_packetData, params, _extraEncodeData, entityNode->getCanGetAndSetPrivateUserData());
|
||||
|
||||
if (appendEntityState != OctreeElement::COMPLETED) {
|
||||
if (appendEntityState == OctreeElement::PARTIAL) {
|
||||
|
|
|
@ -155,7 +155,8 @@ EntityPropertyFlags EntityItem::getEntityProperties(EncodeBitstreamParams& param
|
|||
}
|
||||
|
||||
OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packetData, EncodeBitstreamParams& params,
|
||||
EntityTreeElementExtraEncodeDataPointer entityTreeElementExtraEncodeData) const {
|
||||
EntityTreeElementExtraEncodeDataPointer entityTreeElementExtraEncodeData,
|
||||
const bool destinationNodeCanGetAndSetPrivateUserData) const {
|
||||
|
||||
// ALL this fits...
|
||||
// object ID [16 bytes]
|
||||
|
@ -199,6 +200,11 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
|
|||
requestedProperties = entityTreeElementExtraEncodeData->entities.value(getEntityItemID());
|
||||
}
|
||||
|
||||
QString privateUserData = "";
|
||||
if (destinationNodeCanGetAndSetPrivateUserData) {
|
||||
privateUserData = getPrivateUserData();
|
||||
}
|
||||
|
||||
EntityPropertyFlags propertiesDidntFit = requestedProperties;
|
||||
|
||||
LevelDetails entityLevel = packetData->startLevel();
|
||||
|
@ -277,9 +283,7 @@ OctreeElement::AppendState EntityItem::appendEntityData(OctreePacketData* packet
|
|||
APPEND_ENTITY_PROPERTY(PROP_NAME, getName());
|
||||
APPEND_ENTITY_PROPERTY(PROP_LOCKED, getLocked());
|
||||
APPEND_ENTITY_PROPERTY(PROP_USER_DATA, getUserData());
|
||||
if (nodeList->getThisNodeCanGetAndSetPrivateUserData()) {
|
||||
APPEND_ENTITY_PROPERTY(PROP_PRIVATE_USER_DATA, getPrivateUserData());
|
||||
}
|
||||
APPEND_ENTITY_PROPERTY(PROP_PRIVATE_USER_DATA, privateUserData);
|
||||
APPEND_ENTITY_PROPERTY(PROP_HREF, getHref());
|
||||
APPEND_ENTITY_PROPERTY(PROP_DESCRIPTION, getDescription());
|
||||
APPEND_ENTITY_PROPERTY(PROP_POSITION, getLocalPosition());
|
||||
|
|
|
@ -134,7 +134,8 @@ public:
|
|||
virtual EntityPropertyFlags getEntityProperties(EncodeBitstreamParams& params) const;
|
||||
|
||||
virtual OctreeElement::AppendState appendEntityData(OctreePacketData* packetData, EncodeBitstreamParams& params,
|
||||
EntityTreeElementExtraEncodeDataPointer entityTreeElementExtraEncodeData) const;
|
||||
EntityTreeElementExtraEncodeDataPointer entityTreeElementExtraEncodeData,
|
||||
const bool destinationNodeCanGetAndSetPrivateUserData = false) const;
|
||||
|
||||
virtual void appendSubclassData(OctreePacketData* packetData, EncodeBitstreamParams& params,
|
||||
EntityTreeElementExtraEncodeDataPointer entityTreeElementExtraEncodeData,
|
||||
|
|
Loading…
Reference in a new issue