mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
Add isReplicant to Node
This commit is contained in:
parent
dc7c331d4c
commit
ff2800e8d5
3 changed files with 11 additions and 0 deletions
|
@ -2211,6 +2211,11 @@ void DomainServer::refreshStaticAssignmentAndAddToQueue(SharedAssignmentPointer&
|
||||||
}
|
}
|
||||||
|
|
||||||
void DomainServer::nodeAdded(SharedNodePointer node) {
|
void DomainServer::nodeAdded(SharedNodePointer node) {
|
||||||
|
// TODO Check to see if node is in list of replicant nodes
|
||||||
|
if (node->getType() == NodeType::Agent) {
|
||||||
|
node->setIsReplicant(true);
|
||||||
|
}
|
||||||
|
|
||||||
// we don't use updateNodeWithData, so add the DomainServerNodeData to the node here
|
// we don't use updateNodeWithData, so add the DomainServerNodeData to the node here
|
||||||
node->setLinkedData(std::unique_ptr<DomainServerNodeData> { new DomainServerNodeData() });
|
node->setLinkedData(std::unique_ptr<DomainServerNodeData> { new DomainServerNodeData() });
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,6 +135,7 @@ QDataStream& operator<<(QDataStream& out, const Node& node) {
|
||||||
out << node._publicSocket;
|
out << node._publicSocket;
|
||||||
out << node._localSocket;
|
out << node._localSocket;
|
||||||
out << node._permissions;
|
out << node._permissions;
|
||||||
|
out << node._isReplicant;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +145,7 @@ QDataStream& operator>>(QDataStream& in, Node& node) {
|
||||||
in >> node._publicSocket;
|
in >> node._publicSocket;
|
||||||
in >> node._localSocket;
|
in >> node._localSocket;
|
||||||
in >> node._permissions;
|
in >> node._permissions;
|
||||||
|
in >> node._isReplicant;
|
||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,9 @@ public:
|
||||||
char getType() const { return _type; }
|
char getType() const { return _type; }
|
||||||
void setType(char type);
|
void setType(char type);
|
||||||
|
|
||||||
|
bool isReplicant() const { return _isReplicant; }
|
||||||
|
void setIsReplicant(bool isReplicant) { _isReplicant = isReplicant; }
|
||||||
|
|
||||||
const QUuid& getConnectionSecret() const { return _connectionSecret; }
|
const QUuid& getConnectionSecret() const { return _connectionSecret; }
|
||||||
void setConnectionSecret(const QUuid& connectionSecret) { _connectionSecret = connectionSecret; }
|
void setConnectionSecret(const QUuid& connectionSecret) { _connectionSecret = connectionSecret; }
|
||||||
|
|
||||||
|
@ -89,6 +92,7 @@ private:
|
||||||
Node& operator=(Node otherNode);
|
Node& operator=(Node otherNode);
|
||||||
|
|
||||||
NodeType_t _type;
|
NodeType_t _type;
|
||||||
|
bool _isReplicant { false };
|
||||||
|
|
||||||
QUuid _connectionSecret;
|
QUuid _connectionSecret;
|
||||||
std::unique_ptr<NodeData> _linkedData;
|
std::unique_ptr<NodeData> _linkedData;
|
||||||
|
|
Loading…
Reference in a new issue