How 2333599/flychess works
Web 联机飞行棋 uses a browser client and a Node.js server that authoritatively manages rooms, setup, turns, and flight-chess rules. The main workflow is: players create or join a room, roll to determine color-pick order, choose colors, then take turns rolling and moving until a player wins. The client renders the board with Canvas and reflects server broadcasts. Server excerpts are partial, so the graph groups some server-side responsibilities by their shared source file and omits uncertain internal wiring.
Main entry points: server.js Room Message Handler · game.js Client Interaction · index.html Game Page · styles.css Page Styling
Components 13
Browser Client
- Game Page
index.html - Client Interaction
game.js - Canvas Board
game.js - Page Styling
styles.css
Game Server
- HTTP Static Server
server.js - WebSocket Server
server.js - Room Message Handler
server.js
Room State
- Room Registry
server.js - Public Room State
server.js
Game Rules
- Order And Color Draft
server.js - Movement Rules
server.js - Landing And Capture
server.js
Other components
- Players
Connections 15
- Players → Game Page: use
- HTTP Static Server → Game Page: serves
- Game Page → Client Interaction: loads
- Game Page → Page Styling: loads
- Client Interaction → WebSocket Server: WebSocket actions
- WebSocket Server → Room Message Handler: dispatches
- Room Message Handler → Room Registry: reads and writes
- Room Message Handler → Order And Color Draft: invokes
- Room Message Handler → Movement Rules: invokes
- Movement Rules → Landing And Capture: applies
- Room Message Handler → Public Room State: builds
- Room Registry → Public Room State: supplies
- WebSocket Server → Client Interaction: broadcasts state
- Client Interaction → Canvas Board: renders
- Public Room State → Client Interaction: updates