mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 14:08:51 +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",
|
"name": "maximum_user_capacity",
|
||||||
"label": "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",
|
"placeholder": "0",
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"advanced": false
|
"advanced": false
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue