feat(sprint1-step3b): backend save system + anti-cheat + données rattrapées
- game_saves table + migration 002 (JSON state, anti-cheat metadata) - saveControllers.js : load/save avec validation delta ressources (750k/s × 1.1) - GameSaveManager : upsert MySQL ON DUPLICATE KEY UPDATE - useSaveSync hook : auto-save 30s + keepalive beforeunload + guest fallback - save-validation.test.ts : 8 tests anti-cheat - economy.ts : arbre d'évolution 5 nœuds + prestige ADN (rattrapage step 2) - economy.test.ts : +40 tests (évolution tree, multipliers, start bonus) - GDD + SPRINT1.md : docs sprint complètes - Rethème data : shop.json, Achievements.json, Cookie, Legal (rattrapage step 1)
This commit is contained in:
14
Backend/database/migrations/002_game_saves.sql
Normal file
14
Backend/database/migrations/002_game_saves.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- Migration 002 — Game saves with anti-cheat metadata
|
||||
-- Safe: CREATE TABLE IF NOT EXISTS, no data loss
|
||||
-- Run: mysql -u <user> -p clickerz < migrations/002_game_saves.sql
|
||||
|
||||
CREATE TABLE IF NOT EXISTS game_saves (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT NOT NULL UNIQUE,
|
||||
game_state JSON NOT NULL,
|
||||
last_save TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
lifetime_tadpoles BIGINT DEFAULT 0,
|
||||
prestige_count INT DEFAULT 0,
|
||||
play_time_seconds INT DEFAULT 0,
|
||||
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
|
||||
);
|
||||
Reference in New Issue
Block a user