fix: player info page shows 'not connected' for online players
SteamID from RCON JSON is parsed as a Number, but the URL param from the regex match is a string. Strict === comparison always fails. Changed to String() coercion so types match. Also fixes subtle issue with large SteamID64 values exceeding MAX_SAFE_INTEGER — string comparison avoids precision loss. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -31,7 +31,7 @@ function PlayerInfoPage(params, container) {
|
||||
Rcon.getPlayers(function (players) {
|
||||
var info = null;
|
||||
for (var i = 0; i < players.length; i++) {
|
||||
if (players[i].SteamID === userid) { info = players[i]; break; }
|
||||
if (String(players[i].SteamID) === userid) { info = players[i]; break; }
|
||||
}
|
||||
|
||||
if (!info) {
|
||||
|
||||
Reference in New Issue
Block a user