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.
Veuillez vous inscrire ou vous connecter pour commenter