From 58f045dd362f174647aa5063ba690270500f77b9 Mon Sep 17 00:00:00 2001 From: GoodDays13 <42877449+GoodDays13@users.noreply.github.com> Date: Tue, 22 Apr 2025 16:23:50 -0400 Subject: [PATCH] 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 --- CHANGELOG.md | 1 + protocols/terraria.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0337327..20ad991 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * Docs: Arma Reforger does not provide players data (#680) * Feat: Farming Simulator add response to raw object (#682) * Feat: Renown (2025) - Added support (#684 By @anthonyphysgun) +* Fix: Terraria - add missing supported maxplayers field and raw field (By @GoodDays13 #686) ## 5.2.0 * Fix: Palworld not respecting query output players schema (#666) diff --git a/protocols/terraria.js b/protocols/terraria.js index efbd91b..aa53e4f 100644 --- a/protocols/terraria.js +++ b/protocols/terraria.js @@ -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 } }