diff --git a/src/controllers/UserWebSocketController.ts b/src/controllers/UserWebSocketController.ts index 94afdae..d0fdd17 100644 --- a/src/controllers/UserWebSocketController.ts +++ b/src/controllers/UserWebSocketController.ts @@ -220,6 +220,16 @@ export class UserWebSocketController { entry.ws.close(); } + /** + * Close all user websockets + * + * @param userID Target user ID + */ + public static async CloseAllUserSockets(userID: number) { + for(const entry of this.active_clients.filter((f) => f.userID == userID)) + entry.ws.close(); + } + /** * Send a message to a socket *