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

pickRealm silently fails to connect #3348

Open
B2H990 opened this issue Apr 7, 2024 · 4 comments
Open

pickRealm silently fails to connect #3348

B2H990 opened this issue Apr 7, 2024 · 4 comments

Comments

@B2H990
Copy link

B2H990 commented Apr 7, 2024

'use strict'

const mineflayer = require('mineflayer')

const [,, username, realmName] = process.argv
if (!realmName) {
  console.log('Usage : node client_realms.js <username/email> <realm_name>')
  process.exit(1)
}

const client = mineflayer.createBot({
  realms: {
    pickRealm: (realms) => realms.find(e => e.name === realmName) // Connect the client to a Realm using a function that returns a Realm
  },
  username,
  auth: 'microsoft' // This option must be present and set to 'microsoft' to  join a Realm.
})

client.on('connect', function () {
  console.info('connected')
})

client.on('disconnect', function (packet) {
  console.log('disconnected: ' + packet.reason)
})

prints connected, but never actually connects to realm.

@B2H990 B2H990 added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Apr 7, 2024
@extremeheat
Copy link
Member

extremeheat commented Apr 7, 2024

cc @LucienHH

@B2H990
Copy link
Author

B2H990 commented Apr 7, 2024

This works:

const bot = mineflayer.createBot({
	host: 'realhost',
	realms: {
		pickRealm: (realms) => realms[0]
	},
	auth: 'microsoft'
})

But not this:

const bot = mineflayer.createBot({
	realms: {
		pickRealm: (realms) => realms[0]
	},
	auth: 'microsoft'
})

@extremeheat
Copy link
Member

That is strange since the realm handling will replace the host and port with the correct one. Can anyone else with realms reproduce?

@extremeheat
Copy link
Member

If you can still repro with latest, can you add process.env.DEBUG = '*' to the top of your code and provide the debug console output?

@extremeheat extremeheat added waiting info from op and removed possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants