From 0e659bd4eb22c2d5cf7e4fc15432c8cdc1af97d1 Mon Sep 17 00:00:00 2001 From: xCausxn Date: Sat, 4 Jan 2025 20:43:01 +0000 Subject: [PATCH 1/2] Use cp tag for accurate rust playercount --- protocols/valve.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/protocols/valve.js b/protocols/valve.js index 30b4fd1a..402cbeaf 100644 --- a/protocols/valve.js +++ b/protocols/valve.js @@ -141,6 +141,12 @@ export default class valve extends Core { state.maxplayers = value } } + if (tag.startsWith('cp')) { + const value = parseInt(tag.replace('cp', '')) + if (!isNaN(value)) { + state.numplayers = value + } + } } } } From 15b7eaa11e2276309e8339a9fb590cc8a2f5a851 Mon Sep 17 00:00:00 2001 From: xCausxn Date: Sat, 4 Jan 2025 20:46:30 +0000 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 478d0763..8a95957f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## To Be Released... ## 5.X.Y +* Fix: Use `cp` tag to get player count on Rust (By @xCausxn #663) ## 5.1.4 * Feat: Replaced `punycode` package usage with `url.domainToASCII` (#630).