quasoft / backgammonjs

`backgammonjs` is an extensible multiplayer backgammon game written in JavaScript.
MIT License
90 stars 54 forks source link

Quickly clicking on a piece several times causes the piece to move several times #2

Closed quasoft closed 7 years ago

quasoft commented 7 years ago

Double-clicking a piece (eg. by double click) causes the same piece to move several times.

The reason is that the client sends a move request each time a piece is clicked. The second move request is send before the client has received the an event for the first move.

The client either needs to wait for the server to process the move before allowing further move request. Alternatively a sequence number for moves can be used to prevent processing the same move several times.