2014-10-29 08:02:03 +01:00
|
|
|
// supposedly, gamespy3 is the "official" query protocol for jcmp,
|
|
|
|
// but it's broken (requires useOnlySingleSplit), and doesn't include player names
|
2017-08-09 11:05:55 +02:00
|
|
|
class Jc2mp extends require('./gamespy3') {
|
|
|
|
constructor() {
|
|
|
|
super();
|
2014-10-29 08:02:03 +01:00
|
|
|
this.useOnlySingleSplit = true;
|
2017-08-09 11:05:55 +02:00
|
|
|
}
|
|
|
|
finalizeState(state) {
|
|
|
|
super.finalizeState(state);
|
2014-10-29 08:02:03 +01:00
|
|
|
if(!state.players.length && parseInt(state.raw.numplayers)) {
|
2017-08-09 11:05:55 +02:00
|
|
|
for(let i = 0; i < parseInt(state.raw.numplayers); i++) {
|
2014-10-29 08:02:03 +01:00
|
|
|
state.players.push({});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2017-08-09 11:05:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Jc2mp;
|