misc.mcserver: last attempt for now
This commit is contained in:
parent
e8dbdb94a1
commit
edb2bdb552
1 changed files with 12 additions and 9 deletions
|
@ -765,15 +765,17 @@ mcserver.callback = async function (msg, line) {
|
|||
resolve("timeout");
|
||||
}, 10000);
|
||||
|
||||
const client = net.createConnection({
|
||||
host: ip,
|
||||
port: port,
|
||||
timeout: 10000,
|
||||
});
|
||||
client.on("connect", function () {
|
||||
logger.verbose("mcserver", "connect");
|
||||
client.write(HANDSHAKE_PACKET);
|
||||
});
|
||||
const client = net.createConnection(
|
||||
{
|
||||
host: ip,
|
||||
port: port,
|
||||
timeout: 10000,
|
||||
},
|
||||
function () {
|
||||
logger.verbose("mcserver", "connect");
|
||||
client.write(HANDSHAKE_PACKET);
|
||||
}
|
||||
);
|
||||
let totalData = Buffer.alloc(0);
|
||||
client.on("data", function (data) {
|
||||
totalData = Buffer.concat([totalData, data]);
|
||||
|
@ -797,6 +799,7 @@ mcserver.callback = async function (msg, line) {
|
|||
clearTimeout(timeout);
|
||||
return resolve(json);
|
||||
});
|
||||
client.on("timeout", function () {});
|
||||
});
|
||||
|
||||
if (data == "timeout") {
|
||||
|
|
Loading…
Reference in a new issue