Add increment options and slight cleanup

This commit is contained in:
Owen
2026-01-12 20:48:18 -08:00
parent 0ccd5714f9
commit eba25fcc4d
14 changed files with 92 additions and 53 deletions

View File

@@ -45,6 +45,7 @@ export interface HandlerResponse {
broadcast?: boolean;
excludeSender?: boolean;
targetClientId?: string;
options?: SendMessageOptions;
}
export interface HandlerContext {

View File

@@ -306,15 +306,21 @@ const setupConnection = async (
if (response.broadcast) {
await broadcastToAllExcept(
response.message,
response.excludeSender ? clientId : undefined
response.excludeSender ? clientId : undefined,
response.options
);
} else if (response.targetClientId) {
await sendToClient(
response.targetClientId,
response.message
response.message,
response.options
);
} else {
ws.send(JSON.stringify(response.message));
await sendToClient(
clientId,
response.message,
response.options
);
}
}
} catch (error) {