You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce an event sourcing pattern for player actions so every significant game event is stored as an immutable log entry. This powers replay, debugging, anti-cheat investigation (extends #18), and verifiable on-chain reputation when integrated with mesh-contract.
Description
Introduce an event sourcing pattern for player actions so every significant game event is stored as an immutable log entry. This powers replay, debugging, anti-cheat investigation (extends #18), and verifiable on-chain reputation when integrated with mesh-contract.
Acceptance Criteria
PlayerEvententity:id,userId,sessionId,eventType,payload(JSONB),timestamppuzzle.started,puzzle.solved,puzzle.abandoned,hint.used,answer.submitted,achievement.unlockedEventEmitter2bus and persisted to DB asynchronouslyGET /players/:id/events— paginated event history (admin only)GET /sessions/:id/events— full event replay for a session (admin/owner only)PlayerEventtableTechnical Notes
@nestjs/event-emitterfor internal bus(userId, eventType, timestamp)for efficient queryingpayloadschema validated pereventTypeat write time