wsid cannot be undefined
All checks were successful
Build / build (pull_request) Successful in 1m38s

This commit is contained in:
Sainan 2025-07-17 14:07:21 +02:00
parent 492a53093b
commit 64ebcad7fc

View File

@ -43,7 +43,7 @@ export const stopWsServers = (promises: Promise<void>[]): void => {
let lastWsid: number = 0;
interface IWsCustomData extends ws {
id?: number;
id: number;
accountId?: string;
}
@ -187,7 +187,7 @@ export const sendWsBroadcastEx = (data: IWsMsgToClient, accountId?: string, excl
for (const client of wsServer.clients) {
if (
(!accountId || (client as IWsCustomData).accountId == accountId) &&
(!excludeWsid || (client as IWsCustomData).id != excludeWsid)
(client as IWsCustomData).id != excludeWsid
) {
client.send(msg);
}
@ -197,7 +197,7 @@ export const sendWsBroadcastEx = (data: IWsMsgToClient, accountId?: string, excl
for (const client of wssServer.clients) {
if (
(!accountId || (client as IWsCustomData).accountId == accountId) &&
(!excludeWsid || (client as IWsCustomData).id != excludeWsid)
(client as IWsCustomData).id != excludeWsid
) {
client.send(msg);
}