misc.mcserver: fixes

This commit is contained in:
Cynthia Foxwell 2023-06-28 00:01:08 -06:00
parent a94e042831
commit 3e4ce34435

View file

@ -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 {