mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-18 01:30:39 +01:00
18 lines
577 B
JavaScript
18 lines
577 B
JavaScript
// supposedly, gamespy3 is the "official" query protocol for jcmp,
|
|
// but it's broken (requires useOnlySingleSplit), and doesn't include player names
|
|
class Jc2mp extends require('./gamespy3') {
|
|
constructor() {
|
|
super();
|
|
this.useOnlySingleSplit = true;
|
|
}
|
|
finalizeState(state) {
|
|
super.finalizeState(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;
|