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

Fix realms loading issue due to createClient plugin init order #1303

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

extremeheat
Copy link
Member

@extremeheat extremeheat commented May 26, 2024

@@ -10,7 +10,6 @@ module.exports = function (client, options) {
try {
parsed = JSON.parse(message.reason)
} catch (error) {
client.emit('error', error)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to ignore this error?

Copy link
Member Author

@extremeheat extremeheat Jun 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to #1290

The code below checks if the kick message contains an outdated version message then emits a new error, but it's not essential. And since the reason field is actually a JSON chat message it's still valid for the server to send a plain string (ie "hello world" as opposed to {"text":"hello world"}) as opposed to JSON, as the chat parsing code will accept it (but simply calling JSON.parse("hello world") will throw). So to correctly parse it we would have to import prismarine-chat and parse it with that.

@rom1504 rom1504 added this to Needs triage in PR Triage Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
PR Triage
  
Needs triage
Development

Successfully merging this pull request may close these issues.

pickRealm silently fails to connect Inconsistent playerChat event data
2 participants