1
0
Fork 0

Compare commits

...

2 Commits

Author SHA1 Message Date
khr 2361252b37 Merge branch 'master' of cybre.tech:chr/matrix-appservice-minecraft 2020-04-03 06:39:26 +00:00
khr 381d5f35ba fix regex 2020-04-03 06:39:22 +00:00
1 changed files with 2 additions and 2 deletions

View File

@ -46,9 +46,9 @@ def send_process_output(
# "[07:36:28] [Server thread/INFO] [minecraft/DedicatedServer]: <khr_> test"
chat_pattern = re.compile(r"(\[.*\] )?\[(.*)\] \[(.*)\]: <(.*)> (.*)")
# "[05:09:54] [Server thread/INFO] [minecraft/DedicatedServer]: khr_ joined the game"
login_pattern = re.compile(r"\[.*\] \[(.*)\] \[(.*)\]: ([^ ]*]) joined the game")
login_pattern = re.compile(r"\[.*\] \[(.*)\] \[(.*)\]: (\S*) joined the game")
# "[05:12:24] [Server thread/INFO] [minecraft/DedicatedServer]: khr_ left the game"
logout_pattern = re.compile(r"\[.*\] \[(.*)\] \[(.*)\]: ([^ ]*]) left the game")
logout_pattern = re.compile(r"\[.*\] \[(.*)\] \[(.*)\]: (\S*) left the game")
for line in process:
log.info(line.rstrip("\n"))
chat_result = chat_pattern.search(line)