-
-
Notifications
You must be signed in to change notification settings - Fork 688
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
Allow server pong to appear if MOTDs are too long #1445
Conversation
If the server MOTDs are 340 characters or longer, they will not appear. If this is the case, we trim each.
Converting to draft as 1: this isn't a critical issue, 2: we want to try to understand why this is happening to better implement a fix. |
// The ping will not appear if the MOTD + sub-MOTD is of a certain length. | ||
if (pong.getMotd().length() + pong.getSubMotd().length() > 339) { | ||
// Split the difference | ||
if (pong.getMotd().length() > 170) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be added as a note to the config so users know it will be trimmed to 170 characters?
if (pong.getMotd().length() > 170) { | ||
pong.setMotd(pong.getMotd().substring(0, 170)); | ||
} | ||
if (pong.getSubMotd().length() > 170) { | ||
pong.setSubMotd(pong.getSubMotd().substring(0, 170)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be changed to allow for one being slightly longer and one being slightly shorter than 170 characters?
EG:
motd: Hello, World!
(13)
submotd: Some super long second motd line, with extra text! Damn didn't realise this had to be this long to hit the character limit. This is going on for a while and my brain is running out of things to type into this.
(209)
Total of 222 which is less than 339 so should not cause an issue with the packet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That code won't be hit unless the total length is greater than 339 (see the if statement right above).
If the server MOTDs are 340 characters or longer, they will not appear. If this is the case, we trim each.