From 09cfb2ac588250a0d02d10694a7c2283f0cb6fe7 Mon Sep 17 00:00:00 2001 From: Corban-Lee Jones Date: Fri, 6 Dec 2024 17:42:10 +0000 Subject: [PATCH] fix player leave/join ignored if no access level caused by bad regex pattern --- cogs/console.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cogs/console.py b/cogs/console.py index a20cb7e..2267e08 100644 --- a/cogs/console.py +++ b/cogs/console.py @@ -149,7 +149,7 @@ class ConsoleCog(commands.Cog): Example of line: ConnectionManager: [fully-connected] "" connection: guid=*** ip=*** steam-id=*** access=admin username="corbz" connection-type="UDPRakNet" """ - re_pattern = r"guid=(\d+) ip=([\d\.]+) steam-id=(\d+) access=(\w+) username=\"([^\"]+)\" connection-type=\"([^\"]+)\"" + re_pattern = r"guid=(\d+)\s+ip=([\d\.]+)\s+steam-id=(\d+)\s+access=(\w*)\s+username=\"([^\"]+)\"\s+connection-type=\"([^\"]+)\"" re_match = re.search(re_pattern, line) if not re_match: log.warning("failed to parse player data: %s", line) @@ -183,7 +183,7 @@ class ConsoleCog(commands.Cog): Example of line: ConnectionManager: [disconnect] "receive-disconnect" connection: guid=*** ip=*** steam-id=*** access=admin username="corbz" connection-type="Disconnected" """ - re_pattern = r"guid=(\d+) ip=([\d\.]+) steam-id=(\d+) access=(\w+) username=\"([^\"]+)\" connection-type=\"([^\"]+)\"" + re_pattern = r"guid=(\d+)\s+ip=([\d\.]+)\s+steam-id=(\d+)\s+access=(\w*)\s+username=\"([^\"]+)\"\s+connection-type=\"([^\"]+)\"" re_match = re.search(re_pattern, line) if not re_match: log.warning("failed to parse player data: %s", line)