fix: Use cp tag for accurate rust player count (#663)

* Use cp tag for accurate rust playercount

* Add changelog entry
This commit is contained in:
James Causon 2025-01-04 21:03:49 +00:00 committed by GitHub
parent d834c8091d
commit 0ad23aa1a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -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).

View file

@ -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
}
}
}
}
}