aboutsummaryrefslogtreecommitdiff
path: root/chat.go
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2022-05-01 10:28:41 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2022-05-01 10:28:41 +0200
commitfabb8e2400e22a638c105c0a9cd99919f2fc7dee (patch)
treeaaacd907773c8ca6afe6b6c5240ff7c9e4ca8648 /chat.go
parentc71129fdf4827d1757ce6d3d2be7c89e22987560 (diff)
Make chat command handlers run concurrently
They can't hang the packet handler anymore and the user is warned if commands take a lot of time to run
Diffstat (limited to 'chat.go')
-rw-r--r--chat.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/chat.go b/chat.go
index 61e8ca8..6257c8b 100644
--- a/chat.go
+++ b/chat.go
@@ -9,6 +9,10 @@ import (
"github.com/anon55555/mt"
)
+// ChatCmdTimeout is the time needed until a user is warned
+// about a chat command that's taking long to execute.
+var ChatCmdTimeout = 10 * time.Second
+
// SendChatMsg sends a chat message to the ClientConn.
func (cc *ClientConn) SendChatMsg(msg ...string) {
cc.SendCmd(&mt.ToCltChatMsg{