feat: redesign match play and add broadcast tooling

This commit is contained in:
2026-09-29 02:52:56 +00:00
parent f417a831f7
commit 9b9aafefc1
348 changed files with 31588 additions and 11094 deletions

38
streamer/obs.test.ts Normal file
View File

@@ -0,0 +1,38 @@
import { expect, test } from 'bun:test';
import { obsAuthentication } from './obs';
import { parseTosu } from './tosu';
test('OBS authentication matches the protocol documentation example', () => {
expect(
obsAuthentication(
'supersecretpassword',
'lM1GncleQOaCu9lT1yeUZhFYnqhsLLP1G5lAGo3ixaI=',
'+IxH4CnCiqpX1rM9scsNynZzbOe4KhDeYcTNS3PDaeY='
)
).toBe('1Ct943GAT+6YQUUX47Ia/ncufilbe6+oD6lY+5kaCu4=');
});
test('tosu tourney frames become per-player scores with map progress', () => {
const frame = parseTosu({
beatmap: { id: 75, time: { live: 30_000, firstObject: 10_000, lastObject: 50_000 } },
tourney: {
ipcState: 3,
clients: [
{
user: { id: 2, name: 'peppy' },
play: { score: 123_456, accuracy: 98.5, failed: false, combo: { current: 321 } }
},
{ user: { id: 0, name: '' }, play: { score: 0 } }
]
}
});
expect(frame).toEqual({
ipcState: 3,
beatmapId: 75,
progress: 0.5,
clients: [
{ osuId: 2, name: 'peppy', score: 123_456, accuracy: 98.5, combo: 321, failed: false }
]
});
expect(parseTosu({ beatmap: {} })).toBeNull();
});