mirror of
https://github.com/gamedig/node-gamedig.git
synced 2024-11-16 00:38:31 +01:00
feat: add support for the minecraft BCC mod (#429)
This commit is contained in:
parent
266db8c6a0
commit
26ea510312
2 changed files with 12 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
### 4.3.0
|
||||
* 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.
|
||||
|
||||
### 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)).
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue