XQF / xqf

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

Accurate Quake 3 color code removal #205

Closed zturtleman closed 6 years ago

zturtleman commented 6 years ago

Make Quake 3 remove all sequences of ^ followed by a character other than ^ to match the engine behavior. This is required for Wolfenstein: Enemy Territory servers as people use any character (such as ',').

Add a new color flag COLOR_QUAKE3_NUMERIC for games that expect only ^[0-9] to be removed such as Xonotic.

Add a new color flag COLOR_QUAKE3_ALPHA for ioquake3-based games that (combined with COLOR_QUAKE3_NUMERIC) expect only ^[0-9a-zA-Z].


While this is accurate for Quake 3 it is not accurate for all games based on it. This is kind of veering off into pointless and hard to maintain (accurate for all games) without per-game color removal function. Some examples. Jedi Outcast treats ^ followed by less or equal to '7' as a color (see ASCII table) whereas XQF will treat "^[0-9]" as colors. For Doom 3 "^^" should be removed instead of displayed as "^" by XQF.

illwieckz commented 6 years ago

Yeah I've noticed some WO:ET servers and players use some color code like ^., ^/, ^_ and so on, so I thought about implementing something similar. Thank you for having done that!

The fact that Doom3 expects ^^ to be an empty string is more annoying…

illwieckz commented 6 years ago

@zturtleman I'll merge this even if I have some other improvement ideas because I have a lot of commits to push that touches many part of the code and since this filtering code looks good and works, I just merge it to avoid rebase madness and if you have improvements to do or if you have some to do they will be done in further PR.