feat: add option to disable pixel placement

This commit is contained in:
2026-10-25 10:42:58 +01:00
parent 4f2cf08b27
commit 6cee1135a8
9 changed files with 70 additions and 19 deletions
+11 -6
View File
@@ -6,8 +6,10 @@ either). Each message is a short string: a one-letter type tag followed by
'|'-separated fields, in a fixed order the client already knows from this
table:
s|<next>|<width>|<height> initial personal state, once per connection
(next = epoch ms cooldown ends, or empty if free now)
s|<next>|<width>|<height>|<on>
initial personal state, once per connection
(next = epoch ms cooldown ends, or empty if free now;
on = 1 if placing pixels is allowed, 0 if frozen)
p|<x>|<y>|<c> a pixel was placed - broadcast to everyone,
including the placer (no separate ack needed)
k|<next> your own placement was accepted; carries your
@@ -15,10 +17,13 @@ table:
r|c|<next> rejected: still on cooldown
r|a rejected: not logged in
r|i rejected: invalid x/y/color
e|<width>|<height> an admin resized the grid for this event -
broadcast to everyone. A client that sees this
should re-fetch /api/.../place/canvas rather than
try to remap its local pixels.
r|d rejected: placement is disabled by an admin
e|<width>|<height>|<on>
an admin edited this event's settings (grid size
and/or placement toggle) - broadcast to everyone.
If the size changed, a client should re-fetch
/api/.../place/canvas rather than try to remap its
local pixels.
Client -> server has exactly one message shape, the same as the broadcast:
p|<x>|<y>|<c>