mirror of
https://github.com/YGGverse/HLState.git
synced 2026-03-31 17:15:39 +00:00
show real connections in players count
This commit is contained in:
parent
13292efe29
commit
becb46d1bc
4 changed files with 20 additions and 6 deletions
|
|
@ -102,7 +102,9 @@ class MainController extends AbstractController
|
|||
'online' => $server->getOnline(),
|
||||
'info' => $info,
|
||||
'status' => $status,
|
||||
'sort' => empty($info['Players']) ? 0 : (int) $info['Players']
|
||||
'connections' => is_null($info['Players']) || $info['Players'] < 0 || is_null($info['Bots']) || $info['Bots'] < 0
|
||||
? 0
|
||||
: (int) $info['Players'] - (int) $info['Bots']
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -110,7 +112,7 @@ class MainController extends AbstractController
|
|||
array_multisort(
|
||||
array_column(
|
||||
$servers,
|
||||
'sort'
|
||||
'connections'
|
||||
),
|
||||
SORT_DESC,
|
||||
$servers
|
||||
|
|
|
|||
|
|
@ -175,7 +175,10 @@ class ServerController extends AbstractController
|
|||
'session' => $session,
|
||||
'online' => $online,
|
||||
'players' => $players,
|
||||
'status' => $status
|
||||
'status' => $status,
|
||||
'connections' => is_null($info['Players']) || $info['Players'] < 0 || is_null($info['Bots']) || $info['Bots'] < 0
|
||||
? 0
|
||||
: (int) $info['Players'] - (int) $info['Bots']
|
||||
]
|
||||
]
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue