PrismarineJS / PrismarineJS/node-minecraft-protocol

Java client throwing DecoderException on client.end

Open
#1,087 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

[✅ ] The FAQ doesn't contain a resolution to my issue

Versions

minecraft-protocol: 1.41.0
server: vanilla
node: 18.4.0

Detailed description of a problem

When calling client.end(...) on a connecting 1.19.2 client the connection is lost with the following message: Internal Exception: io.netty.handler.codec.DecoderException: aa: Non [a-z0-9_.-] character in namespace of location: {"text":"no server with subdomain localhost found"}

javaw_9kPvO8A7om

"no server with subdomain localhost found" is the message I intended to respond to the connecting client.

Current code

     const address = await getLocalAddress();
      const mcServer = mc.createServer({
        'online-mode': false,
        host: address,
        port: MC_SERVER_PORT,
        keepAlive: true,
      });

      mcServer.on('error', (e) => {
        this.logger.error('Error occurred while listening for logins', e);
      });
      mcServer.on(
        'login',
        async (client: ServerClient) => {
            // lines removed for brevity
            client.end("no server with subdomain localhost found");
        }
      );
      mcServer.on('listening', () => {
        this.logger.info(
          `Listening for login attempts on ${address}:${MC_SERVER_PORT}`,
        );
        resolve();
      }); 

Expected behavior

String passed into client.end(...) is what appears to the connecting Java client instead of the exception

Additional context

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 by reproducing the issue with the shown mc.createServer login handler and client.end(...) call on a 1.19.2 connection. Trace the client.end entry point through packet encoding to identify where the supplied message is handled, then verify that the Java client receives the intended text without a DecoderException.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.