This commit is contained in:
josh 2023-12-02 21:53:12 -05:00
commit cb2e21ee81
2 changed files with 11 additions and 2 deletions

View File

@ -10,7 +10,6 @@
* Fix `Post Scriptum` not being on the valve protocol.
* Fix `Epic` protocol's `numplayers` not being in the `raw` field.
* Added support for the Minecraft [Better Compatibility Checker](https://www.curseforge.com/minecraft/mc-mods/better-compatibility-checker) Mod.
* ElDewrito (2007) - Added support (by @Sphyrna-029)
### 4.2.0
* Renamed `Counter Strike: 2D` to `CS2D` in [games.txt](games.txt) (why? see [this](https://cs2d.com/faq.php?show=misc_name#misc_name)).

View File

@ -42,7 +42,7 @@ class MinecraftVanilla extends Core {
const str = reader.rest().toString('utf8');
this.debugLog(str);
const json = JSON.parse(str);
const json = JSON.parse(str.substring(0, strLen));
delete json.favicon;
state.raw = json;
@ -63,6 +63,16 @@ class MinecraftVanilla extends Core {
for (let i = state.players.length; i < Math.min(json.players.online, 10000); i++) {
state.players.push({});
}
// Better Compatibility Checker mod support
let bccJson = {}
if (str.length > strLen) {
const bccStr = str.substring(strLen + 1);
bccJson = JSON.parse(bccStr);
}
state.raw.bcc = bccJson;
}
varIntBuffer(num) {