Merge pull request #145 from ms4sman/ms4sman-terraria-fix

Adjusted Terraria protocol to check the "status" property for string …
This commit is contained in:
Michael Morrison 2019-10-23 13:06:16 -05:00 committed by GitHub
commit 68e115a64f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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});