mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-17 17:25:19 +01:00
Adjusted Terraria protocol to check the "status" property for string "200" rather than integer 200.
I am not sure if the TShock API changed this recently or what, but it returns a string in the current version (4.3.26 for Terraria 1.3.5.3), and comparing it to an integer was incorrectly causing an "Invalid status" error.
This commit is contained in:
parent
1d8088665b
commit
708988213f
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ class Terraria extends Core {
|
||||||
});
|
});
|
||||||
|
|
||||||
const json = JSON.parse(body);
|
const json = JSON.parse(body);
|
||||||
if(json.status !== 200) throw new Error('Invalid status');
|
if(json.status !== '200') throw new Error('Invalid status');
|
||||||
|
|
||||||
for (const one of json.players) {
|
for (const one of json.players) {
|
||||||
state.players.push({name:one.nickname,team:one.team});
|
state.players.push({name:one.nickname,team:one.team});
|
||||||
|
|
Loading…
Reference in a new issue