Mtasa-blue: Debug/chat messages are not consistent across platforms

Created on 3 Nov 2018  路  6Comments  路  Source: multitheftauto/mtasa-blue

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.

bug good first issue

Most helpful comment

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.

All 6 comments

Same with _outputChatBox_ function
outputchatbox

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.

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

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

All below code 32

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.

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.

Was this page helpful?
0 / 5 - 0 ratings