Only count users against max capacity

This commit is contained in:
Zach Pomerantz 2016-05-27 11:44:23 -07:00
parent 76940bad34
commit b280eebd03

View file

@ -715,9 +715,13 @@ void DomainServer::processListRequestPacket(QSharedPointer<ReceivedMessage> mess
unsigned int DomainServer::countConnectedUsers() { unsigned int DomainServer::countConnectedUsers() {
unsigned int result = 0; unsigned int result = 0;
auto nodeList = DependencyManager::get<LimitedNodeList>(); auto nodeList = DependencyManager::get<LimitedNodeList>();
nodeList->eachNode([&](const SharedNodePointer& otherNode){ nodeList->eachNode([&](const SharedNodePointer& node){
if (otherNode->getType() == NodeType::Agent) { // only count unassigned agents (i.e., users)
result++; if (node->getType() == NodeType::Agent) {
auto nodeData = static_cast<DomainServerNodeData*>(node->getLinkedData());
if (nodeData && !nodeData->wasAssigned()) {
result++;
}
} }
}); });
return result; return result;