mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-17 17:25:19 +01:00
Parse additional dayz tags: first person, dlc enabled and time
This commit is contained in:
parent
a8b7cad002
commit
f3d97b6ca1
1 changed files with 14 additions and 2 deletions
|
@ -261,10 +261,11 @@ class Valve extends Core {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// DayZ embeds some of the server information inside the tags attribute
|
||||||
if (appId === AppId.DayZ) {
|
if (appId === AppId.DayZ) {
|
||||||
state.raw.dayzMods = this.readDayzMods(Buffer.from(dayZPayload));
|
|
||||||
|
|
||||||
if (state.raw.tags) {
|
if (state.raw.tags) {
|
||||||
|
state.raw.dlcEnabled = false
|
||||||
|
state.raw.firstPerson = false
|
||||||
for (const tag of state.raw.tags) {
|
for (const tag of state.raw.tags) {
|
||||||
if (tag.startsWith('lqs')) {
|
if (tag.startsWith('lqs')) {
|
||||||
const value = parseInt(tag.replace('lqs', ''));
|
const value = parseInt(tag.replace('lqs', ''));
|
||||||
|
@ -272,6 +273,15 @@ class Valve extends Core {
|
||||||
state.raw.queue = 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')) {
|
if (tag.startsWith('etm')) {
|
||||||
const value = parseInt(tag.replace('etm', ''));
|
const value = parseInt(tag.replace('etm', ''));
|
||||||
if (!isNaN(value)) {
|
if (!isNaN(value)) {
|
||||||
|
@ -286,6 +296,8 @@ class Valve extends Core {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state.raw.dayzMods = this.readDayzMods(Buffer.from(dayZPayload));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue