From 0b9f62921467544f5431f0efb2296d8f274305ce Mon Sep 17 00:00:00 2001 From: not-nullptr Date: Fri, 22 Mar 2024 07:55:14 +0000 Subject: [PATCH 1/2] :p --- src/routes/lobby/[id]/+server.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/lobby/[id]/+server.ts b/src/routes/lobby/[id]/+server.ts index b85cea8..16c70f9 100644 --- a/src/routes/lobby/[id]/+server.ts +++ b/src/routes/lobby/[id]/+server.ts @@ -5,6 +5,7 @@ import { useAuth } from "$lib/util/api/index.js"; /* thanks again janeberru for the shape of this data */ export async function POST({ request, params }) { const body = await request.json(); + console.log(body); const { id } = params; const room = RoomManager.getRoom(id); if (!room) return new Response(null, { status: 500 }); @@ -12,8 +13,9 @@ export async function POST({ request, params }) { if (!user) return new Response(null, { status: 401 }); if (user.id !== room.host.id) return new Response(null, { status: 401 }); if (body.players.length === 0 && room.roomInfo.owner) { - console.log(room.roomInfo.players); room.setPlayerList([{ gameId: 0, gameName: "", nickname: room.roomInfo.owner }]); + } else { + room.setPlayerList(body.players); } return json({ message: "Lobby updated successfully" }); } From ec59e479bf172684d1f544ffc23e6dc73aa7b0d3 Mon Sep 17 00:00:00 2001 From: not-nullptr Date: Fri, 22 Mar 2024 08:03:10 +0000 Subject: [PATCH 2/2] remove ip --- src/components/Room.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Room.svelte b/src/components/Room.svelte index 470b907..5a57fbc 100644 --- a/src/components/Room.svelte +++ b/src/components/Room.svelte @@ -52,7 +52,7 @@ {player.nickname}{#if player !== room.players[room.players.length - 1]},{" "} {/if} {/each} - {/if} | {room.hasPassword ? "Private" : "Public"} | {room.address}:{room.port} + {/if} | {room.hasPassword ? "Private" : "Public"}