mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-17 17:25:19 +01:00
Always treat missing valve player response as non-fatal (2.0.23)
This commit is contained in:
parent
b7c277f042
commit
81a3ec1019
3 changed files with 17 additions and 11 deletions
|
@ -1,3 +1,7 @@
|
|||
### 2.0.23
|
||||
* Fix Conan Exiles and other games which don't respond to the valve player query
|
||||
* Add givenPortOnly query option for users that require extreme optimization
|
||||
|
||||
### 2.0.22
|
||||
* Updated dependencies
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
],
|
||||
"main": "lib/index.js",
|
||||
"author": "GameDig Contributors",
|
||||
"version": "2.0.22",
|
||||
"version": "2.0.23",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/gamedig/node-gamedig.git"
|
||||
|
|
|
@ -113,10 +113,9 @@ class Valve extends Core {
|
|||
) {
|
||||
this._skipSizeInSplitHeader = true;
|
||||
}
|
||||
this.debugLog("STEAM APPID: "+state.raw.steamappid);
|
||||
this.debugLog("PROTOCOL: "+state.raw.protocol);
|
||||
this.logger.debug("INFO: ", state.raw);
|
||||
if(state.raw.protocol === 48) {
|
||||
this.debugLog("GOLDSRC DETECTED - USING MODIFIED SPLIT FORMAT");
|
||||
this.logger.debug("GOLDSRC DETECTED - USING MODIFIED SPLIT FORMAT");
|
||||
this.goldsrcSplits = true;
|
||||
}
|
||||
}
|
||||
|
@ -139,19 +138,22 @@ class Valve extends Core {
|
|||
async queryPlayers(state) {
|
||||
state.raw.players = [];
|
||||
|
||||
// CSGO doesn't even respond sometimes if host_players_show is not 2
|
||||
// Ignore timeouts in only this case
|
||||
const allowTimeout = state.raw.steamappid === 730;
|
||||
|
||||
this.debugLog("Requesting player list ...");
|
||||
const b = await this.sendPacket(
|
||||
0x55,
|
||||
true,
|
||||
null,
|
||||
0x44,
|
||||
allowTimeout
|
||||
true
|
||||
);
|
||||
if (b === null) return; // timed out
|
||||
|
||||
if (b === null) {
|
||||
// Player query timed out
|
||||
// CSGO doesn't respond to player query if host_players_show is not 2
|
||||
// Conan Exiles never responds to player query
|
||||
// Just skip it, and we'll fill with dummy objects in cleanup()
|
||||
return;
|
||||
}
|
||||
|
||||
const reader = this.reader(b);
|
||||
const num = reader.uint(1);
|
||||
|
@ -179,7 +181,7 @@ class Valve extends Core {
|
|||
state.raw.rules = {};
|
||||
this.debugLog("Requesting rules ...");
|
||||
const b = await this.sendPacket(0x56,true,null,0x45,true);
|
||||
if (b === null) return; // timed out - the server probably just has rules disabled
|
||||
if (b === null) return; // timed out - the server probably has rules disabled
|
||||
|
||||
const reader = this.reader(b);
|
||||
const num = reader.uint(2);
|
||||
|
|
Loading…
Reference in a new issue