Browse Source

add server limits config

main
ghost 10 months ago
parent
commit
79d70e4a9d
  1. 4
      .env
  2. 2
      config/services.yaml
  3. 4
      src/Controller/ServerController.php

4
.env

@ -56,6 +56,10 @@ APP_META_KEYWORDS="Half-Life, HLState, YGGverse, Servers, Stats, Online, Analyti @@ -56,6 +56,10 @@ APP_META_KEYWORDS="Half-Life, HLState, YGGverse, Servers, Stats, Online, Analyti
# Application template
APP_THEME="default"
# Server info configuration
APP_SERVER_ONLINE_LIMIT=10
APP_SERVER_PLAYERS_LIMIT=10
# Masters list, server:port comma separated
APP_MASTERS=""

2
config/services.yaml

@ -12,6 +12,8 @@ parameters: @@ -12,6 +12,8 @@ parameters:
app.meta.title: '%env(APP_META_TITLE)%'
app.meta.description: '%env(APP_META_DESCRIPTION)%'
app.meta.keywords: '%env(APP_META_KEYWORDS)%'
app.server.online.limit: '%env(APP_SERVER_ONLINE_LIMIT)%'
app.server.players.limit: '%env(APP_SERVER_PLAYERS_LIMIT)%'
services:
# default configuration for services in *this* file

4
src/Controller/ServerController.php

@ -81,7 +81,7 @@ class ServerController extends AbstractController @@ -81,7 +81,7 @@ class ServerController extends AbstractController
'crc32server' => $server->getCrc32server()
],
'online' == $request->get('sort') ? [$field => $order] : ['time' => 'DESC'],
10
$this->getParameter('app.server.online.limit')
);
// Get players
@ -90,7 +90,7 @@ class ServerController extends AbstractController @@ -90,7 +90,7 @@ class ServerController extends AbstractController
'crc32server' => $server->getCrc32server()
],
'players' == $request->get('sort') ? [$field => $order] : ['frags' => 'DESC'],
10
$this->getParameter('app.server.players.limit')
);
// Format address

Loading…
Cancel
Save