mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-18 09:35:50 +00:00
fix(protocols/terraria): add missing maxplayers (and raw) to terraria protocol (#686)
* Add maxplayers to terraria protocol * Update CHANGELOG.md * Add raw to terraria state It returns multiple versions, so instead of choosing one I decided to do this. * Update CHANGELOG.md
This commit is contained in:
parent
1458aa0e36
commit
58f045dd36
2 changed files with 4 additions and 0 deletions
|
|
@ -13,6 +13,8 @@ export default class terraria extends Core {
|
|||
|
||||
if (json.status !== '200') throw new Error('Invalid status')
|
||||
|
||||
state.raw = json
|
||||
|
||||
for (const one of json.players) {
|
||||
state.players.push({ name: one.nickname, team: one.team })
|
||||
}
|
||||
|
|
@ -20,5 +22,6 @@ export default class terraria extends Core {
|
|||
state.name = json.name
|
||||
state.gamePort = json.port
|
||||
state.numplayers = json.playercount
|
||||
state.maxplayers = json.maxplayers
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue