misc.mcserver: fixes
This commit is contained in:
parent
a94e042831
commit
3e4ce34435
1 changed files with 5 additions and 2 deletions
|
@ -768,7 +768,7 @@ mcserver.callback = async function (msg, line) {
|
||||||
});
|
});
|
||||||
let totalData = Buffer.alloc(0);
|
let totalData = Buffer.alloc(0);
|
||||||
client.on("data", function (data) {
|
client.on("data", function (data) {
|
||||||
totalData = Buffer.concat(totalData, data);
|
totalData = Buffer.concat([totalData, data]);
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on("close", function (err) {
|
client.on("close", function (err) {
|
||||||
|
@ -801,7 +801,10 @@ mcserver.callback = async function (msg, line) {
|
||||||
const totalPlayers = `(${data.players.online}/${data.players.max})`;
|
const totalPlayers = `(${data.players.online}/${data.players.max})`;
|
||||||
let image;
|
let image;
|
||||||
if (data.favicon) {
|
if (data.favicon) {
|
||||||
image = Buffer.from(data.favicon.slice(data.favicon.indexOf(",")));
|
image = Buffer.from(
|
||||||
|
data.favicon.slice(data.favicon.indexOf(",")),
|
||||||
|
"base64"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in a new issue