feat: speech overflow fix, 60+ voice profiles, post-fight audio cleanup
- Change speak() default to cancelPrevious=true so voices don't queue endlessly - Add stopAllAudio() export and wire into FightViewer unmount + post-fight - Flush speech queue at fight end with delayed cancel for clean cutoff - Expand from 30 to 60+ voice profiles (robots, accents, game, characters) - Add speech bubbles showing bot responses during rounds - Wire announceFinishHim/Fatality/FlawlessVictory/Devastating to not cancel Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d7e2ed8b9d
commit
c87bff01a8
@@ -103,8 +103,12 @@ fightsRouter.get('/:id', async (c) => {
|
||||
})
|
||||
})
|
||||
|
||||
// Dev-only mock fight endpoints (disabled in production)
|
||||
const isDev = process.env.NODE_ENV !== 'production'
|
||||
|
||||
// Trigger a mock fight between two random bots (dev/testing)
|
||||
fightsRouter.post('/mock', async (c) => {
|
||||
if (!isDev) return c.json({ error: 'Mock fights disabled in production.' }, 403)
|
||||
const allBots = await db.select({ id: schema.bots.id }).from(schema.bots)
|
||||
|
||||
if (allBots.length < 2) {
|
||||
@@ -123,6 +127,7 @@ fightsRouter.post('/mock', async (c) => {
|
||||
|
||||
// Trigger a mock fight for a specific bot against a random opponent
|
||||
fightsRouter.post('/mock/:botId', async (c) => {
|
||||
if (!isDev) return c.json({ error: 'Mock fights disabled in production.' }, 403)
|
||||
const botId = c.req.param('botId') as string
|
||||
|
||||
const botRows = await db.select({ id: schema.bots.id })
|
||||
@@ -150,6 +155,7 @@ fightsRouter.post('/mock/:botId', async (c) => {
|
||||
|
||||
// Start a batch of mock fights (for seeding or overnight loop)
|
||||
fightsRouter.post('/mock/batch/:count', async (c) => {
|
||||
if (!isDev) return c.json({ error: 'Fight loop disabled in production.' }, 403)
|
||||
const count = parseInt(c.req.param('count')) || 10
|
||||
const capped = Math.min(count, 500)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user