Skip to content

Commit

Permalink
feat: add more data for dayz state (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
podrivo authored Jan 7, 2024
1 parent 30581bd commit 09e4281
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions protocols/dayz.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', ''))
Expand All @@ -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
}
Expand All @@ -91,6 +101,10 @@ export default class dayz extends valve {
}
}
}

if (!state.raw.external && !state.raw.privateHive) {
state.raw.official = true
}
}

readDayzMods (/** Buffer */ buffer) {
Expand Down

0 comments on commit 09e4281

Please sign in to comment.