Exemple #1
0
        public void JoinRoom(JoinRoom joinRoom)
        {
            var userId = GetUserId();

            if (userId == null)
            {
                return;
            }

            Groups.Add(Context.ConnectionId, joinRoom.RoomId.ToString());

            roomService.AddUser(joinRoom.RoomId, userId.Value, Context.ConnectionId, UnixTimeStampToDateTime(joinRoom.LastUpdated));

            Clients
            .Group(joinRoom.RoomId.ToString())
            .updateRoomUsers(GetSerializableRoomMembers(joinRoom.RoomId));
        }