store bg color

This commit is contained in:
Zutatensuppe 2020-12-03 21:24:59 +01:00
parent 3d1a9ca9c7
commit 4ac995f1e1
2 changed files with 9 additions and 10 deletions

View file

@ -25,6 +25,7 @@ function addPlayer(gameId, playerId) {
d: 0, // mouse down
name: 'anon',
color: '#ffffff',
bgcolor: '#222222',
points: 0,
ts,
}
@ -323,7 +324,11 @@ function handleInput(gameId, playerId, input) {
const ts = Util.timestamp()
const type = input[0]
if (type === 'player_color') {
if (type === 'bg_color') {
const bgcolor = input[1]
changePlayer(gameId, playerId, { bgcolor, ts })
_playerChange()
} else if (type === 'player_color') {
const color = input[1]
changePlayer(gameId, playerId, { color, ts })
_playerChange()