feat: Add backend storage for cross-domain player state synchronization
- Add PlayerState model to database schema for storing game states - Create player identifier system (UUID-based) for cross-domain sync - Implement API endpoints for loading/saving player states - Refactor gameState hook to use backend storage with localStorage fallback - Support synchronization between hoerdle.de and hördle.de - Migration automatically runs on Docker container start
This commit is contained in:
@@ -39,7 +39,7 @@ const DEFAULT_UNLOCK_STEPS = [2, 4, 7, 11, 16, 30, 60];
|
||||
export default function Game({ dailyPuzzle, genre = null, isSpecial = false, maxAttempts = 7, unlockSteps = DEFAULT_UNLOCK_STEPS }: GameProps) {
|
||||
const t = useTranslations('Game');
|
||||
const locale = useLocale();
|
||||
const { gameState, statistics, addGuess, giveUp, addReplay, addYearBonus, skipYearBonus } = useGameState(genre, maxAttempts);
|
||||
const { gameState, statistics, addGuess, giveUp, addReplay, addYearBonus, skipYearBonus } = useGameState(genre, maxAttempts, isSpecial);
|
||||
const [hasWon, setHasWon] = useState(false);
|
||||
const [hasLost, setHasLost] = useState(false);
|
||||
const [shareText, setShareText] = useState(`🔗 ${t('share')}`);
|
||||
|
||||
Reference in New Issue
Block a user