BREAKING CHANGE(socketconnection): Stricter typings, smartserve hooks, connection fixes, and tag API change
This commit is contained in:
@@ -58,7 +58,7 @@ export class Smartsocket {
|
||||
* Handle a new WebSocket connection
|
||||
* Called by SocketServer when a new connection is established
|
||||
*/
|
||||
public async handleNewConnection(socket: WebSocket | pluginsTyped.ws.WebSocket) {
|
||||
public async handleNewConnection(socket: pluginsTyped.TWebSocket | pluginsTyped.IWebSocketLike) {
|
||||
const socketConnection: SocketConnection = new SocketConnection({
|
||||
alias: undefined,
|
||||
authenticated: false,
|
||||
@@ -76,8 +76,8 @@ export class Smartsocket {
|
||||
socketConnection.eventSubject.next('disconnected');
|
||||
};
|
||||
|
||||
socket.addEventListener('close', handleClose);
|
||||
socket.addEventListener('error', handleClose);
|
||||
(socket as pluginsTyped.IWebSocketLike).addEventListener('close', handleClose);
|
||||
(socket as pluginsTyped.IWebSocketLike).addEventListener('error', handleClose);
|
||||
|
||||
try {
|
||||
await socketConnection.authenticate();
|
||||
|
||||
Reference in New Issue
Block a user