mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 16:55:06 +02:00
Only count users against max capacity
This commit is contained in:
parent
76940bad34
commit
b280eebd03
1 changed files with 7 additions and 3 deletions
|
@ -715,9 +715,13 @@ void DomainServer::processListRequestPacket(QSharedPointer<ReceivedMessage> mess
|
|||
unsigned int DomainServer::countConnectedUsers() {
|
||||
unsigned int result = 0;
|
||||
auto nodeList = DependencyManager::get<LimitedNodeList>();
|
||||
nodeList->eachNode([&](const SharedNodePointer& otherNode){
|
||||
if (otherNode->getType() == NodeType::Agent) {
|
||||
result++;
|
||||
nodeList->eachNode([&](const SharedNodePointer& node){
|
||||
// only count unassigned agents (i.e., users)
|
||||
if (node->getType() == NodeType::Agent) {
|
||||
auto nodeData = static_cast<DomainServerNodeData*>(node->getLinkedData());
|
||||
if (nodeData && !nodeData->wasAssigned()) {
|
||||
result++;
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue