feat: implement DM command handler for player interactions and queue management

This commit is contained in:
2026-02-28 23:23:26 +00:00
parent 593797c751
commit 81a51dca8c
6 changed files with 516 additions and 160 deletions

View File

@@ -1,3 +1,4 @@
// src/hooks.server.ts
import type { Handle } from '@sveltejs/kit';
import { building } from '$app/environment';
import { auth } from '$lib/server/auth';
@@ -7,6 +8,15 @@ import { user as userTable } from '$lib/server/db/auth.schema';
import { eq } from 'drizzle-orm';
import { ensureRootAdminRole } from '$lib/server/permissions';
// ── Initialize the IRC DM handler once on server startup ──
// This runs when the module is first imported (server boot).
// The dynamic import prevents build-time issues if bancho.js isn't available.
if (!building) {
import('$lib/server/bancho/dm-handler')
.then(({ initDMHandler }) => initDMHandler())
.catch((err) => console.warn('[Hooks] DM handler init skipped:', err.message));
}
const handleBetterAuth: Handle = async ({ event, resolve }) => {
const session = await auth.api.getSession({ headers: event.request.headers });