Add isReplicant to Node

This commit is contained in:
Ryan Huffman 2017-06-12 11:49:48 -07:00
parent dc7c331d4c
commit ff2800e8d5
3 changed files with 11 additions and 0 deletions

View file

@ -2211,6 +2211,11 @@ void DomainServer::refreshStaticAssignmentAndAddToQueue(SharedAssignmentPointer&
}
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
node->setLinkedData(std::unique_ptr<DomainServerNodeData> { new DomainServerNodeData() });
}

View file

@ -135,6 +135,7 @@ QDataStream& operator<<(QDataStream& out, const Node& node) {
out << node._publicSocket;
out << node._localSocket;
out << node._permissions;
out << node._isReplicant;
return out;
}
@ -144,6 +145,7 @@ QDataStream& operator>>(QDataStream& in, Node& node) {
in >> node._publicSocket;
in >> node._localSocket;
in >> node._permissions;
in >> node._isReplicant;
return in;
}

View file

@ -48,6 +48,9 @@ public:
char getType() const { return _type; }
void setType(char type);
bool isReplicant() const { return _isReplicant; }
void setIsReplicant(bool isReplicant) { _isReplicant = isReplicant; }
const QUuid& getConnectionSecret() const { return _connectionSecret; }
void setConnectionSecret(const QUuid& connectionSecret) { _connectionSecret = connectionSecret; }
@ -89,6 +92,7 @@ private:
Node& operator=(Node otherNode);
NodeType_t _type;
bool _isReplicant { false };
QUuid _connectionSecret;
std::unique_ptr<NodeData> _linkedData;