Closed
Description
Versions
- minecraft-protocol: 1.47.0
- node: 18.19.1
Detailed description of a problem
The protocol is broken on Node 18. Works fine on Node 20. The simplest way to reproduce it is to simply listen for a login
event.
Current code
import { createServer } from "minecraft-protocol";
const options = {
host: "127.0.0.1",
motd: "test",
port: 25565,
maxPlayers: 20,
version: "1.20.4"
}
const srv = createServer(options);
srv.on("login", client => {
console.log("join");
});
Expected behavior
"join" is printed on the console when a client tries to join the server.
Actual behavior
Nothing is printed and one of the following happens
- Client sees "Disconnected"
- Client sees "IndexOutOfBounds"
- Client sees "codecCorruptedFrameException"
Furthermore, the server may receive the following error (does not always happen either):
Disconnecting client because error Error: read ECONNRESET at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
errno: -104,
code: 'ECONNRESET',
syscall: 'read'
}
Additional context
I'd like to ask you to adjust the supported engine value for this library to disclude older versions of Node, if this issue can't be fixed easily.