How tristran-rgp/sample-test works
Zero Day is a browser slot-game client supporting offline play, authenticated online sessions, server-authoritative spins, free-spin and feature sequences, Core Hack jackpot reveals, history, replay, cheat tooling, and audiovisual presentation. The main workflow is: player logs in or chooses offline mode, starts a spin, the client routes it locally or through WebSocket commands, receives or computes round state, applies features and settlement, then renders wins and effects. Sampled code strongly supports the orchestration and integrations; some UI wiring remains unsampled.
Components 20
Boot and UI
- App Boot
src/main.js - UI Shell
src/ui/initUI.js - Cheat Controls
src/ui/cheat/panel.js
Gameplay Engine
- Runtime State
src/core/state.js - Spin Engine
src/game/spin.js - Feature Rules
src/game/features.js - Feature Flow
src/game/flow.js - Free Spins
src/game/fsAuto.js - Buy Features
src/ui/buyFeatures.js - Jackpot Reveal
src/game/jackpot.js
Online Services
- WebSocket Transport
src/net/ws.js - Session Commands
src/net/session.js - Round History
src/ui/historyOnline.js
Presentation
- Board Renderer
src/ui/render.js - Win Explainer
src/ui/winExplain.js - Feature VFX
src/ui/vfx/presenters.js - Sound Effects
src/sfx/sfx.js
Other components
- Player
- Auth Service
- Game Server
Connections 30
- Player → App Boot: starts game
- App Boot → Auth Service: logs in
- Auth Service → App Boot: returns tokens
- App Boot → Runtime State: stores session
- App Boot → UI Shell: initializes UI
- App Boot → Cheat Controls: binds controls
- App Boot → Spin Engine: overrides spins
- App Boot → WebSocket Transport: starts online mode
- Spin Engine → Runtime State: updates state
- Spin Engine → Feature Rules: evaluates features
- Feature Flow → Runtime State: applies stages
- Feature Flow → Free Spins: continues free spins
- UI Shell → Buy Features: opens purchases
- Buy Features → Session Commands: requests purchase
- Cheat Controls → Session Commands: sends cheat commands
- WebSocket Transport → Game Server: exchanges rounds
- WebSocket Transport → Runtime State: updates session
- WebSocket Transport → Feature Flow: dispatches stages
- WebSocket Transport → Jackpot Reveal: dispatches jackpot
- WebSocket Transport → Board Renderer: renders results
- Session Commands → WebSocket Transport: sends commands
- Session Commands → Runtime State: applies balances
- Jackpot Reveal → Session Commands: requests reveal
- Round History → Session Commands: requests history
- Board Renderer → Runtime State: reads board state
- Win Explainer → Session Commands: parses round data
- Win Explainer → Board Renderer: highlights wins
- Win Explainer → Feature VFX: plays win effects
- Win Explainer → Sound Effects: plays win sounds
- Feature VFX → Board Renderer: animates changes