diff --git a/src/queue/join.ts b/src/queue/join.ts index 6f8f7d47..d26c043e 100644 --- a/src/queue/join.ts +++ b/src/queue/join.ts @@ -9,7 +9,7 @@ import { mutex } from './mutex' export async function join(slotId: number, steamId: SteamId64): Promise { return await mutex.runExclusive(async () => { - logger.info({ steamId, slotId }, `join queue`) + logger.trace({ steamId, slotId }, `join queue`) const player = await collections.players.findOne({ steamId }) if (!player) { throw new Error(`player does not exist: ${steamId}`) @@ -19,6 +19,10 @@ export async function join(slotId: number, steamId: SteamId64): Promise ) } else if (props.actor) { - slotContent = + const actor = await collections.players.findOne({ steamId: props.actor }) + if (!props.actor) { + throw new Error(`actor invalid: ${props.actor}`) + } + + slotContent = } return ( @@ -59,13 +64,14 @@ export async function QueueSlot(props: { slot: QueueSlotModel; actor?: SteamId64 ) } -function JoinButton(props: { slotId: number }) { +function JoinButton(props: { slotId: number; disabled: boolean }) { return (