Commit cc87c341 rédigé par amine-aitmokhtar's avatar amine-aitmokhtar
Parcourir les fichiers

feat: add game event buffering and persistence

Introduces a new 'game_events' table and buffering system to track granular
game events (inputs, scores, system states) alongside the existing game runs.

Changes:
- db.js:
  - Create `game_events` table (sensor_id, event_data, timestamp).
  - Add `bufferGameEvents` function to handle JSON event serialization.
  - Update `flushBuffer` to perform a single transaction for both runs and events.
  - Wrap database initialization in a transaction for safety.

- server.js:
  - Integrate `bufferGameEvents` into `sendMonitorEvent` for automatic logging.
  - Add source tracking (arduino vs frontend) to input events.
  - Add system events for client/monitor connections and disconnections.
  - Capture 'speed' events from Arduino.
parent d2731cfd
Prend en charge le Markdown
0% ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message !
Veuillez vous inscrire ou vous pour commenter