diff --git a/docker-compose.yml b/docker-compose.yml index 4f541de..74b14e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -107,6 +107,7 @@ services: # - BFHQ_HIDE_HIDDEN_PLAYERS=false # - BFHQ_HIDE_PIDS_START=1 # - BFHQ_HIDE_PIDS_END=999999999 + # - BFHQ_PIDS_AS_NAMES=false - DEBUG_LVL=2 volumes: - ./src/ASP:/src/ASP diff --git a/src/ASP/frontend/views/editconfig.tpl b/src/ASP/frontend/views/editconfig.tpl index 680590a..6e84831 100644 --- a/src/ASP/frontend/views/editconfig.tpl +++ b/src/ASP/frontend/views/editconfig.tpl @@ -187,6 +187,15 @@ /> +
+ +
+ +
+

Global Game Server Configuration

diff --git a/src/ASP/getleaderboard.aspx b/src/ASP/getleaderboard.aspx index 8c9011f..1b63ea2 100644 --- a/src/ASP/getleaderboard.aspx +++ b/src/ASP/getleaderboard.aspx @@ -131,7 +131,7 @@ else while($row = $result->fetch()) { $plpid = $row['id']; - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -151,7 +151,7 @@ else $plpid = $row['id']; if($plpid == $pid) { - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -180,7 +180,7 @@ else while($row = $result->fetch()) { $plpid = $row['id']; - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $cmdtime = $row['cmdtime']; @@ -200,7 +200,7 @@ else $plpid = $row['id']; if($plpid == $pid) { - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $cmdtime = $row['cmdtime']; @@ -229,7 +229,7 @@ else while($row = $result->fetch()) { $plpid = $row['id']; - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -248,7 +248,7 @@ else { $plpid = $row['id']; if ($plpid == $pid) { - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -277,7 +277,7 @@ else while($row = $result->fetch()) { $plpid = $row['id']; - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -298,7 +298,7 @@ else $plpid = $row['id']; if($plpid == $pid) { - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -336,7 +336,7 @@ else while($row = $result->fetch()) { $plpid = $row['id']; - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -361,7 +361,7 @@ else $plpid = $row['id']; if($plpid == $pid) { - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -391,7 +391,7 @@ else while($row = $result->fetch()) { $plpid = $row['plid']; - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -412,7 +412,7 @@ else $plpid = $row['plid']; if($plpid == $pid) { - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -442,7 +442,7 @@ else while($row = $result->fetch()) { $plpid = $row['plid']; - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -463,7 +463,7 @@ else $plpid = $row['plid']; if($plpid == $pid) { - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -494,7 +494,7 @@ else while($row = $result->fetch()) { $plpid = $row['plid']; - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; @@ -516,7 +516,7 @@ else $plpid = $row['plid']; if($plpid == $pid) { - $name = trim($row['name']); + $name = Config::Get('bfhq_pids_as_names') ? $row['id'] : trim($row['name']); $rank = $row['rank']; $country = strtoupper($row['country']); $time = $row['time']; diff --git a/src/ASP/searchforplayers.aspx b/src/ASP/searchforplayers.aspx index 836d6c6..9e71895 100644 --- a/src/ASP/searchforplayers.aspx +++ b/src/ASP/searchforplayers.aspx @@ -92,7 +92,7 @@ else { $num = 1; while($row = $result->fetch()) - $out .= "D\t" . $num++ . "\t" . $row['id'] . "\t" . $row['name'] . "\t" . $row['score'] . "\n"; + $out .= "D\t" . $num++ . "\t" . $row['id'] . "\t" . (Config::Get('bfhq_pids_as_names') ? $row['id'] : $row['name']) . "\t" . $row['score'] . "\n"; } $num = strlen(preg_replace('/[\t\n]/', '', $out)); diff --git a/src/ASP/system/config/config.php b/src/ASP/system/config/config.php index ea63e2a..eaf584d 100644 --- a/src/ASP/system/config/config.php +++ b/src/ASP/system/config/config.php @@ -34,6 +34,7 @@ $bfhq_hide_hidden_players = false; $bfhq_hide_pids_start = 1; $bfhq_hide_pids_end = 999999999; +$bfhq_pids_as_names = false; $debug_lvl = 2; $game_hosts = array('127.0.0.1','192.168.2.0/24','192.168.1.102','192.168.1.110','localhost','::1'); $game_custom_mapid = 700; diff --git a/src/ASP/system/core/Config.php b/src/ASP/system/core/Config.php index 28c1362..fea7ad4 100644 --- a/src/ASP/system/core/Config.php +++ b/src/ASP/system/core/Config.php @@ -86,6 +86,7 @@ private static function getDefault() 'bfhq_hide_hidden_players' => false, 'bfhq_hide_pids_start' => 1, 'bfhq_hide_pids_end' => 999999999, + 'bfhq_pids_as_names' => false, 'debug_lvl' => 2, 'game_hosts' => array('127.0.0.1','192.168.2.0/24','192.168.1.102','192.168.1.110','localhost','::1'), 'game_custom_mapid' => 700,