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,18 @@
import { supabase } from "$lib/supabase.js";
import { players } from "./HostsData.svelte.js";
export async function GetCurrentPlayers(gamePin) {
const { data, error } = await supabase
.from("players")
.select("playername")
.eq("gameid", Number(gamePin));
console.log("Current players data:", JSON.stringify(data));
if (error) {
console.error("Error fetching players:", error);
return;
}
players.v = data ? data.map(player => player.playername) : [];
}