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

@@ -83,16 +83,27 @@ async function announcementSource(
const players = required(
await db
.from("multiplayer_players")
.select("id,display_name")
.select("id,display_name,account_id")
.eq("room_id", room.id)
.eq("has_left", false),
);
const host = players.find((p) => p.id === room.host_player_id);
if (!host || players.length >= room.player_limit) return null;
let hostName = host.display_name;
if (host.account_id) {
const profile = required(
await db
.from("profiles")
.select("display_name")
.eq("id", host.account_id)
.single(),
);
hostName = profile.display_name;
}
return {
id: room.id,
name: map.data.name,
owner: host.display_name,
owner: hostName,
difficulty: room.difficulty,
players: players.length,
limit: room.player_limit,