Ok, maybe this time itll work
This commit is contained in:
parent
64df6f0c83
commit
a2622fed35
37
index.js
37
index.js
|
@ -106,19 +106,29 @@ function splitKeyword(keyword) {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// 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
|
// 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) {
|
switch (data.length) {
|
||||||
return {
|
case 1:
|
||||||
"version": data[0],
|
return {
|
||||||
"raw": keyword
|
"version": data[0]
|
||||||
}
|
}
|
||||||
} else {
|
break;
|
||||||
return {
|
case 2: // Only version and DLC
|
||||||
"version": data[0],
|
return {
|
||||||
dlcString,
|
"version": data[0],
|
||||||
dlc: data[1],
|
dlcString,
|
||||||
"tps": data[2],
|
dlc: data[1]
|
||||||
"raw": keyword
|
}
|
||||||
}
|
break;
|
||||||
|
case 3: // Version, DLC and TPS
|
||||||
|
return {
|
||||||
|
"version": data[0],
|
||||||
|
dlcString,
|
||||||
|
dlc: data[1],
|
||||||
|
"tps": data[2]
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -198,7 +208,6 @@ function checkServer(address) {
|
||||||
"outdated": data.serverInfo.version < serverList.highestVersion ? true : false,
|
"outdated": data.serverInfo.version < serverList.highestVersion ? true : false,
|
||||||
"dlc": data.serverInfo.dlc,
|
"dlc": data.serverInfo.dlc,
|
||||||
"dlcString": data.serverInfo.dlcString,
|
"dlcString": data.serverInfo.dlcString,
|
||||||
"rawKWData": data.keywords,
|
|
||||||
"tps": data.serverInfo.tps,
|
"tps": data.serverInfo.tps,
|
||||||
"players": data.bots,
|
"players": data.bots,
|
||||||
"maxPlayers": data.maxPlayers,
|
"maxPlayers": data.maxPlayers,
|
||||||
|
|
Loading…
Reference in a new issue