imposter creation

This commit is contained in:
adrian
2025-12-05 19:21:38 +01:00
parent 93aca73e55
commit bcc70458ae
5 changed files with 132 additions and 73 deletions

View File

@ -0,0 +1,21 @@
const parts = window.location.pathname.split("/").filter(Boolean);
const sessionId = parts[0] ?? null;
const username = parts[1] ?? null;
async function getState() {
const res = await fetch(`/api/${sessionId}/${username}/state`);
const state = await res.json();
}
async function show_user() {
const res = await fetch(`/api/user/${sessionId}`);
const users = await res.json();
const allUsers = users.map((u) => u.state);
if (allUsers.every((v) => v === 0)) {
console.log("test");
}
}
async function createImposter() {
const res = await fetch(`/api/${sessionId}/${username}/createImposter`);
}