mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 00:13:53 +02:00
Merge pull request #7980 from zzmp/fix/max-capacity
fix domain max capacity to only count users (not scripted agents)
This commit is contained in:
commit
281c257d25
2 changed files with 8 additions and 4 deletions
|
@ -111,7 +111,7 @@
|
|||
{
|
||||
"name": "maximum_user_capacity",
|
||||
"label": "Maximum User Capacity",
|
||||
"help": "The limit on how many avatars can be connected at once. 0 means no limit.",
|
||||
"help": "The limit on how many users can be connected at once (0 means no limit). Avatars connected from the same machine will not count towards this limit.",
|
||||
"placeholder": "0",
|
||||
"default": "0",
|
||||
"advanced": false
|
||||
|
|
|
@ -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