PrismarineJS / PrismarineJS/node-minecraft-protocol

Incompatible servers

Open
#532 35 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug non-vanilla
Dominant language
JavaScript
Stars
1.4k
Forks
290
Avg merge
4d 8h
Merged PRs (30d)
7

Description

Code:

'use strict';

const mc = require('minecraft-protocol');

if(process.argv.length < 4 || process.argv.length > 6) {
  console.log("Usage : node echo.js <host> <port> [<name>] [<password>]");
  process.exit(1);
}

const client = mc.createClient({
  version: false,
  host: process.argv[2],
  port: parseInt(process.argv[3]),
  username: process.argv[4] ? process.argv[4] : "echo",
  password: process.argv[5]
});

client.on('connect', function() {
  console.info('connected');
});
client.on('disconnect', function(packet) {
  console.log('disconnected: '+ packet.reason);
});
client.on('end', function() {
  console.log('disconnected3: ');
});
client.on('close', function() {
  console.log('disconnected2: ');
});
client.on('timeout', function() {
  console.log('disconnected1: ');
});

client.on('error', err => console.log(err))

Found incompatible servers:

  • Hypixel:
connected
events.js:136
      throw er; // Unhandled 'error' event
      ^

PartialReadError: Deserialization error for play.toClient.update_time.time : Read error for params.update_time.time : undefined
    at new ExtendableError (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/utils.js:75:11)
    at new PartialReadError (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/utils.js:81:5)
    at ProtoDef.readI64 (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/datatypes/numeric.js:5:11)
    at ProtoDef.read (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/protodef.js:127:29)
    at tryDoc (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/datatypes/structures.js:46:32)
    at tryCatch (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/utils.js:63:16)
    at tryDoc (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/utils.js:67:10)
    at typeArgs.forEach (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/datatypes/structures.js:45:5)
    at Array.forEach (<anonymous>)
    at ProtoDef.readContainer (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/datatypes/structures.js:44:12)
  • Mineplex (Bungeecord):

Quits ASA it prints connected.

  • 2b2t (?):
connected
/Users/nj/Downloads/node-minecraft-protocol-master/src/transforms/framing.js:76
          throw e;
          ^

Error: Deserialization error for play.toClient : write callback called multiple times
    at afterTransform (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/readable-stream/lib/_stream_transform.js:96:33)
    at TransformState.afterTransform (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/readable-stream/lib/_stream_transform.js:79:12)
    at FullPacketParser._transform (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/protodef/src/serializer.js:85:7)
    at FullPacketParser.Transform._read (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/readable-stream/lib/_stream_transform.js:182:10)
    at FullPacketParser.Transform._write (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/readable-stream/lib/_stream_transform.js:170:83)
    at doWrite (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/readable-stream/lib/_stream_writable.js:406:64)
    at writeOrBuffer (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/readable-stream/lib/_stream_writable.js:395:5)
    at FullPacketParser.Writable.write (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/readable-stream/lib/_stream_writable.js:322:11)
    at Decompressor.ondata (/Users/nj/Downloads/node-minecraft-protocol-master/node_modules/readable-stream/lib/_stream_readable.js:612:20)
    at Decompressor.emit (events.js:159:13)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided echo.js reproduction and test the listed Hypixel, Mineplex, and 2b2t servers. Inspect the update_time deserialization failure in the stack trace and src/transforms/framing.js for the 2b2t framing error. Done means the client handles these server connections without the reported protocol errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.