feat: add more data for dayz state (#450)

This commit is contained in:
Pedro Ivo Hudson 2024-01-07 18:04:16 -03:00 committed by GitHub
parent 30581bd868
commit 09e4281edb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -62,6 +62,10 @@ export default class dayz extends valve {
state.raw.dlcEnabled = false
state.raw.firstPerson = false
state.raw.privateHive = false
state.raw.external = false
state.raw.official = false
for (const tag of state.raw.tags) {
if (tag.startsWith('lqs')) {
const value = parseInt(tag.replace('lqs', ''))
@ -75,6 +79,12 @@ export default class dayz extends valve {
if (tag.includes('isDLC')) {
state.raw.dlcEnabled = true
}
if (tag.includes('privHive')) {
state.raw.privateHive = true;
}
if (tag.includes('external')) {
state.raw.external = true;
}
if (tag.includes(':')) {
state.raw.time = tag
}
@ -91,6 +101,10 @@ export default class dayz extends valve {
}
}
}
if (!state.raw.external && !state.raw.privateHive) {
state.raw.official = true
}
}
readDayzMods (/** Buffer */ buffer) {