trying to get the host game lobby work with the newer rDB

This commit is contained in:
RezHackXYZ 2025-05-15 19:42:58 +05:30
parent caff3cef7c
commit 2b9b5c3b39
No known key found for this signature in database
20 changed files with 213 additions and 355 deletions

View file

@ -5,13 +5,14 @@ import { questions } from './GameCreateData.svelte.js';
export async function startGame() {
if (questions.v.some((q) => q.name === '')) return alert('Please fill all questions');
if (questions.v.some((q) => q.answers.some((a) => a === ''))) return alert('Fill all options');
if (questions.v.some((q) => q.correctAnswer === undefined)) return alert('Select correct answers');
if (questions.v.some((q) => q.correctAnswer === undefined))
return alert('Select correct answers');
const gamePin = Math.floor(Math.random() * 1000000)
.toString()
.padStart(6, '0');
createGame($state.snapshot(questions), gamePin);
createGame(questions.v, gamePin);
goto('/host/' + gamePin);
}