Add account based multiplayer hosting and bug report retention

This commit is contained in:
2026-10-10 16:24:34 +05:00
parent 9af71c85c2
commit fc6da6756d
33 changed files with 1538 additions and 102 deletions

View File

@@ -49,22 +49,33 @@ test("room limits include the owner and stay between 2 and 16", () => {
createRoomSchema.parse({
datasetId: map,
difficulty: "normal",
displayName: " Alex ",
playerLimit,
}).displayName,
"Alex",
}).playerLimit,
playerLimit,
);
for (const playerLimit of [1, 17, 2.5, "16", null])
assert.equal(
createRoomSchema.safeParse({
datasetId: map,
difficulty: "normal",
displayName: "Alex",
playerLimit,
}).success,
false,
);
});
test("party creation rejects a client-selected host identity", () => {
const room = { datasetId: map, difficulty: "normal", playerLimit: 4 };
assert.equal(createRoomSchema.safeParse(room).success, true);
for (const identity of [
{ displayName: "Impostor" },
{ accountId: map },
{ name: "Impostor" },
])
assert.equal(
createRoomSchema.safeParse({ ...room, ...identity }).success,
false,
);
});
test("multiplayer names and guesses reject hidden controls, invalid rounds, and non-finite positions", () => {
assert.equal(
joinRoomSchema.parse({ displayName: " Друг " }).displayName,