From de91cb3b4b452de47b6e62db4f7e7101a676cea2 Mon Sep 17 00:00:00 2001 From: Yedelo <158670400+Yedelo@users.noreply.github.com> Date: Sat, 23 Aug 2025 12:56:09 -0400 Subject: [PATCH 1/3] Add loop and loopDelay commands for testing unsafe chat messages --- .../chatting/command/ChattingCommand.kt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/kotlin/org/polyfrost/chatting/command/ChattingCommand.kt b/src/main/kotlin/org/polyfrost/chatting/command/ChattingCommand.kt index 86aff72..35542a7 100644 --- a/src/main/kotlin/org/polyfrost/chatting/command/ChattingCommand.kt +++ b/src/main/kotlin/org/polyfrost/chatting/command/ChattingCommand.kt @@ -1,9 +1,12 @@ package org.polyfrost.chatting.command +import cc.polyfrost.oneconfig.libs.universal.UChat import cc.polyfrost.oneconfig.utils.commands.annotations.Command import cc.polyfrost.oneconfig.utils.commands.annotations.Main +import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand import org.polyfrost.chatting.Chatting import org.polyfrost.chatting.config.ChattingConfig +import kotlin.concurrent.thread @Command(value = Chatting.ID, description = "Access the " + Chatting.NAME + " GUI.") class ChattingCommand { @@ -11,4 +14,23 @@ class ChattingCommand { fun main() { ChattingConfig.openGui() } + + @SubCommand + fun loop(amt: Int) { + thread { + for (i in 1..amt) { + UChat.chat(i) + } + } + } + + @SubCommand + fun loopDelay(amt: Int, delay: Int) { + thread { + for (i in 1..amt) { + UChat.chat(i) + Thread.sleep(delay.toLong()) + } + } + } } \ No newline at end of file From 619bf6586302c40c2eafb2f045dd365f4349cbdd Mon Sep 17 00:00:00 2001 From: Yedelo <158670400+Yedelo@users.noreply.github.com> Date: Sat, 23 Aug 2025 13:48:21 -0400 Subject: [PATCH 2/3] Wrap drawnChatLines in a new list to access messages thread-safely --- .../kotlin/org/polyfrost/chatting/chat/ChatSearchingManager.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/org/polyfrost/chatting/chat/ChatSearchingManager.kt b/src/main/kotlin/org/polyfrost/chatting/chat/ChatSearchingManager.kt index b089751..4455efe 100644 --- a/src/main/kotlin/org/polyfrost/chatting/chat/ChatSearchingManager.kt +++ b/src/main/kotlin/org/polyfrost/chatting/chat/ChatSearchingManager.kt @@ -32,11 +32,12 @@ object ChatSearchingManager { @JvmStatic fun filterMessages(text: String, list: List): List? { + val safeList = ArrayList(list) val chatTabMessages = filterChatTabMessages(lastSearch) if (chatTabMessages != null) { return chatTabMessages } - return filterMessages2(text, list) + return filterMessages2(text, safeList) } @JvmStatic From 68faaae19496a8d91b34950ebccf7e512bd4dc8b Mon Sep 17 00:00:00 2001 From: Yedelo <158670400+Yedelo@users.noreply.github.com> Date: Sat, 23 Aug 2025 13:57:20 -0400 Subject: [PATCH 3/3] Revert "Add loop and loopDelay commands for testing unsafe chat messages" This reverts commit de91cb3b4b452de47b6e62db4f7e7101a676cea2. --- .../chatting/command/ChattingCommand.kt | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/src/main/kotlin/org/polyfrost/chatting/command/ChattingCommand.kt b/src/main/kotlin/org/polyfrost/chatting/command/ChattingCommand.kt index 35542a7..86aff72 100644 --- a/src/main/kotlin/org/polyfrost/chatting/command/ChattingCommand.kt +++ b/src/main/kotlin/org/polyfrost/chatting/command/ChattingCommand.kt @@ -1,12 +1,9 @@ package org.polyfrost.chatting.command -import cc.polyfrost.oneconfig.libs.universal.UChat import cc.polyfrost.oneconfig.utils.commands.annotations.Command import cc.polyfrost.oneconfig.utils.commands.annotations.Main -import cc.polyfrost.oneconfig.utils.commands.annotations.SubCommand import org.polyfrost.chatting.Chatting import org.polyfrost.chatting.config.ChattingConfig -import kotlin.concurrent.thread @Command(value = Chatting.ID, description = "Access the " + Chatting.NAME + " GUI.") class ChattingCommand { @@ -14,23 +11,4 @@ class ChattingCommand { fun main() { ChattingConfig.openGui() } - - @SubCommand - fun loop(amt: Int) { - thread { - for (i in 1..amt) { - UChat.chat(i) - } - } - } - - @SubCommand - fun loopDelay(amt: Int, delay: Int) { - thread { - for (i in 1..amt) { - UChat.chat(i) - Thread.sleep(delay.toLong()) - } - } - } } \ No newline at end of file