Boardgame.io: Moves from debug panel are disallowed when playing with local master

Created on 26 Sep 2020  Â·  2Comments  Â·  Source: boardgameio/boardgame.io

Sumary

When running the game with a local master the moves triggered from the debug panel raise the following error:

ERROR: disallowed move: moveName

Steps to reproduce:

  1. Go to the local master docs and open the example in SandBox
    https://boardgame.io/documentation/#/multiplayer?id=local-master

  2. In the Client, set debug to true and reload the app:
    https://codesandbox.io/s/boardgameio-dibw3?file=/src/index.js:551-556

  3. Open the developer console.

  4. Select player 0 by clicking on it from the debug panel (otherwise it will raise ERROR: player not active - playerID=[1] as player 1 is selected by default, not sure why):

image

  1. Click on the clickCell move from the debug panel, enter 0 (or leave it empty), and press enter:

image

  1. Observe the error in the developer console:
ERROR: disallowed move: clickCell

I forked the example project following the steps to reproduce so you can take a look right away:
https://codesandbox.io/s/boardgameio-forked-1yihh

bug

All 2 comments

Thanks for the clear report and reproduction steps!

This is actually a symptom of another bug/error: in this case each client is rendering the Debug Panel (one on top of the other). That’s why player 1 is selected by default — because player 1’s debug panel is rendered second and appears on top. We actually need to fix this some other way by rendering one debug panel per _master_ instead of per client (or potentially have some way of toggling between debug panel instances if there are several).

Thank you, the fix worked! I also activated the debug panel only in the first client, as you suggested, and then everything worked as expected. Thanks again!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jchadwick picture jchadwick  Â·  4Comments

alexwoodsy picture alexwoodsy  Â·  7Comments

julienroulle picture julienroulle  Â·  9Comments

eseom picture eseom  Â·  4Comments

vdfdev picture vdfdev  Â·  3Comments