cleanup, welcome with proper server time
This commit is contained in:
+3
-1
@@ -29,6 +29,7 @@ export class wssServer {
|
||||
}
|
||||
|
||||
newWSSConnexion(socket, req) {
|
||||
console.log('newWSSConnexion')
|
||||
var uuid = crypto.randomUUID();
|
||||
if(socket.session && socket.session.authenticated && socket.session.userInfos && socket.session.userInfos.identity && socket.session.userInfos.identity.username){
|
||||
var wssCnx = new WssConnexion({
|
||||
@@ -48,12 +49,13 @@ export class wssServer {
|
||||
this.Users2uuids[wssCnx.userId].add(uuid);
|
||||
this.OnlineUsers.add(wssCnx.userId);
|
||||
this.allRediscnx.forEach(cnx => { cnx.wssConnections[uuid] = wssCnx })
|
||||
this.postLoginActions(wssCnx)
|
||||
setImmediate(() => this.postLoginActions(wssCnx))
|
||||
} else socket.close()
|
||||
|
||||
}
|
||||
|
||||
postLoginActions(wssCnx) {
|
||||
wssCnx.welcome()
|
||||
wssCnx.startKeepAlive()
|
||||
wssCnx.subscribeMandatoryChans()
|
||||
wssCnx.action_SUBLST('SUBLST', null, '')
|
||||
|
||||
Reference in New Issue
Block a user