fix(protocol/battlefield): detect BFBC2 Vietnam DLC as BFBC2 (#713)

closes #712
This commit is contained in:
cetteup 2025-06-16 20:58:33 +02:00 committed by GitHub
parent 96c8e725d8
commit bab3452047
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -1,6 +1,7 @@
## To Be Released...
## 5.X.Y
* Fix: detect BFBC2 Vietnam DLC as BFBC2 (By @cetteup #713)
## 5.3.1
* Fix: HTTP requests would end up making more retries than needed due to got's internal retry mechanism (#690, thanks @RattleSN4K3)

View file

@ -39,7 +39,8 @@ export default class battlefield extends Core {
if (data.length) state.raw.uptime = parseInt(data.shift())
if (data.length) state.raw.roundtime = parseInt(data.shift())
const isBadCompany2 = data[0] === 'BC2'
// If this is a Bad Company 2 server, the next field will indicate the "gameMod" followed by an unknown field
const isBadCompany2 = data[0] === 'BC2' || data[0] === 'VIETNAM'
if (isBadCompany2) {
if (data.length) data.shift()
if (data.length) data.shift()