aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-12-27 20:02:43 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-12-27 20:02:43 +0100
commit898947156b64e45cc5a0133c12aa73811d3e16f5 (patch)
tree86da5da6d75ef5ec03e0618e1e8ee34c20b66e44
parentbd256893e422392af87a665e934b33afc0b5ec8f (diff)
downloadskyhanni-898947156b64e45cc5a0133c12aa73811d3e16f5.tar.gz
skyhanni-898947156b64e45cc5a0133c12aa73811d3e16f5.tar.bz2
skyhanni-898947156b64e45cc5a0133c12aa73811d3e16f5.zip
more chat stuff
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt8
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt11
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt4
3 files changed, 11 insertions, 12 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt
index de0cafead..95d9aff04 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt
@@ -54,15 +54,13 @@ class ChatManager {
}
val modified = chatEvent.chatComponent
- if (modified.formattedText == original.formattedText) {
- loggerAllowed.log(message)
- loggerAll.log("[allowed] $message")
- } else {
+ loggerAllowed.log("[allowed] $message")
+ loggerAll.log("[allowed] $message")
+ if (modified.formattedText != original.formattedText) {
event.message = chatEvent.chatComponent
loggerModified.log(" ")
loggerModified.log("[original] " + original.formattedText)
loggerModified.log("[modified] " + modified.formattedText)
- loggerAll.log("[modified] " + modified.formattedText)
}
}
} \ No newline at end of file
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
index 963095215..6e26fd187 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt
@@ -260,13 +260,14 @@ class ChatFilter {
private fun lobby(message: String): Boolean = when {
//player join
- message.matchRegex("(.*) §6joined the lobby!") -> true
- message.matchRegex("(.*) §6slid into the lobby!") -> true
- message.matchRegex(" §b>§c>§a>§r (.*) §6joined the lobby!§r §a<§c<§b<") -> true
+ message.matchRegex(".* §6joined the lobby!") -> true
+ message.matchRegex(" §b>§c>§a>§r §r.*§f §6slid into the lobby!§r §a<§c<§b<") -> true
+ message.matchRegex(".* §6slid into the lobby!") -> true
+ message.matchRegex(" §b>§c>§a>§r .* §6joined the lobby!§r §a<§c<§b<") -> true
//mystery box
- message.matchRegex("§b✦ §r(.*) §r§7found a §r§e(.*) §r§bMystery Box§r§7!") -> true
- message.matchRegex("§b✦ §r(.*) §r§7found (a|an) §r(.*) §r§7in a §r§aMystery Box§r§7!") -> true
+ message.matchRegex("§b✦ §r.* §r§7found a §r§e.* §r§bMystery Box§r§7!") -> true
+ message.matchRegex("§b✦ §r.* §r§7found (a|an) §r.* §r§7in a §r§aMystery Box§r§7!") -> true
//prototype
message.contains("§r§6§lWelcome to the Prototype Lobby§r") -> true
diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt
index 347066ac2..5072152a7 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/chat/playerchat/PlayerChatModifier.kt
@@ -12,9 +12,9 @@ class PlayerChatModifier {
private val patterns = mutableListOf<Regex>()
init {
- patterns.add("§(?:a|b|6)\\[(?:VIP|MVP)(?:(?:§.|\\+)*)] (\\w{2,16})".toRegex()) // ranked player everywhere
+ patterns.add("§(?:a|b|6)\\[(?:VIP|MVP)(?:(?:§.|\\+)*)](?: {1,2})(?:§[7ab6])?(\\w{2,16})".toRegex()) // ranked player everywhere
patterns.add("§(?:7|a|b|6)((?:\\w+){2,16})§r(?!§7x)".toRegex()) // nons in notification message
- patterns.add("§7((?:\\w+){2,16})§7§r".toRegex()) // nons user chat
+ patterns.add("(?:§7 )?§7((?:\\w+){2,16})§7§r".toRegex()) // nons user chat
}
@SubscribeEvent