v1 review pass: fixed some minor bugs
This commit is contained in:
@@ -65,15 +65,26 @@ export function broadcastDumpDeleted(dumpId: string): void {
|
||||
}
|
||||
}
|
||||
|
||||
export function broadcastVoteUpdate(dumpId: string, voteCount: number): void {
|
||||
export function broadcastVoteUpdate(
|
||||
dumpId: string,
|
||||
voteCount: number,
|
||||
voterId: string,
|
||||
action: "cast" | "remove",
|
||||
): void {
|
||||
for (const client of clients) {
|
||||
send(client.socket, { type: "votes_update", dumpId, voteCount });
|
||||
send(client.socket, {
|
||||
type: "votes_update",
|
||||
dumpId,
|
||||
voteCount,
|
||||
voterId,
|
||||
action,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Keepalive: ping all clients every 30s, remove non-responsive ones
|
||||
const PING_INTERVAL = 30_000;
|
||||
const PONG_TIMEOUT = 5_000;
|
||||
const _PONG_TIMEOUT = 5_000;
|
||||
|
||||
setInterval(() => {
|
||||
for (const client of clients) {
|
||||
|
||||
Reference in New Issue
Block a user