Merge branch 'master' of bitbucket.org:LuckyLaszlo/ft_transcendence

This commit is contained in:
cherif
2023-01-17 00:43:19 +01:00
22 changed files with 613 additions and 635 deletions

View File

@@ -1,3 +1,5 @@
import { HttpException, HttpStatus, Injectable, Res } from '@nestjs/common';
import { WsException } from '@nestjs/websockets';
import { WebSocketGateway, SubscribeMessage, WebSocketServer, MessageBody, ConnectedSocket, OnGatewayConnection, OnGatewayDisconnect } from '@nestjs/websockets';
import { UsersService } from 'src/users/users.service';
import { ChatService } from './chat.service';
@@ -22,12 +24,16 @@ implements OnGatewayConnection, OnGatewayDisconnect
@WebSocketServer()
server;
async handleConnection(socket: socketDto) {
async handleConnection(socket: socketDto)
{
printCaller('- socket connected :', socket.id, socket.handshake.query.username);
socket.username = socket.handshake.query.username.toString();
this.sockets.set(socket.username, socket);
if (!socket.username)
return;
this.sockets.set(socket.username, socket);
printCaller("--- socket.username:", socket.username);
let not_emit: string = `${socket.username}_not_emit`;