summary refs log tree commit diff
path: root/src/gateway/opcodes/StreamWatch.ts
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-12-17 09:23:55 +0100
committerRory& <root@rory.gay>2025-12-17 09:23:55 +0100
commit45ee84aca9c19be58fe487157ba93d6e38ccd8f8 (patch)
treef72f44caf4028729121c6737b378c5b4d8ea6709 /src/gateway/opcodes/StreamWatch.ts
parentPrettier u7 (diff)
downloadserver-ts-45ee84aca9c19be58fe487157ba93d6e38ccd8f8.tar.xz
Prettier u8
Diffstat (limited to 'src/gateway/opcodes/StreamWatch.ts')
-rw-r--r--src/gateway/opcodes/StreamWatch.ts29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/gateway/opcodes/StreamWatch.ts b/src/gateway/opcodes/StreamWatch.ts

index 88bc0463..3bb1ce77 100644 --- a/src/gateway/opcodes/StreamWatch.ts +++ b/src/gateway/opcodes/StreamWatch.ts
@@ -1,20 +1,8 @@ -import { - genVoiceToken, - parseStreamKey, - Payload, - WebSocket, -} from "@spacebar/gateway"; -import { - Config, - emitEvent, - Stream, - StreamCreateEvent, - StreamServerUpdateEvent, - StreamSession, -} from "@spacebar/util"; +import { genVoiceToken, parseStreamKey, Payload, WebSocket } from "@spacebar/gateway"; +import { Config, emitEvent, Stream, StreamCreateEvent, StreamServerUpdateEvent, StreamSession } from "@spacebar/util"; import { check } from "./instanceOf"; import { Not } from "typeorm"; -import { StreamWatchSchema } from "@spacebar/schemas" +import { StreamWatchSchema } from "@spacebar/schemas"; export async function onStreamWatch(this: WebSocket, data: Payload) { const startTime = Date.now(); @@ -45,13 +33,10 @@ export async function onStreamWatch(this: WebSocket, data: Payload) { if (!stream) return this.close(4000, "Invalid stream key"); - if (type === "guild" && stream.channel.guild_id != guildId) - return this.close(4000, "Invalid stream key"); + if (type === "guild" && stream.channel.guild_id != guildId) return this.close(4000, "Invalid stream key"); const regions = Config.get().regions; - const guildRegion = regions.available.find( - (r) => r.endpoint === stream.endpoint, - ); + const guildRegion = regions.available.find((r) => r.endpoint === stream.endpoint); if (!guildRegion) return this.close(4000, "Unknown region"); @@ -97,7 +82,5 @@ export async function onStreamWatch(this: WebSocket, data: Payload) { user_id: this.user_id, } as StreamServerUpdateEvent); - console.log( - `[Gateway] STREAM_WATCH for user ${this.user_id} in channel ${channelId} with stream key ${body.stream_key} in ${Date.now() - startTime}ms`, - ); + console.log(`[Gateway] STREAM_WATCH for user ${this.user_id} in channel ${channelId} with stream key ${body.stream_key} in ${Date.now() - startTime}ms`); }