From 9b9277172dc6011bafdc12fe2b99b262129adf28 Mon Sep 17 00:00:00 2001 From: mmorrison Date: Sun, 11 Nov 2018 06:12:44 -0600 Subject: [PATCH] Export all minecraft json in raw object. Use modern minecraftping for all minecraft queries. --- games.txt | 6 ++++-- protocols/{minecraftping.js => minecraft.js} | 7 +++---- 2 files changed, 7 insertions(+), 6 deletions(-) rename protocols/{minecraftping.js => minecraft.js} (93%) diff --git a/games.txt b/games.txt index 8af8880..3957f05 100644 --- a/games.txt +++ b/games.txt @@ -168,9 +168,11 @@ mohbt|Medal of Honor: Breakthrough|gamespy1|port=12203,port_query_offset=97 moh2010|Medal of Honor 2010|battlefield|port=7673,port_query=48888 mohwf|Medal of Honor: Warfighter|battlefield|port=25200,port_query_offset=22000 -minecraft|Minecraft|gamespy3|port=25565,maxAttempts=2|srvRecord=_minecraft._tcp,doc_notes=minecraft +minecraft|Minecraft|minecraft|port=25565|srvRecord=_minecraft._tcp,doc_notes=minecraft +# Legacy name +minecraftping|Minecraft|minecraft|port=25565|srvRecord=_minecraft._tcp,doc_notes=minecraft + minecraftpe|Minecraft: Pocket Edition|gamespy3|port=19132,maxAttempts=2 -minecraftping|Minecraft|minecraftping|port=25565|srvRecord=_minecraft._tcp,doc_notes=minecraft mnc|Monday Night Combat|valve|port=7777,port_query=27016 mtavc|Multi Theft Auto: Vice City|ase|port=22003,port_query_offset=123 mtasa|Multi Theft Auto: San Andreas|ase|port=22003,port_query_offset=123 diff --git a/protocols/minecraftping.js b/protocols/minecraft.js similarity index 93% rename from protocols/minecraftping.js rename to protocols/minecraft.js index 543035b..f8719f9 100644 --- a/protocols/minecraftping.js +++ b/protocols/minecraft.js @@ -14,7 +14,7 @@ function buildPacket(id,data) { ]); } -class MinecraftPing extends require('./core') { +class Minecraft extends require('./core') { run(state) { let receivedData; @@ -75,9 +75,8 @@ class MinecraftPing extends require('./core') { return this.fatal('Invalid JSON'); } - state.raw.version = json.version.name; + state.raw = json; state.maxplayers = json.players.max; - state.raw.description = json.description.text; if(json.players.sample) { for(const player of json.players.sample) { state.players.push({ @@ -96,4 +95,4 @@ class MinecraftPing extends require('./core') { } } -module.exports = MinecraftPing; +module.exports = Minecraft;