mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-17 17:25:19 +01:00
#85 Fallback to limited player details if csgo doesn't respond with player packet
This commit is contained in:
parent
49829ddc8c
commit
69614c606c
1 changed files with 12 additions and 0 deletions
|
@ -187,6 +187,18 @@ class Valve extends require('./core') {
|
|||
}
|
||||
|
||||
c();
|
||||
}, () => {
|
||||
// no players were returned after timeout --
|
||||
// csgo seems to do this sometimes if host_players_show is not 2
|
||||
if (this.isCsGo) {
|
||||
if(this.debug) console.log("CSGO server didn't respond with player list");
|
||||
state.players = [];
|
||||
for(let i = 0; i < state.raw.numplayers; i++) {
|
||||
state.players.push({});
|
||||
}
|
||||
c();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue