mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-08 06:32:35 +02:00
commit
3d4490f3fd
11 changed files with 70 additions and 65 deletions
|
@ -105,8 +105,6 @@ EntityScriptServer::~EntityScriptServer() {
|
|||
static const QString ENTITY_SCRIPT_SERVER_LOGGING_NAME = "entity-script-server";
|
||||
|
||||
void EntityScriptServer::handleReloadEntityServerScriptPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode) {
|
||||
// These are temporary checks until we can ensure that nodes eventually disconnect if the Domain Server stops telling them
|
||||
// about each other.
|
||||
if (senderNode->getCanRez() || senderNode->getCanRezTmp() || senderNode->getCanRezCertified() || senderNode->getCanRezTmpCertified()) {
|
||||
auto entityID = QUuid::fromRfc4122(message->read(NUM_BYTES_RFC4122_UUID));
|
||||
|
||||
|
@ -119,8 +117,6 @@ void EntityScriptServer::handleReloadEntityServerScriptPacket(QSharedPointer<Rec
|
|||
}
|
||||
|
||||
void EntityScriptServer::handleEntityScriptGetStatusPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode) {
|
||||
// These are temporary checks until we can ensure that nodes eventually disconnect if the Domain Server stops telling them
|
||||
// about each other.
|
||||
if (senderNode->getCanRez() || senderNode->getCanRezTmp() || senderNode->getCanRezCertified() || senderNode->getCanRezTmpCertified()) {
|
||||
MessageID messageID;
|
||||
message->readPrimitive(&messageID);
|
||||
|
@ -190,15 +186,14 @@ void EntityScriptServer::updateEntityPPS() {
|
|||
}
|
||||
|
||||
void EntityScriptServer::handleEntityServerScriptLogPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer senderNode) {
|
||||
// These are temporary checks until we can ensure that nodes eventually disconnect if the Domain Server stops telling them
|
||||
// about each other.
|
||||
bool canRezAny = senderNode->getCanRez() || senderNode->getCanRezTmp() || senderNode->getCanRezCertified() || senderNode->getCanRezTmpCertified();
|
||||
bool enable = false;
|
||||
message->readPrimitive(&enable);
|
||||
|
||||
auto senderUUID = senderNode->getUUID();
|
||||
auto it = _logListeners.find(senderUUID);
|
||||
|
||||
if (enable && senderNode->getCanRez()) {
|
||||
if (enable && canRezAny) {
|
||||
if (it == std::end(_logListeners)) {
|
||||
_logListeners.insert(senderUUID);
|
||||
qCInfo(entity_script_server) << "Node" << senderUUID << "subscribed to log stream";
|
||||
|
|
|
@ -1042,41 +1042,7 @@ void DomainServer::processListRequestPacket(QSharedPointer<ReceivedMessage> mess
|
|||
|
||||
bool DomainServer::isInInterestSet(const SharedNodePointer& nodeA, const SharedNodePointer& nodeB) {
|
||||
auto nodeAData = static_cast<DomainServerNodeData*>(nodeA->getLinkedData());
|
||||
auto nodeBData = static_cast<DomainServerNodeData*>(nodeB->getLinkedData());
|
||||
|
||||
// if we have no linked data for node A then B can't possibly be in the interest set
|
||||
if (!nodeAData) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// first check if the general interest set A contains the type for B
|
||||
if (nodeAData->getNodeInterestSet().contains(nodeB->getType())) {
|
||||
// given that there is a match in the general interest set, do any special checks
|
||||
|
||||
// (1/19/17) Agents only need to connect to Entity Script Servers to perform administrative tasks
|
||||
// related to entity server scripts. Only agents with rez permissions should be doing that, so
|
||||
// if the agent does not have those permissions, we do not want them and the server to incur the
|
||||
// overhead of connecting to one another. Additionally we exclude agents that do not care about the
|
||||
// Entity Script Server and won't attempt to connect to it.
|
||||
|
||||
bool isAgentWithoutRights = nodeA->getType() == NodeType::Agent
|
||||
&& nodeB->getType() == NodeType::EntityScriptServer
|
||||
&& !nodeA->getCanRez() && !nodeA->getCanRezTmp()
|
||||
&& !nodeA->getCanRezCertified() && !nodeA->getCanRezTmpCertified();
|
||||
|
||||
if (isAgentWithoutRights) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isScriptServerForIneffectiveAgent =
|
||||
(nodeA->getType() == NodeType::EntityScriptServer && nodeB->getType() == NodeType::Agent)
|
||||
&& ((nodeBData && !nodeBData->getNodeInterestSet().contains(NodeType::EntityScriptServer))
|
||||
|| (!nodeB->getCanRez() && !nodeB->getCanRezTmp() && !nodeB->getCanRezCertified() && !nodeB->getCanRezTmpCertified()));
|
||||
|
||||
return !isScriptServerForIneffectiveAgent;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return nodeAData && nodeAData->getNodeInterestSet().contains(nodeB->getType());
|
||||
}
|
||||
|
||||
unsigned int DomainServer::countConnectedUsers() {
|
||||
|
@ -3476,4 +3442,4 @@ void DomainServer::handleOctreeFileReplacementRequest(QSharedPointer<ReceivedMes
|
|||
if (node->getCanReplaceContent()) {
|
||||
handleOctreeFileReplacement(message->readAll());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,10 +163,18 @@ TextField {
|
|||
text: textField.label
|
||||
colorScheme: textField.colorScheme
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
Binding on anchors.right {
|
||||
when: parent.right
|
||||
value: parent.right
|
||||
}
|
||||
Binding on wrapMode {
|
||||
when: parent.right
|
||||
value: Text.WordWrap
|
||||
}
|
||||
|
||||
anchors.bottom: parent.top
|
||||
anchors.bottomMargin: 3
|
||||
wrapMode: Text.WordWrap
|
||||
visible: label != ""
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6244,8 +6244,9 @@ bool Application::canAcceptURL(const QString& urlString) const {
|
|||
|
||||
bool Application::acceptURL(const QString& urlString, bool defaultUpload) {
|
||||
QUrl url(urlString);
|
||||
if (isDomainURL(url)) {
|
||||
// this is a URL for a domain, either hifi:// or serverless - have the AddressManager handle it
|
||||
|
||||
if (url.scheme() == URL_SCHEME_HIFI) {
|
||||
// this is a hifi URL - have the AddressManager handle it
|
||||
QMetaObject::invokeMethod(DependencyManager::get<AddressManager>().data(), "handleLookupString",
|
||||
Qt::AutoConnection, Q_ARG(const QString&, urlString));
|
||||
return true;
|
||||
|
|
|
@ -131,6 +131,8 @@ ItemKey ShapeEntityRenderer::getKey() {
|
|||
withReadLock([&] {
|
||||
if (isTransparent()) {
|
||||
builder.withTransparent();
|
||||
} else if (_canCastShadow) {
|
||||
builder.withShadowCaster();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -425,8 +425,8 @@ bool EntityTree::updateEntity(EntityItemPointer entity, const EntityItemProperti
|
|||
if (!childEntity) {
|
||||
continue;
|
||||
}
|
||||
EntityTreeElementPointer containingElement = childEntity->getElement();
|
||||
if (!containingElement) {
|
||||
EntityTreeElementPointer childContainingElement = childEntity->getElement();
|
||||
if (!childContainingElement) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -440,7 +440,7 @@ bool EntityTree::updateEntity(EntityItemPointer entity, const EntityItemProperti
|
|||
addToNeedsParentFixupList(childEntity);
|
||||
}
|
||||
|
||||
UpdateEntityOperator theChildOperator(getThisPointer(), containingElement, childEntity, queryCube);
|
||||
UpdateEntityOperator theChildOperator(getThisPointer(), childContainingElement, childEntity, queryCube);
|
||||
recurseTreeWithOperator(&theChildOperator);
|
||||
foreach (SpatiallyNestablePointer childChild, childEntity->getChildren()) {
|
||||
if (childChild && childChild->getNestableType() == NestableType::Entity) {
|
||||
|
|
|
@ -288,7 +288,7 @@ OctreeElementPointer UpdateEntityOperator::possiblyCreateChildAt(const OctreeEle
|
|||
int indexOfChildContainingNewEntity = element->getMyChildContaining(_newEntityBox);
|
||||
|
||||
if (childIndex == indexOfChildContainingNewEntity) {
|
||||
return element->addChildAtIndex(childIndex);;
|
||||
return element->addChildAtIndex(childIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -380,6 +380,8 @@ void Antialiasing::run(const render::RenderContextPointer& renderContext, const
|
|||
batch.setResourceTexture(AntialiasingPass_VelocityMapSlot, nullptr);
|
||||
batch.setResourceTexture(AntialiasingPass_NextMapSlot, nullptr);
|
||||
});
|
||||
|
||||
args->popViewFrustum();
|
||||
}
|
||||
|
||||
|
||||
|
@ -520,7 +522,7 @@ void JitterSample::run(const render::RenderContextPointer& renderContext) {
|
|||
|
||||
viewFrustum.setProjection(projMat);
|
||||
viewFrustum.calculate();
|
||||
args->setViewFrustum(viewFrustum);
|
||||
args->pushViewFrustum(viewFrustum);
|
||||
} else {
|
||||
mat4 projMats[2];
|
||||
args->_context->getStereoProjections(projMats);
|
||||
|
@ -538,4 +540,4 @@ void JitterSample::run(const render::RenderContextPointer& renderContext) {
|
|||
}
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -46,7 +46,7 @@ void printOctalCode(const unsigned char* octalCode) {
|
|||
}
|
||||
|
||||
char sectionValue(const unsigned char* startByte, char startIndexInByte) {
|
||||
char rightShift = 8 - startIndexInByte - 3;
|
||||
int8_t rightShift = 8 - startIndexInByte - 3;
|
||||
|
||||
if (rightShift < 0) {
|
||||
return ((startByte[0] << -rightShift) & 7) + (startByte[1] >> (8 + rightShift));
|
||||
|
@ -73,7 +73,7 @@ int branchIndexWithDescendant(const unsigned char* ancestorOctalCode, const unsi
|
|||
return sectionValue(descendantOctalCode + 1 + (branchStartBit / 8), branchStartBit % 8);
|
||||
}
|
||||
|
||||
unsigned char* childOctalCode(const unsigned char* parentOctalCode, char childNumber) {
|
||||
unsigned char* childOctalCode(const unsigned char* parentOctalCode, int childNumber) {
|
||||
|
||||
// find the length (in number of three bit code sequences)
|
||||
// in the parent
|
||||
|
@ -111,7 +111,7 @@ unsigned char* childOctalCode(const unsigned char* parentOctalCode, char childNu
|
|||
|
||||
// calculate the amount of left shift required
|
||||
// this will be -1 or -2 if there's wrap
|
||||
char leftShift = 8 - (startBit % 8) - 3;
|
||||
int8_t leftShift = 8 - (startBit % 8) - 3;
|
||||
|
||||
if (leftShift < 0) {
|
||||
// we have a wrap-around to accomodate
|
||||
|
|
|
@ -30,7 +30,7 @@ using OctalCodePtrList = std::vector<OctalCodePtr>;
|
|||
void printOctalCode(const unsigned char* octalCode);
|
||||
size_t bytesRequiredForCodeLength(unsigned char threeBitCodes);
|
||||
int branchIndexWithDescendant(const unsigned char* ancestorOctalCode, const unsigned char* descendantOctalCode);
|
||||
unsigned char* childOctalCode(const unsigned char* parentOctalCode, char childNumber);
|
||||
unsigned char* childOctalCode(const unsigned char* parentOctalCode, int childNumber);
|
||||
|
||||
const int OVERFLOWED_OCTCODE_BUFFER = -1;
|
||||
const int UNKNOWN_OCTCODE_LENGTH = -2;
|
||||
|
|
|
@ -1618,8 +1618,18 @@ SelectionDisplay = (function() {
|
|||
grid.snapToGrid(Vec3.sum(cornerPosition, vector), constrainMajorOnly),
|
||||
cornerPosition);
|
||||
|
||||
for (var i = 0; i < SelectionManager.selections.length; i++) {
|
||||
var properties = SelectionManager.savedProperties[SelectionManager.selections[i]];
|
||||
// editing a parent will cause all the children to automatically follow along, so don't
|
||||
// edit any entity who has an ancestor in SelectionManager.selections
|
||||
var toMove = SelectionManager.selections.filter(function (selection) {
|
||||
if (SelectionManager.selections.indexOf(SelectionManager.savedProperties[selection].parentID) >= 0) {
|
||||
return false; // a parent is also being moved, so don't issue an edit for this entity
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
for (var i = 0; i < toMove.length; i++) {
|
||||
var properties = SelectionManager.savedProperties[toMove[i]];
|
||||
if (!properties) {
|
||||
continue;
|
||||
}
|
||||
|
@ -1628,7 +1638,7 @@ SelectionDisplay = (function() {
|
|||
y: 0,
|
||||
z: vector.z
|
||||
});
|
||||
Entities.editEntity(SelectionManager.selections[i], {
|
||||
Entities.editEntity(toMove[i], {
|
||||
position: newPosition
|
||||
});
|
||||
|
||||
|
@ -1727,9 +1737,19 @@ SelectionDisplay = (function() {
|
|||
Vec3.print(" newIntersection:", newIntersection);
|
||||
Vec3.print(" vector:", vector);
|
||||
}
|
||||
|
||||
for (var i = 0; i < SelectionManager.selections.length; i++) {
|
||||
var id = SelectionManager.selections[i];
|
||||
|
||||
// editing a parent will cause all the children to automatically follow along, so don't
|
||||
// edit any entity who has an ancestor in SelectionManager.selections
|
||||
var toMove = SelectionManager.selections.filter(function (selection) {
|
||||
if (SelectionManager.selections.indexOf(SelectionManager.savedProperties[selection].parentID) >= 0) {
|
||||
return false; // a parent is also being moved, so don't issue an edit for this entity
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
for (var i = 0; i < toMove.length; i++) {
|
||||
var id = toMove[i];
|
||||
var properties = SelectionManager.savedProperties[id];
|
||||
var newPosition = Vec3.sum(properties.position, vector);
|
||||
Entities.editEntity(id, { position: newPosition });
|
||||
|
@ -2166,8 +2186,19 @@ SelectionDisplay = (function() {
|
|||
// the selections center point. Otherwise, the rotation will be around the entities
|
||||
// registration point which does not need repositioning.
|
||||
var reposition = (SelectionManager.selections.length > 1);
|
||||
for (var i = 0; i < SelectionManager.selections.length; i++) {
|
||||
var entityID = SelectionManager.selections[i];
|
||||
|
||||
// editing a parent will cause all the children to automatically follow along, so don't
|
||||
// edit any entity who has an ancestor in SelectionManager.selections
|
||||
var toRotate = SelectionManager.selections.filter(function (selection) {
|
||||
if (SelectionManager.selections.indexOf(SelectionManager.savedProperties[selection].parentID) >= 0) {
|
||||
return false; // a parent is also being moved, so don't issue an edit for this entity
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
for (var i = 0; i < toRotate.length; i++) {
|
||||
var entityID = toRotate[i];
|
||||
var initialProperties = SelectionManager.savedProperties[entityID];
|
||||
|
||||
var newProperties = {
|
||||
|
|
Loading…
Reference in a new issue