Dishorde icon indicating copy to clipboard operation
Dishorde copied to clipboard

GMSG strings displaying incorrectly in Discord

Open LakeYS opened this issue 3 years ago • 5 comments

image

Observed on a completely vanilla server.

LakeYS avatar Sep 09 '21 23:09 LakeYS

Requires testing in new update

LakeYS avatar Dec 29 '21 19:12 LakeYS

More reports of this in 2.0.0-rc1, as seen here: https://github.com/LakeYS/Dishorde/issues/119#issuecomment-1003005526

Player 'BigCone' left the2021-12-30T22:56:23 1796.155 INF Botman PlayerDisconnected2021-12-30T22:56:23 1796.155 INF Botman PlayerDisconnected
Player 'BigCone' left the game

And another quick-fix for the weird "left" messages, we can validate any message reading as "GMSG" to ensure it contains a whitelisted set of strings, being "died", "left the game", or "joined the game".

This would similarly be a temporary solution, and you would see a warning in console indicating that something is still wrong.

LakeYS avatar Dec 30 '21 16:12 LakeYS

I've done some testing and found a potential cause, here's a breakdown:

In computer operating systems, there are a few different types of data that can indicate the ending of a line in text. These being CRLF, LF, and CR. Generally, you see LF (\r) in Linux and Mac, and CRLF (\r\n) in Windows. (This is somewhat simplified)

If you enable debug-mode in the new rc3 build, you'll see a new log that tells you which one the game is using. The result: It's actually mixing them, sometimes using LF and sometimes using CRLF. This is confusing both the telnet client and the bot's own system, which are configured to look for CRLF. In turn, this is causing the bot to not properly recognize where lines from the console are ending. I suspect that this is at least partially the cause. If mods are also using a different line ending, it would perfectly explain the mod conflicts as well.

I made a quick-fix change in rc3 that should at least partially remedy this, but we'll have to see how it performs in testing.

LakeYS avatar Dec 31 '21 22:12 LakeYS

As of today, we've discovered that some lines are also being ended with CR. Detection and fixes are being adjusted accordingly: 02c6d84

image

LakeYS avatar Jan 03 '22 21:01 LakeYS

Got another report of this via Discord following the aforementioned patch. Will move on to regex message screening/detection in an attempt to resolve this.

image

LakeYS avatar Jan 19 '22 22:01 LakeYS