Fusionnée
a demandé de fusionner dev-amine-rotator-integration-and-game-events-persistance vers master
This closes #14 (closed)
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_eventstable (sensor_id, event_data, timestamp). - Add
bufferGameEventsfunction to handle JSON event serialization. - Update
flushBufferto perform a single transaction for both runs and events. - Wrap database initialization in a transaction for safety.
- Create
-
server.js:
- Integrate
bufferGameEventsintosendMonitorEventfor 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.
- Integrate