summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-22 00:23:43 +0100
committerTor Andersson <tor@ccxvii.net>2023-12-23 02:10:40 +0100
commit6aa382f07a75872db327f5f1ed1c012da0d3d5e3 (patch)
tree16a63bf27685fbdd9957e3bd28028966b5836899 /public
parent924101c4c0ed18f5bae2ee83de368a4f1f0bee51 (diff)
downloadserver-6aa382f07a75872db327f5f1ed1c012da0d3d5e3.tar.gz
Send system chat messages when players join and part active games.
Diffstat (limited to 'public')
-rw-r--r--public/common/client.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/public/common/client.js b/public/common/client.js
index 23e434d..87dc698 100644
--- a/public/common/client.js
+++ b/public/common/client.js
@@ -231,7 +231,10 @@ function update_chat(chat_id, raw_date, user, message) {
}
function add_chat_line(time, user, message) {
let line = document.createElement("div")
- line.textContent = "[" + time + "] " + user + " \xbb " + message
+ if (user)
+ line.textContent = "[" + time + "] " + user + " \xbb " + message
+ else
+ line.textContent = "[" + time + "] " + message
chat.text_element.appendChild(line)
chat.text_element.scrollTop = chat.text_element.scrollHeight
}