made the loby working using the newer rDB and makeing everything to bbe better manageable by using folders and more components!

This commit is contained in:
RezHackXYZ 2025-05-17 13:57:02 +05:30
parent 2b9b5c3b39
commit d3e0f3406e
No known key found for this signature in database
37 changed files with 417 additions and 159 deletions

View file

@ -0,0 +1,25 @@
import { supabase } from "$lib/supabase.js";
import { LobbyConnection } from "./UpdatePlayersList.js";
import { questions, Status, CurrentQuestion, currentQuestion } from "./HostsData.svelte.js";
export async function startGame(gamePin) {
await supabase.removeChannel(LobbyConnection);
Status.v = "started";
const { data } = await supabase
.from("questions")
.select("*")
.eq("gameid", Number(gamePin))
.order("id", { ascending: true });
questions.v = data;
CurrentQuestion.v = 0;
await supabase
.from("games")
.update({ status: `question-${currentQuestion.v}` })
.eq("gamepin", gamePin);
}