PrismarineJS / node-minecraft-protocol

Parse and serialize minecraft packets, plus authentication and encryption.
https://prismarinejs.github.io/node-minecraft-protocol/
BSD 3-Clause "New" or "Revised" License
1.23k stars 239 forks source link

[MC 1.20.6 - Protocol 1.49.0] nmp server: Failed to verify username #1340

Open vincss opened 1 month ago

vincss commented 1 month ago

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

Versions

Detailed description of a problem

When I'm trying to connect to the server with a client in version 1.20.6 and the server is using minecraft-protocol 1.49.0, I get the follow error in the client : image

Current code

DEBUG CreateServer {
  'online-mode': true,
  motdMsg: { text: 'SleepingServer, waiting for his prince...' },
  port: 25565,
  maxPlayers: 20,
  version: false,
  beforePing: [Function: beforePing],
  validateChannelProtocol: true,
  errorHandler: [Function: errorHandler],
  enforceSecureProfile: true
}

Expected behavior

The connection is accepted, and it doesn't failed to verify the username.

Additional context

When I switch the "oneline-mode" to false: DEBUG CreateServer { 'online-mode': false, motdMsg: { text: 'SleepingServer, waiting for his prince...' }, port: 25565, maxPlayers: 20, version: false, beforePing: [Function: beforePing], validateChannelProtocol: true, errorHandler: [Function: errorHandler], enforceSecureProfile: false } The connection is handle but I got an error on the client side : {0221C08B-3A66-4901-996D-5F11BC8CD9E7}

Thanks for your help & devotion and this package.

Have a nice day.

rom1504 commented 1 month ago

@LucienHH do you think you could help figure that out?

rom1504 commented 1 month ago

@vincss can you reproduce on a vanilla server ?

vincss commented 1 month ago

Hi, Yes, it is before the minecraft server starts, I make a server that listen for client before to wake a real server : https://github.com/vincss/mcsleepingserverstarter/blob/master/src/sleepingMcJava.ts#L40

Thanks for your investigation.

rom1504 commented 1 month ago

We checked, client is working in 1.20.6

vincss commented 1 month ago

I'm using the server part of the library and a vanilla client.

vincss commented 4 weeks ago

Hi, I also tried with the latest version of node-minecraft-protocol 1.50.0 and client in 1.21.1 , but I ended up with the same error. :(

rom1504 commented 4 weeks ago

Provide more info. It's working for some people and not others

vincss commented 4 weeks ago

I would gladly provide more information.

When I start a server with the createServer with the version "minecraft-protocol": "^1.50.0", : https://github.com/vincss/mcsleepingserverstarter/blob/feature/minecraft-protocol_1.50.0/src/sleepingMcJava.ts#L39

DEBUG CreateServer {
  'online-mode': true,
  motdMsg: { text: 'SleepingServer, waiting for his prince...' },
  port: 25565,
  maxPlayers: 20,
  version: false,
  beforePing: [Function: beforePing],
  validateChannelProtocol: true,
  errorHandler: [Function: errorHandler],
  enforceSecureProfile: true
}

In the official client vanilla client in 1.21.1, I get the following error "Failed to verify username" : {8494EFB7-2562-4F5A-987A-4CF3CD777E7E}

Can you tell me which information would help ?

rom1504 commented 4 weeks ago

So your problem is not about node Minecraft protocol client but about the server. Is that right?

vincss commented 4 weeks ago

Yes, that's it :-)