4.0.1 Fix maxplayers >255 in rust
This commit is contained in:
parent
7837351f9f
commit
343e23c4ad
|
@ -1,3 +1,7 @@
|
||||||
|
### 4.0.1
|
||||||
|
* Rust - Fixed maxplayers >255
|
||||||
|
* dayZ - Fixed tag info not parsing when queryRules wasn't set
|
||||||
|
|
||||||
### 4.0.0
|
### 4.0.0
|
||||||
|
|
||||||
#### Breaking Changes
|
#### Breaking Changes
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
],
|
],
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"author": "GameDig Contributors",
|
"author": "GameDig Contributors",
|
||||||
"version": "4.0.0",
|
"version": "4.0.1",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/gamedig/node-gamedig.git"
|
"url": "https://github.com/gamedig/node-gamedig.git"
|
||||||
|
|
|
@ -7,7 +7,8 @@ const AppId = {
|
||||||
Squad: 393380,
|
Squad: 393380,
|
||||||
Bat1944: 489940,
|
Bat1944: 489940,
|
||||||
Ship: 2400,
|
Ship: 2400,
|
||||||
DayZ: 221100
|
DayZ: 221100,
|
||||||
|
Rust: 252490
|
||||||
};
|
};
|
||||||
|
|
||||||
class Valve extends Core {
|
class Valve extends Core {
|
||||||
|
@ -116,6 +117,8 @@ class Valve extends Core {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const appId = state.raw.appId;
|
||||||
|
|
||||||
// from https://developer.valvesoftware.com/wiki/Server_queries
|
// from https://developer.valvesoftware.com/wiki/Server_queries
|
||||||
if(
|
if(
|
||||||
state.raw.protocol === 7 && (
|
state.raw.protocol === 7 && (
|
||||||
|
@ -132,6 +135,56 @@ class Valve extends Core {
|
||||||
this.logger.debug("GOLDSRC DETECTED - USING MODIFIED SPLIT FORMAT");
|
this.logger.debug("GOLDSRC DETECTED - USING MODIFIED SPLIT FORMAT");
|
||||||
this.goldsrcSplits = true;
|
this.goldsrcSplits = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DayZ embeds some of the server information inside the tags attribute
|
||||||
|
if (appId === AppId.DayZ) {
|
||||||
|
if (state.raw.tags) {
|
||||||
|
state.raw.dlcEnabled = false
|
||||||
|
state.raw.firstPerson = false
|
||||||
|
for (const tag of state.raw.tags) {
|
||||||
|
if (tag.startsWith('lqs')) {
|
||||||
|
const value = parseInt(tag.replace('lqs', ''));
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
state.raw.queue = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tag.includes('no3rd')) {
|
||||||
|
state.raw.firstPerson = true;
|
||||||
|
}
|
||||||
|
if (tag.includes('isDLC')) {
|
||||||
|
state.raw.dlcEnabled = true;
|
||||||
|
}
|
||||||
|
if (tag.includes(':')) {
|
||||||
|
state.raw.time = tag;
|
||||||
|
}
|
||||||
|
if (tag.startsWith('etm')) {
|
||||||
|
const value = parseInt(tag.replace('etm', ''));
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
state.raw.dayAcceleration = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tag.startsWith('entm')) {
|
||||||
|
const value = parseInt(tag.replace('entm', ''));
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
state.raw.nightAcceleration = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (appId === AppId.Rust) {
|
||||||
|
if (state.raw.tags) {
|
||||||
|
for (const tag of state.raw.tags) {
|
||||||
|
if (tag.startsWith('mp')) {
|
||||||
|
const value = parseInt(tag.replace('mp', ''));
|
||||||
|
if (!isNaN(value)) {
|
||||||
|
state.maxplayers = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async queryChallenge() {
|
async queryChallenge() {
|
||||||
|
@ -262,42 +315,7 @@ class Valve extends Core {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// DayZ embeds some of the server information inside the tags attribute
|
|
||||||
if (appId === AppId.DayZ) {
|
if (appId === AppId.DayZ) {
|
||||||
if (state.raw.tags) {
|
|
||||||
state.raw.dlcEnabled = false
|
|
||||||
state.raw.firstPerson = false
|
|
||||||
for (const tag of state.raw.tags) {
|
|
||||||
if (tag.startsWith('lqs')) {
|
|
||||||
const value = parseInt(tag.replace('lqs', ''));
|
|
||||||
if (!isNaN(value)) {
|
|
||||||
state.raw.queue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (tag.includes('no3rd')) {
|
|
||||||
state.raw.firstPerson = true;
|
|
||||||
}
|
|
||||||
if (tag.includes('isDLC')) {
|
|
||||||
state.raw.dlcEnabled = true;
|
|
||||||
}
|
|
||||||
if (tag.includes(':')) {
|
|
||||||
state.raw.time = tag;
|
|
||||||
}
|
|
||||||
if (tag.startsWith('etm')) {
|
|
||||||
const value = parseInt(tag.replace('etm', ''));
|
|
||||||
if (!isNaN(value)) {
|
|
||||||
state.raw.dayAcceleration = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (tag.startsWith('entm')) {
|
|
||||||
const value = parseInt(tag.replace('entm', ''));
|
|
||||||
if (!isNaN(value)) {
|
|
||||||
state.raw.nightAcceleration = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
state.raw.dayzMods = this.readDayzMods(Buffer.from(dayZPayload));
|
state.raw.dayzMods = this.readDayzMods(Buffer.from(dayZPayload));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue