Bound telemetry player identities (Refs #74)
CI / checks (push) Successful in 4m48s

This commit is contained in:
2026-10-09 17:08:55 -04:00
parent bd16737dd8
commit f0afd6de67
3 changed files with 201 additions and 10 deletions
+4 -2
View File
@@ -59,8 +59,10 @@ export function parseGameEvent(value: unknown): GameEvent {
throw new Error(`players[${index}] must be an object`);
const player = value as Record<string, unknown>;
for (const key of ['name', 'guid'] as const) {
if (typeof player[key] !== 'string' || !player[key].trim())
throw new Error(`players[${index}].${key} must be a nonempty string`);
if (typeof player[key] !== 'string' || player[key].length > 255 || !player[key].trim())
throw new Error(
`players[${index}].${key} must be a nonempty string (up to 255 characters)`
);
}
const identity: TelemetryPlayer = {
name: player.name as string,