XQF / xqf

XQF game server browser
http://xqf.github.io
GNU General Public License v2.0
37 stars 12 forks source link

more color code filtering #208

Closed illwieckz closed 6 years ago

illwieckz commented 6 years ago

I noticed some Q4 servers used ^c### with # in [0-9] for color codes, see: http://ewz-quake3forums.forumsmotion.com/t28-quake-4-color-code-chart

I only see them on q4max modded servers, I don't know if it's mod specific or not, and by the way the code is not ready to filter color codes by mod.

I noticed the same q4max servers also used ^- and ^+ color codes, well the behaviour looks to not be color, perhaps it's a font thing, but they looks to have to be filtered.

I noticed some q4 players using the icons code in their name as described there: https://www.gamespot.com/quake-4/cheats/

The icon code is i### where # is in [0-9a-z]. Well, the whole alphabet is probably not used but I'm bored.

I added the doom3 “^^ is empty string” flag. I read somewhere that:

Before typing in the name of your game/player type "^" without quotes and a number 1-0. Once typed, it will disappear and the cursor will change colors, indicating you did it correctly. You can use some letters too, but all the colors are in the numbers.

So I filtered both alpha and numeric codes, see: https://steamcommunity.com/sharedfiles/filedetails/?id=386113217

zturtleman commented 6 years ago

Doom 3 should use COLOR_QUAKE3_ANY instead of COLOR_QUAKE3_NUMERIC | COLOR_QUAKE3_ALPHA. Doom 3 treats ^ followed by anything besides a space as a color, not only ^[0-9a-zA-Z].

COLOR_DOOM3 should remove "^^" but not remove "^ " (carrot space).

Those Quake 4 escape codes are not limited to Q4Max mod. In Quake 4, ^ followed by any character is an escape code (including "^^" and "^ ") -- use COLOR_QUAKE3_ANY. ^[cC]??? appears to use hexadecimal digits. See more detailed Quake 4 escape code info.

illwieckz commented 6 years ago

I added the ^[Nn]* quake4 color code and made other fixes. Basically, quake4 filters out anything that resembles to a color code even if it means nothing (like rgb color codes with non-alphanumeric numbers).