mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
More async conversion
This commit is contained in:
parent
484e99b29c
commit
efe12a00aa
25 changed files with 774 additions and 858 deletions
|
|
@ -1,15 +1,16 @@
|
|||
const Gamespy3 = require('./gamespy3');
|
||||
|
||||
// supposedly, gamespy3 is the "official" query protocol for jcmp,
|
||||
// but it's broken (requires useOnlySingleSplit), and doesn't include player names
|
||||
// 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) {
|
||||
super.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({});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue