mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-10-07 17:27:25 +02:00
93a9095d99
* Add initial prettier and eslint configs * Modify prettierrc * Run eslint on everything * Actually remove prettier * Fix some eslints * Remove label in gs2 * Update CHANGELOG * Update eslintrc to specify es2021
20 lines
566 B
JavaScript
20 lines
566 B
JavaScript
import gamespy3 from './gamespy3.js'
|
|
|
|
// supposedly, gamespy3 is the "official" query protocol for jcmp,
|
|
// but it's broken (requires useOnlySingleSplit), and may not include some player names
|
|
export default class jc2mp extends gamespy3 {
|
|
constructor () {
|
|
super()
|
|
this.useOnlySingleSplit = true
|
|
this.isJc2mp = true
|
|
this.encoding = 'utf8'
|
|
}
|
|
|
|
async run (state) {
|
|
await super.run(state)
|
|
if (!state.players.length && parseInt(state.raw.numplayers)) {
|
|
state.players.setNum(parseInt(state.raw.numplayers))
|
|
}
|
|
}
|
|
}
|