Repository navigation
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b9d7e3da1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cell.addProperty("visible", true); | ||
| } else { | ||
| cell.addProperty("piece", PieceJsonMapper.toJsonName(p.getVirtualType())); | ||
| cell.addProperty("piece", PieceJsonMapper.toJsonName(p.getType())); |
There was a problem hiding this comment.
Keep hidden pieces serialized as virtual types
In normal play, initialBoard feeds parseInitialBoard and then computeHints/getValidMoves, and those frontend rules explicitly treat Piece.type on unrevealed pieces as the position's virtualType, while the server validator uses ChessPiece.getMoveType() (virtual type while unrevealed). Sending p.getType() here makes the client pre-validate dark-piece moves using the shuffled real identity instead, so many legal dark-piece moves are blocked before sendMove and other hinted moves are rejected by the server; it also exposes hidden identities in the payload.
Useful? React with 👍 / 👎.
No description provided.