feat(is_possible_chat_msg): support extra chat log format and add catchall backup
This commit is contained in:
parent
dcfd8d72eb
commit
f04a0379aa
1 changed files with 13 additions and 2 deletions
15
src/main.rs
15
src/main.rs
|
@ -237,10 +237,21 @@ fn is_possible_chat_msg(input: &str) -> bool {
|
||||||
)
|
)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
});
|
});
|
||||||
static CLIENT_MSG_RE: Lazy<Regex> = Lazy::new(|| {
|
static CLIENT_PRISM_MSG_RE: Lazy<Regex> = Lazy::new(|| {
|
||||||
Regex::new(r"\[.*\] \[Render thread\/INFO\] \[minecraft\/ChatComponent\]: \[CHAT\] <.*>*")
|
Regex::new(r"\[.*\] \[Render thread\/INFO\] \[minecraft\/ChatComponent\]: \[CHAT\] <.*>*")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
});
|
});
|
||||||
|
static CLIENT_LOG_MSG_RE: Lazy<Regex> = Lazy::new(|| {
|
||||||
|
Regex::new(r"\[.*\] \[Render thread\/INFO\] \[net.minecraft.client.gui.components.ChatComponent\/\]: \[CHAT\] <.*>*")
|
||||||
|
.unwrap()
|
||||||
|
});
|
||||||
|
|
||||||
SERVER_MSG_RE.is_match(input) || CLIENT_MSG_RE.is_match(input)
|
// This is here just in case I need to get a chat message from a strange place
|
||||||
|
static _CLIENT_CATCHALL_MSG_RE: Lazy<Regex> = Lazy::new(|| {
|
||||||
|
Regex::new(r".*?: \[CHAT\] .*")
|
||||||
|
.unwrap()
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
SERVER_MSG_RE.is_match(input) || CLIENT_PRISM_MSG_RE.is_match(input) || CLIENT_LOG_MSG_RE.is_match(input)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue