#85 Fallback to limited player details if csgo doesn't respond with player packet

This commit is contained in:
mmorrison 2018-05-05 02:45:58 -05:00
parent 49829ddc8c
commit 69614c606c
1 changed files with 12 additions and 0 deletions

View File

@ -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;
}
});
}