mirror of
https://github.com/tribufu/node-gamedig
synced 2026-06-01 09:42:41 +00: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
|
### 2.0.22
|
||||||
* Updated dependencies
|
* Updated dependencies
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"author": "GameDig Contributors",
|
"author": "GameDig Contributors",
|
||||||
"version": "2.0.22",
|
"version": "2.0.23",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/gamedig/node-gamedig.git"
|
"url": "https://github.com/gamedig/node-gamedig.git"
|
||||||
|
|
|
||||||
|
|
@ -113,10 +113,9 @@ class Valve extends Core {
|
||||||
) {
|
) {
|
||||||
this._skipSizeInSplitHeader = true;
|
this._skipSizeInSplitHeader = true;
|
||||||
}
|
}
|
||||||
this.debugLog("STEAM APPID: "+state.raw.steamappid);
|
this.logger.debug("INFO: ", state.raw);
|
||||||
this.debugLog("PROTOCOL: "+state.raw.protocol);
|
|
||||||
if(state.raw.protocol === 48) {
|
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;
|
this.goldsrcSplits = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -139,19 +138,22 @@ class Valve extends Core {
|
||||||
async queryPlayers(state) {
|
async queryPlayers(state) {
|
||||||
state.raw.players = [];
|
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 ...");
|
this.debugLog("Requesting player list ...");
|
||||||
const b = await this.sendPacket(
|
const b = await this.sendPacket(
|
||||||
0x55,
|
0x55,
|
||||||
true,
|
true,
|
||||||
null,
|
null,
|
||||||
0x44,
|
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 reader = this.reader(b);
|
||||||
const num = reader.uint(1);
|
const num = reader.uint(1);
|
||||||
|
|
@ -179,7 +181,7 @@ class Valve extends Core {
|
||||||
state.raw.rules = {};
|
state.raw.rules = {};
|
||||||
this.debugLog("Requesting rules ...");
|
this.debugLog("Requesting rules ...");
|
||||||
const b = await this.sendPacket(0x56,true,null,0x45,true);
|
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 reader = this.reader(b);
|
||||||
const num = reader.uint(2);
|
const num = reader.uint(2);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue