Hinweise im Ingame-Chat: Map, Seitenwahl, Serienstand, Match-Start, Map-Ende
Nach dem Laden einer Map schreibt die App per RCON say, welche Map gespielt wird, wer sie gewählt hat, wer als CT und T startet und den Serienstand. Die Hinweise wiederholen sich während der Aufwärmphase jede Minute (höchstens zehnmal). Beim Match-Start und am Map-Ende folgen Start-, Ergebnis- und Serienhinweise.
This commit is contained in:
1 parent
7e17a33c3f
commit
ece21db78a
4 files changed
+247
No files matched your search
@@ -831,3 +831,39 @@ test('Offene Lobbys werden nach LOBBY_MAX_HOURS samt Server gelöscht, laufende
|
||||
await close();
|
||||
}
|
||||
});
|
||||
|
||||
test('Ingame-Chat: Hinweise nach dem Laden, beim Start und am Map-Ende', async () => {
|
||||
const { app, call, close } = await setup();
|
||||
try {
|
||||
const said = [];
|
||||
const send = app.adapter.sendCommands.bind(app.adapter);
|
||||
app.adapter.sendCommands = async (h, commands) => {
|
||||
said.push(...commands.filter((c) => c.startsWith('say ')).map((c) => c.slice(4)));
|
||||
return send(h, commands);
|
||||
};
|
||||
const { id, org, tokens } = await readyWingmanMatch(call, 'bo3');
|
||||
await call('POST', `/matches/${id}/veto/start`, { token: org });
|
||||
const snap = (await call('GET', `/matches/${id}`, { token: org })).body;
|
||||
const cap = (t) => tokens[snap.teams[t].players.find((p) => p.isCaptain).nickname];
|
||||
await playVeto(call, id, { A: cap('A'), B: cap('B') });
|
||||
await app.manager.poll();
|
||||
await waitFor(() => app.manager.row(id).status === 'configured', { label: 'Map 1 eingerichtet' });
|
||||
await waitFor(() => said.some((l) => l.startsWith('Map 1 von 3')), { label: 'Hinweis nach dem Laden' });
|
||||
assert.ok(said.some((l) => / startet als CT, .* als T$/.test(l)), 'Seiten werden genannt');
|
||||
assert.ok(said.includes('Serienstand: Alpha 0:0 Bravo'));
|
||||
|
||||
assert.equal((await call('POST', `/matches/${id}/server/warmup-end`, { token: org })).status, 200);
|
||||
await waitFor(() => said.some((l) => l.startsWith('Match live!')), { label: 'Hinweis beim Start' });
|
||||
|
||||
const map = app.service.seriesMaps(id)[0].map;
|
||||
const key = app.manager.row(id).config_key;
|
||||
const body = ['Team playing "CT": Alpha', 'Team playing "TERRORIST": Bravo', 'World triggered "Match_Start" on "' + map + '"',
|
||||
'Team "CT" triggered "SFUI_Notice_CTs_Win" (CT "1") (T "0")', 'World triggered "Round_End"',
|
||||
`Game Over: scrimcomp2v2 ${map} score 1:0 after 1 min`].join('\n');
|
||||
await fetch(`http://127.0.0.1:${app.server.address().port}/api/logs/${id}/${key}`, { method: 'POST', body });
|
||||
await waitFor(() => said.some((l) => /^Map 1 \(.+\) geht an Alpha mit 1:0$/.test(l)), { label: 'Hinweis am Map-Ende' });
|
||||
assert.ok(said.some((l) => l.startsWith('Nächste Map: ')));
|
||||
} finally {
|
||||
await close();
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user