diff --git a/main.py b/main.py index 09c9193..6f4c364 100644 --- a/main.py +++ b/main.py @@ -112,14 +112,16 @@ def is_command_output(message): """ Detect console output produced by RCON commands: cvar dumps and status tables. These are hidden; the 'zmq RCON command' echo lines still show - which client ran what. + which client ran what. Shape checks run on color-stripped text because + the server sprinkles Quake color codes into status rows. """ - if CVAR_RESPONSE_PATTERN.search(message): + clean = strip_color_codes(message) + if CVAR_RESPONSE_PATTERN.search(clean): return True - if 'num score ping' in message: + if 'num score ping' in clean: return True - if (STATUS_ROW_PATTERN.search(message) or STATUS_SEP_PATTERN.search(message) - or STATUS_MAP_PATTERN.search(message)): + if (STATUS_ROW_PATTERN.search(clean) or STATUS_SEP_PATTERN.search(clean) + or STATUS_MAP_PATTERN.search(clean)): return True return False