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

Debug/chat messages are not consistent across platforms #684

Closed
qaisjp opened this issue Nov 3, 2018 · 6 comments · Fixed by #1022
Closed

Debug/chat messages are not consistent across platforms #684

qaisjp opened this issue Nov 3, 2018 · 6 comments · Fixed by #1022
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@qaisjp
Copy link
Contributor

qaisjp commented Nov 3, 2018

Describe the bug

Debug messages on the client allow newlines whereas messages on the server do not.

To reproduce

crun outputDebugString("A\n\tB\n\t\tC")
run outputDebugString("A\n\tB\n\t\tC")

Expected behaviour

Should be the same.

Screenshots

image

Version

1.5.6

Additional information
It would be useful to also convert \t to four spaces.

@qaisjp qaisjp added bug Something isn't working good first issue Good for newcomers labels Nov 3, 2018
@qaisjp qaisjp added this to the Backlog milestone Nov 3, 2018
@theSarrum
Copy link
Contributor

Same with outputChatBox function
outputchatbox

@qaisjp qaisjp changed the title Debug messages are not consistent across platforms Debug/chat messages are not consistent across platforms Nov 3, 2018
@StrixG
Copy link
Contributor

StrixG commented Nov 3, 2018

This is due to the StripControlCodes function in Packet_DebugEcho and Packet_ChatEcho.
We could just remove this function calls to allow all control characters including new line.

@qaisjp
Copy link
Contributor Author

qaisjp commented Nov 3, 2018

Nice find. That should work. Which control codes are currently stripped?

@StrixG
Copy link
Contributor

StrixG commented Nov 3, 2018

Nice find. That should work. Which control codes are currently stripped?

All below code 32

@AlexTMjugador
Copy link
Member

AlexTMjugador commented Nov 4, 2018

This is due to the StripControlCodes function in Packet_DebugEcho and Packet_ChatEcho.
We could just remove this function calls to allow all control characters including new line.

Perhaps that's too easy for a good fix of this issue. Does removing the call to that function introduce any side effect? I guess the call is there for a reason.

Edit: While checking a bit the code in order to make a (hopefully) better response, I've found that Packet_ConsoleEcho also calls StripControlCodes, so maybe that also creates inconsistencies across platforms on the treatment of control characters when outputting strings to the console.

@qaisjp
Copy link
Contributor Author

qaisjp commented Nov 4, 2018

If we check where StripControlCodes is used we could just edit StripControlCodes to allow tabs and newlines (tabs and newlines most definitely won't break anything... he says). Otherwise a flag to that function would also work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants