gnolang / gnochess

User-friendly chess dApp in Gno ecosystem
https://gnochess.com
GNU General Public License v3.0
15 stars 10 forks source link

Front-end: we may have an issue if the game init in the front end #79

Open alexiscolin opened 9 months ago

alexiscolin commented 9 months ago

Right now, the board + chess.js headless engine start as a clear one. Since the WS is not a real one, what if both players are not sync and one starts a move before the other has his game party started. We might need a way to wait for both player to be sync to start the game? Or try to refactor to init the game with the game current fen instead of clear board. This last option would imply to check the 30sec rule: https://github.com/gnolang/gnochess/pull/54

clockworkgr commented 9 months ago

We could run a mini node websocket service to enable communication between player instances.

I did an online realtime turn-based game years ago that worked like this.

thus you could sync ready states/ timers/ etc. between the 2 players