summaryrefslogtreecommitdiff
path: root/public/join.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-09-15 20:50:51 +0200
committerTor Andersson <tor@ccxvii.net>2023-09-18 21:16:47 +0200
commitd7ae1e694112d6a4bfc9d528aa738fb04946a0b3 (patch)
treefc4f1c147d5a7887f98240df2851a3ee8f039b29 /public/join.js
parent9e77cf5b29a533faf1909327772359d189e527b1 (diff)
downloadserver-d7ae1e694112d6a4bfc9d528aa738fb04946a0b3.tar.gz
Enforce limits on how many games you can create and join.
Also limit joining more games if you have too many games waiting. Generous default limits: 7 open, 29 active, and 3 waiting.
Diffstat (limited to 'public/join.js')
-rw-r--r--public/join.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/public/join.js b/public/join.js
index 362800d..a22e0fa 100644
--- a/public/join.js
+++ b/public/join.js
@@ -213,7 +213,9 @@ function update() {
break
case 1:
case 0:
- if (game.owner_id === user_id)
+ if (limit)
+ element.innerHTML = `<i>Empty</i>`
+ else if (game.owner_id === user_id)
element.innerHTML = `\xbb <a class="join" href="javascript:join('${role}')">Join</a><a class="green" href="javascript:show_invite('${role}')">\u{2795}</a>`
else
element.innerHTML = `\xbb <a class="join" href="javascript:join('${role}')">Join</a>`