mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-18 09:40:38 +01:00
22 lines
663 B
JavaScript
22 lines
663 B
JavaScript
const Gamespy3 = require('./gamespy3');
|
|
|
|
// supposedly, gamespy3 is the "official" query protocol for jcmp,
|
|
// but it's broken (requires useOnlySingleSplit), and may not include some player names
|
|
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)) {
|
|
for(let i = 0; i < parseInt(state.raw.numplayers); i++) {
|
|
state.players.push({});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = Jc2mp;
|