From 76393f8c27fd98bc5efe04861f7925019c7a8f39 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 31 Jan 2024 21:22:41 -0700 Subject: [PATCH] Fix version check --- index.js | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 99a2a81..cff612d 100755 --- a/index.js +++ b/index.js @@ -91,19 +91,32 @@ function splitKeyword(keyword) { default: break; } - if (data[0] >= "v1.3.0") { + // if (data[0] >= "v1.3.0") { + // return { + // "version": data[0], + // dlcString, + // dlc: data[1], + // "tps": data[2] + // } + // } else { // For older versions + // console.log(`${colors.magenta(`[DEBUG ${new Date()}]`)} Absolutely ancient server found, ${data}`); + // return { + // "version": data[0], + // "tps": data[1] + // } + // } + // Lets redo this to actually work with v1.10.0 and above, still gotta check because versions older than 1.3 dont have DLC, and wont have the right number of fields + if (data.length < 3) { + return { + "version": data[0] + } + } else { return { "version": data[0], dlcString, dlc: data[1], "tps": data[2] } - } else { // For older versions - console.log(`${colors.magenta(`[DEBUG ${new Date()}]`)} Absolutely ancient server found, ${data}`); - return { - "version": data[0], - "tps": data[1] - } } };