mojira.dev
MC-7569

RCON output has newlines removed

When executing rcon commands, the response is all in one string with no newline characters, even when the command yields several lines of text when executed on the console.

Bukkit returns the newlines, but vanilla Minecraft does not, making the server response much harder to parse.
Suggest either null-splitting or \n-splitting the lines.

Code analysis can be found by @unknown in this comment.

Comments 26

Yes, this affects 1.5 as well. Exactly the same, no changes at all.

This is still an issue in 1.6.1 and 1.6.2

Is this still a concern in the current Minecraft version 1.7.2 / Launcher version 1.3.4 ? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Yes, the 1.7.2 server still returns unsplit strings

Is this still a concern in the current Minecraft version 1.7.4 / Launcher version 1.3.8 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

16 more comments

Still a problem as of 1.15.2 on Windows 10

For example, when sending the command "op" with no accompanying username the following is returned

"Unknown commandop<–[HERE]"

When it should be

"Unknown command
op<--[HERE]"

This is very troublesome when executing commands that return a large number of lines, that are then not separated by line-breaks as they would be in game, or in the server console itself

This remains unfixed as of 1.15.2, but I asked the owner of the RCON newline fix mod if it could be updated for 1.15.2, and they just uploaded the 1.15.2 version (thanks!), so rcon is once again patched and working properly on my server.

It would be really nice to get this fixed at some point, though.  I'm pretty sure it's just a one-line fix somewhere!

Still an issue on 1.17.

Can confirm on 1.18.2

Code analysis

Based on yarn 1.18.2 mappings

In the class RconCommandOutput

public void sendSystemMessage(Text message, UUID sender) {
    this.buffer.append(message.getString());
}

The message is appended to the buffer. Without a line seperator. I suggest simply appending System.lineSeperator() to the buffer on each system message

public void sendSystemMessage(Text message, UUID sender) {
   this.buffer.append(message.getString()).append(System.lineSeperator());
}

Like this!

Can confirm for 1.19.4

Fredrik Vold

dx

(Unassigned)

Confirmed

Platform

Low

Networking

rcon

Minecraft 1.4.7, Minecraft 1.5, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.6.4, ..., Minecraft 1.13.2, 1.15.2, 1.17, 1.18.2, 1.19.4

Retrieved