Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Online mode broken due to autoversion #551

Closed
Frostman opened this issue Jun 29, 2017 · 17 comments
Closed

Online mode broken due to autoversion #551

Frostman opened this issue Jun 29, 2017 · 17 comments
Labels

Comments

@Frostman
Copy link

Frostman commented Jun 29, 2017

Trying to run echo.js example, but it does nothing.

Workaround was found in comments - specify version explicitly when creating bot (version: "1.12").

tl;dr

  1. I've downloaded echo.js example and trying to run it

  2. I've enabled debug for minecraft proto

  3. Running it with the following command and getting following logs:

$ node echo.js myserver.com 25565 "email" "password"
  minecraft-protocol pinging myserver.com +0ms
  minecraft-protocol writing packet handshaking.set_protocol +184ms
  minecraft-protocol { protocolVersion: 47,
  minecraft-protocol   serverHost: 'myserver.com',
  minecraft-protocol   serverPort: 25565,
  minecraft-protocol   nextState: 1 } +0ms
  minecraft-protocol writing packet status.ping_start +7ms
  minecraft-protocol {} +0ms
  minecraft-protocol read packet status.server_info +20ms
  minecraft-protocol { response: '{"description":{"text":"Frostman\\u0027s Minecraft Server"},"players":{"max":20,"online":0},"version":{"name":"1.12","protocol":335}}' } +0ms
  minecraft-protocol writing packet status.ping +1ms
  minecraft-protocol { time: [ 0, 0 ] } +0ms
  minecraft-protocol read packet status.ping +16ms
  minecraft-protocol { time: [ 0, 0 ] } +1ms
  minecraft-protocol ping response { description: { text: 'Frostman\'s Minecraft Server' },
  players: { max: 20, online: 0 },
  version: { name: '1.12', protocol: 335 },
  latency: 17 } +0ms
  minecraft-protocol Server description: { text: 'Frostman\'s Minecraft Server' } +0ms
  minecraft-protocol Server version: 1.12, protocol: 335 +1ms
  1. Process exits after 30 seconds of running...
@Frostman
Copy link
Author

What's interesting - adding or removing bot to the whitelist.json doesn't change anything...

I'd really appreciate any help!

@toomykins
Copy link

toomykins commented Jun 30, 2017

I'm having the same problem with all examples. They only work on unauthorized accounts. It will throw an error when a password is given and the username/password is wrong, but they will simply hang when proper credentials are entered.
Tested on vanilla servers 1.8.8 to 1.12

***@***:~/mineflayer/examples$ DEBUG=* js digger.js localhost 25565 **LEGIT EMAIL OF MOJANG ACCOUNT** **LEGIT PASSWORD**
You are using a pure-javascript implementation of RSA.
Your performance might be subpar. Please consider installing URSA
  minecraft-protocol pinging localhost +0ms
  minecraft-protocol writing packet handshaking.set_protocol +186ms
  minecraft-protocol { protocolVersion: 47,
  minecraft-protocol   serverHost: 'localhost',
  minecraft-protocol   serverPort: 25565,
  minecraft-protocol   nextState: 1 } +0ms
  minecraft-protocol writing packet status.ping_start +8ms
  minecraft-protocol {} +0ms
  minecraft-protocol read packet status.server_info +51ms
  minecraft-protocol { response: '{"description":{"text":"A Minecraft Server"},"players":{"max":20,"online":0},"version":{"name":"1.10","protocol":210}}' } +0ms
  minecraft-protocol writing packet status.ping +1ms
  minecraft-protocol { time: [ 0, 0 ] } +0ms
  minecraft-protocol read packet status.ping +2ms
  minecraft-protocol { time: [ 0, 0 ] } +0ms
  minecraft-protocol ping response { description: { text: 'A Minecraft Server' },
  players: { max: 20, online: 0 },
  version: { name: '1.10', protocol: 210 },
  latency: 3 } +1ms
  minecraft-protocol Server description: { text: 'A Minecraft Server' } +0ms
  minecraft-protocol Server version: 1.10, protocol: 210 +1ms
***@***:~/mineflayer/examples$ 

The script kinda hangs and then exits after half a minute or so.
tried with 4 different accounts. Experienced on ubuntu 16.04

@plexigras
Copy link
Member

are you sure its a 1.12 or 1.8.8 server?

minecraft-protocol Server version: 1.10, protocol: 210 +1ms

@toomykins
Copy link

toomykins commented Jun 30, 2017

are you sure its a 1.12 or 1.8.8 server?

I tested from 1.8.8 to 1.12, this example was from a 1.10 server.
I read that the program automatically guesses the version and uses the correct protocol.

Edit: Nevermind, I added

Version: "1.12"

to the scripts, and they now connect fine to my 1.12 server. The program can guess the version by itself, but doesn't seem to do anything with it afterwards.

@plexigras
Copy link
Member

you got the same problem running minecraft-protocol examples?

node ./node_modules/minecraft-protocol/examples/client_echo/client_echo.js localhost 25565

@TheTechPony
Copy link

TheTechPony commented Jul 3, 2017

It's hanging with me as well unless I add version: '1.12' but even then it throws errors and closes immediately after connecting.
Problem: https://pastebin.com/5Kj9AxGY
Current script: https://pastebin.com/quRPP8Cx

@Frostman
Copy link
Author

Frostman commented Jul 4, 2017

It works for me if version: "1.12" specified

@TheTechPony
Copy link

I'm trying tons of servers and they all throw errors. When it does work and connect I get an error for chat patterns
https://pastebin.com/LANSzHHX

@plexigras
Copy link
Member

plexigras commented Jul 5, 2017

you got the same problem running mineflayer and minecraft-protocol examples?

@TheTechPony
Copy link

Minecraft-protocol examples work fine but anything mineflayer I get the deserialization error

@TheTechPony
Copy link

A lot of the servers I find hit me with that error but there are a few that work fine on.

two examples
mc.differentcraft.net
play.intenseraids.com

@rom1504
Copy link
Member

rom1504 commented Jul 9, 2017

@TheTechPony @Frostman @toomykins
Can you provide example of servers that don't work ?

It's important to provide steps to reproduce the problems.

@rom1504
Copy link
Member

rom1504 commented Jul 9, 2017

@rom1504
Copy link
Member

rom1504 commented Jul 9, 2017

so I tried mc.differentcraft.net, some specific action is required to go to the real server in-game.

@rom1504 rom1504 changed the title Mineflayer exits after some time w/o joining server Online mode broken due to autoversion Jul 9, 2017
@rom1504 rom1504 added the bug label Jul 9, 2017
@rom1504
Copy link
Member

rom1504 commented Jul 9, 2017

Ok reproduced. Apparently online mode doesn't work with the new autoversion thing.

And we disabled the tests for that in nmp because of mojang banning account that auth too fast...

Let me try to fix it.

@roblabla
Copy link
Member

roblabla commented Jul 9, 2017

@rom1504 we might want to contact mojang about that username banning thing. Maybe we could ask them to whitelist our account ? Or ask them for guidance about avoiding this issue ?

@plexigras
Copy link
Member

plexigras commented Jul 10, 2017

another possible solution might be to redirect the auth request to a local http server and send a fake response back to
the local minecraft server

http://wiki.vg/Protocol_Encryption#Server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants