[T5] Plutonium Discord presence leaves ^< ^@ color codes in the server hostname
-
The Discord "now playing" rich presence strips ^0-^9, ^: and ^; from the server name, but passes the last five T5 color codes through literally: ^< ^= ^> ^? ^@.
Any server whose name uses one of those shows the raw code on every connected player's Discord card. Including my server, which has orange ^<.Repro. Set sv_hostname to a string carrying one code of each class and read the card:
sent: PROBE ^1a ^:b ^<c ^=d ^>e ^?f ^@g ^;h END card: PROBE a b ^<c ^=d ^>e ^?f ^@g h END^1, ^: and ^; are removed correctly. The other five survive verbatim. (Tested on a dedicated server with the value re-asserted, since it otherwise reverts to the server-key label within ~20s.)
Cause. T5's colour table has 17 entries, so valid codes run '0' (0x30) through '@' (0x40). The game's own parser, at t5mp.exe file offset 0x14BC70, is index = char - '0' with a bound of 17 and a white fallback, with no digit check at all:
8A 44 24 04 mov al, [esp+4] ; char after '^' 2C 30 sub al, 0x30 ; index = char - '0' 3C 11 cmp al, 0x11 ; 17 = table size 0F B6 C0 movzx eax, al 72 05 jb use_it B8 07 00 00 00 mov eax, 7 ; else white C3 retThe strip behaves as though its range is '0'-';' (0x30-0x3B), i.e. entries 0-11, while the table has five more: ^< orange, ^= steel blue, ^> light grey, ^? purple, ^@ brown. Widening the upper bound to '@' should be the whole fix.
-
Open an issue here
https://github.com/plutoniummod/issue-tracker/issues
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login