gemercheung vor 3 Jahren
Ursprung
Commit
2cab831372

+ 1 - 1
src/app.controller.ts

@@ -15,7 +15,7 @@ export class AppController implements OnModuleInit {
     private readonly appService: AppService,
     private readonly sceneService: SceneService,
     private readonly cacheService: CacheService,
-  ) { }
+  ) {}
 
   onModuleInit() {
     // console.log('this.client', this.client);

+ 1 - 1
src/cache/cache.service.ts

@@ -10,7 +10,7 @@ import { RedisService } from 'nestjs-redis';
 export class CacheService implements OnModuleInit, OnModuleDestroy {
   public client;
   private logger: Logger = new Logger('CacheService');
-  constructor(private redisService: RedisService) { }
+  constructor(private redisService: RedisService) {}
 
   async onModuleInit() {
     try {

+ 0 - 1
src/get-router/get-router.service.ts

@@ -214,7 +214,6 @@ export class GetRouterService implements OnModuleInit {
     }
   }
 
-
   searchRoad2(startPointId, endPointId) {
     try {
       if (startPointId == endPointId) {

+ 7 - 2
src/logConfig.ts

@@ -32,11 +32,16 @@ export const LoggerConfig = {
     winston.format.timestamp({
       format: 'YYYY-MM-DD HH:mm:ss SSS',
     }),
+    winston.format.metadata({
+      fillExcept: ['message', 'level', 'timestamp', 'label', 'uid', 'rid'],
+    }),
     winston.format.json(),
     winston.format.printf(
       (info) =>
-        `${info.timestamp} [${info.level}] ${info.context || ''}: ${info.message
-        }`,
+        // eslint-disable-next-line prettier/prettier
+        `${info.timestamp} [${info.level}] ${info.uid ? `[${info.uid}]` : ''} ${
+          info.context || ''
+        }: ${info.message}`,
     ),
     // nestWinstonModuleUtilities.format.nestLike('Meta-server', {
     //   prettyPrint: false,

+ 30 - 13
src/meta.gateway.ts

@@ -34,12 +34,13 @@ initLogger('Debug');
   path: '/ws',
 })
 export class MetaGateway
-  implements OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect {
+  implements OnGatewayInit, OnGatewayConnection, OnGatewayDisconnect
+{
   constructor(
     private readonly sceneService: SceneService,
     private readonly configService: ConfigService,
     @Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger,
-  ) { }
+  ) {}
   // private logger: Logger = new Logger('MetaGateway');
   private peer: PeerConnection = null;
   private timer: NodeJS.Timeout;
@@ -84,7 +85,7 @@ export class MetaGateway
   @SubscribeMessage('init_webrtc')
   handleInitWebRtc(client: any, payload: any): void {
     this.logger.info('action::handleInitWebRtc', JSON.stringify(payload));
-    this.logger.log('debug', `socket::开始`);
+    this.logger.warn('bootstrap:socket::start' + JSON.stringify(payload));
     const stun_server = this.configService.get('stun.server');
     const portRangeBegin = this.configService.get('stun.portRangeBegin');
     const portRangeEnd = this.configService.get('stun.portRangeEnd');
@@ -106,7 +107,9 @@ export class MetaGateway
         id: 'offer',
         data: Buffer.from(JSON.stringify(offer)).toString('base64'),
       };
-      this.logger.info('peer::onLocalDescription', JSON.stringify(offerFormat));
+      this.logger.warn(
+        'bootstrap:onLocalDescription::start' + JSON.stringify(offerFormat),
+      );
       client.send(JSON.stringify(offerFormat));
     });
 
@@ -139,8 +142,6 @@ export class MetaGateway
           return;
         }
       }
-      this.logger.warn('onLocalCandidate last Candidate:' + candidate);
-
       const iceRes = {
         candidate,
         sdpMid: mid,
@@ -161,13 +162,16 @@ export class MetaGateway
       };
 
       client.send(JSON.stringify(res));
+      this.logger.warn('bootstrap:peer::onLocalCandidate' + candidate);
     });
 
     this.peer.onStateChange((state) => {
       console.log('peer-State:', state);
+      this.logger.warn('bootstrap:peer::onStateChange' + state);
     });
     this.peer.onGatheringStateChange((state) => {
       console.log('GatheringState:', state);
+      this.logger.warn('bootstrap:peer::GatheringState' + state);
     });
 
     this.peer.onTrack((track) => {
@@ -185,13 +189,13 @@ export class MetaGateway
 
     this.gameChanel.onOpen(() => {
       if (this.gameChanel.isOpen()) {
-        this.logger.info('channel is open');
         const peers = this.peer.getSelectedCandidatePair();
         this.logger.info('配对成功::' + JSON.stringify(peers));
         this.sendWertcHeartPack(this.gameChanel);
         this.sceneService.handleDataChanelOpen(this.gameChanel, this.peer);
+        this.logger.warn('bootstrap:peer::dataChanel --->' + 'onOpen');
       } else {
-        this.logger.error('gameChanel has problem');
+        this.logger.warn('bootstrap:peer::dataChanel --->' + ' has problem');
       }
 
       // Number.prototype.padLeft = function (n, str) {
@@ -200,6 +204,7 @@ export class MetaGateway
     });
     this.gameChanel.onClosed(() => {
       console.log('gameChanel close');
+      this.logger.warn('bootstrap:peer::dataChanel --->' + 'close');
       this.sceneService.handleDataChanelClose();
       this.stopSendWertcHeartPack();
       cleanup();
@@ -210,8 +215,9 @@ export class MetaGateway
     this.gameChanel.onMessage((event) => {
       this.sceneService.handleMessage(event);
     });
-    this.gameChanel.onError(() => {
+    this.gameChanel.onError((error) => {
       console.log('gameChanel onError');
+      this.logger.warn('bootstrap:peer::dataChanel --->' + 'onError' + error);
       this.stopSendWertcHeartPack();
     });
   }
@@ -234,7 +240,9 @@ export class MetaGateway
   handlerIceCandidate(client: any, payload: any) {
     const iceCandidate = Buffer.from(payload, 'base64').toString('utf-8');
     const candidate = JSON.parse(iceCandidate);
-    this.logger.info('server get ice_candidate' + JSON.stringify(candidate));
+    this.logger.warn(
+      'bootstrap:peer::ice_candidate --->' + JSON.stringify(candidate),
+    );
     this.peer.addRemoteCandidate(candidate.candidate, candidate.sdpMid);
   }
 
@@ -245,6 +253,10 @@ export class MetaGateway
     const clientAnswer = JSON.parse(answer);
     this.peer.setLocalDescription(clientAnswer.sdp);
     this.peer.setRemoteDescription(clientAnswer.sdp, clientAnswer.type);
+    this.logger.warn(
+      'bootstrap:peer::setRemoteDescription --->' +
+        JSON.stringify(clientAnswer),
+    );
   }
 
   @SubscribeMessage('start')
@@ -256,6 +268,10 @@ export class MetaGateway
         user_id: this.user_id,
         roomId: this.roomId,
       });
+      this.logger.defaultMeta = {
+        uid: this.user_id,
+        rid: this.roomId,
+      };
       this.sceneService.init(requestPayLoad);
       this.logger.log(
         'info',
@@ -278,11 +294,12 @@ export class MetaGateway
         (val) => {
           if (val) {
             console.log('onSteaming-start', val);
+            this.logger.warn('bootstrap:socket::handlerWebrtcStart --->');
             client.send(JSON.stringify(startReply));
           }
         },
       );
-    } catch (error) { }
+    } catch (error) {}
   }
 
   handleConnection(client: WebSocket, ...args: any[]) {
@@ -318,8 +335,8 @@ export class MetaGateway
 
     client.send(tt);
   }
-  handleDisconnect(client: WebSocket) {
-    this.logger.info(`Client disconnected: ${client.id}`);
+  handleDisconnect() {
+    this.logger.warn('bootstrap:socket::disconnected --->');
     this.peer && this.peer.close();
     if (this.startstreamingSub) {
       this.startstreamingSub.unsubscribe();

+ 73 - 71
src/move/move.service.ts

@@ -9,8 +9,8 @@ import configuration from 'src/config/configuration';
 // import * as  BreakPointIds from '../../ws/points-BreakPointId.json';
 // import { SceneService } from 'src/scene/scene.service';
 
-const MaxDelayTime = 80;   //超过这个值就需要干预(操作杆)
-const MaxBufferCameraInfo = 3;   //超过这个值就需要干预(操作杆)
+const MaxDelayTime = 80; //超过这个值就需要干预(操作杆)
+const MaxBufferCameraInfo = 3; //超过这个值就需要干预(操作杆)
 const MaxNet = 3;
 
 const seqExeAsyncFn = (asyncFn) => {
@@ -359,7 +359,7 @@ export class MoveService implements OnModuleInit {
     );
     const user = this.users[userId];
     let i;
-    for (i = 1; i < moveFrames.length; i+=3) {
+    for (i = 1; i < moveFrames.length; i += 3) {
       const moveFrame = moveFrames[i];
       const reply = JSON.parse(JSON.stringify(this.reply));
       if (reply.traceIds.indexOf(traceId) == -1) {
@@ -797,17 +797,20 @@ export class MoveService implements OnModuleInit {
         );
         this.reply.actionResponses[0].actionType = actionType;
 
-        console.log('20220708_延时->'+time_delay);
+        console.log('20220708_延时->' + time_delay);
         // //网络延迟的情况下,就暂时不推流
-        if(time_delay && time_delay>MaxDelayTime){
+        if (time_delay && time_delay > MaxDelayTime) {
           user.netQua = 0;
-        }
-        else if(time_delay && time_delay<MaxDelayTime && user.netQua<MaxNet){
-          ++user.netQua
+        } else if (
+          time_delay &&
+          time_delay < MaxDelayTime &&
+          user.netQua < MaxNet
+        ) {
+          ++user.netQua;
         }
 
-        if(user.netQua<MaxNet){
-          if(user.lastJoyStickMediaSrc){
+        if (user.netQua < MaxNet) {
+          if (user.lastJoyStickMediaSrc) {
             user.lastJoyStickMediaSrc = false;
             return this.reply;
           }
@@ -826,7 +829,7 @@ export class MoveService implements OnModuleInit {
             this.reply.mediaSrc = cameraInfo.mediaSrc;
             this.reply.isIDR = cameraInfo.isIDR;
             user.lastJoyStickMediaSrc = true;
-            console.log('20220708_mediaSrc1:'+cameraInfo.mediaSrc);
+            console.log('20220708_mediaSrc1:' + cameraInfo.mediaSrc);
           }
 
           user.camera.position = JSON.parse(
@@ -1275,7 +1278,13 @@ export class MoveService implements OnModuleInit {
         chooseBreakPointId,
         index,
       );
-      this.setCameraInfo(appId, userId, moveFrames, breakPointId, chooseBreakPointId);
+      this.setCameraInfo(
+        appId,
+        userId,
+        moveFrames,
+        breakPointId,
+        chooseBreakPointId,
+      );
 
       user.breakPointId = chooseBreakPointId;
 
@@ -1314,7 +1323,7 @@ export class MoveService implements OnModuleInit {
     }
   }
 
-  setCameraInfo(appId, userId,moveFrames, startBreakPointId, endBreakPointId) {
+  setCameraInfo(appId, userId, moveFrames, startBreakPointId, endBreakPointId) {
     // let moveInterval = 1;
     // console.log('20220708_cameraInfos设置->'+this.cameraInfos.length);
     // if(this.cameraInfos.length>MaxBufferCameraInfo){
@@ -1324,8 +1333,8 @@ export class MoveService implements OnModuleInit {
     let moveInterval = 2;
     let flag = false;
     for (let i = 0; i < moveFrames.length; ++i) {
-      if(user.netQua<MaxNet){
-        if(i!= 0 && i!= moveFrames.length-1 && i%moveInterval == 0){
+      if (user.netQua < MaxNet) {
+        if (i != 0 && i != moveFrames.length - 1 && i % moveInterval == 0) {
           continue;
         }
       }
@@ -1363,10 +1372,10 @@ export class MoveService implements OnModuleInit {
           '?m=' +
           new Date().getTime();
       }
-      console.log('20220708_mediaSrc3:'+moveFrames[i].mediaSrc);
+      console.log('20220708_mediaSrc3:' + moveFrames[i].mediaSrc);
       if (i == 0 || i == moveFrames.length - 1) {
         moveFrames[i].isIDR = true;
-        if(i == moveFrames.length - 1){
+        if (i == moveFrames.length - 1) {
           flag = true;
         }
       } else {
@@ -1374,8 +1383,8 @@ export class MoveService implements OnModuleInit {
       }
       this.cameraInfos.push(moveFrames[i]);
     }
-    if(!flag){
-      const cameraInfo = moveFrames[moveFrames.length-1];
+    if (!flag) {
+      const cameraInfo = moveFrames[moveFrames.length - 1];
       cameraInfo.endBreakPointId = endBreakPointId;
       cameraInfo.mediaSrc =
         '/' +
@@ -1383,10 +1392,7 @@ export class MoveService implements OnModuleInit {
         '/' +
         startBreakPointId +
         '/' +
-        cameraInfo.file_name.substring(
-          0,
-          cameraInfo.file_name.indexOf('.'),
-        ) +
+        cameraInfo.file_name.substring(0, cameraInfo.file_name.indexOf('.')) +
         '/' +
         cameraInfo.file_name +
         '?m=' +
@@ -1399,10 +1405,7 @@ export class MoveService implements OnModuleInit {
           '/' +
           endBreakPointId +
           '/' +
-          cameraInfo.file_name.substring(
-            0,
-            cameraInfo.file_name.indexOf('.'),
-          ) +
+          cameraInfo.file_name.substring(0, cameraInfo.file_name.indexOf('.')) +
           '/' +
           cameraInfo.file_name +
           '?m=' +
@@ -1410,7 +1413,7 @@ export class MoveService implements OnModuleInit {
       }
       cameraInfo.isIDR = true;
       this.cameraInfos.push(cameraInfo);
-      console.log('20220708_mediaSrc4:'+cameraInfo.mediaSrc);
+      console.log('20220708_mediaSrc4:' + cameraInfo.mediaSrc);
     }
   }
 
@@ -1426,7 +1429,7 @@ export class MoveService implements OnModuleInit {
   getCameraInfo() {
     if (this.cameraInfos.length > 0) {
       const item = this.cameraInfos.shift();
-      console.log('20220708_cameraInfos取值->'+this.cameraInfos.length);
+      console.log('20220708_cameraInfos取值->' + this.cameraInfos.length);
       return item;
     } else {
       return null;
@@ -1507,9 +1510,8 @@ export class MoveService implements OnModuleInit {
   //   return JSON.parse(JSON.stringify(this.reply));
   // }
 
-  async updateCameraInfoForDely(appId,userId,path){
-
-    if(path == null){
+  async updateCameraInfoForDely(appId, userId, path) {
+    if (path == null) {
       this.cameraInfos = [];
       return;
     }
@@ -1531,32 +1533,32 @@ export class MoveService implements OnModuleInit {
       if (!moveFrames) {
         return null;
       }
-      frames = frames.concat(moveFrames)
+      frames = frames.concat(moveFrames);
       pointIds.push({
-        index:frames.length,
-        startBreakPointId:start_break_point_id,
-        endBreakPointId:end_break_point_id
+        index: frames.length,
+        startBreakPointId: start_break_point_id,
+        endBreakPointId: end_break_point_id,
       });
     }
     this.cameraInfos = [];
-    const interval = Math.floor(frames.length/12);
-    for (let i = 0; i < frames.length-1; i+=interval) {
+    const interval = Math.floor(frames.length / 12);
+    for (let i = 0; i < frames.length - 1; i += interval) {
       const frame = frames[i];
       let isIDR = false;
-      if(i == 0){
+      if (i == 0) {
         isIDR = true;
       }
 
-      let startBreakPointId,endBreakPointId;
-      for(let j=0;j<pointIds.length;++j){
-        if(i<pointIds[j].index+1){
+      let startBreakPointId, endBreakPointId;
+      for (let j = 0; j < pointIds.length; ++j) {
+        if (i < pointIds[j].index + 1) {
           startBreakPointId = pointIds[j].startBreakPointId;
           endBreakPointId = pointIds[j].endBreakPointId;
           break;
         }
       }
 
-        let mediaSrc =
+      let mediaSrc =
         '/' +
         appId +
         '/' +
@@ -1580,10 +1582,10 @@ export class MoveService implements OnModuleInit {
           '?m=' +
           new Date().getTime();
       }
-      console.log('20220708_mediaSrc2:'+mediaSrc);
+      console.log('20220708_mediaSrc2:' + mediaSrc);
       this.cameraInfos.push({
-        startBreakPointId:startBreakPointId,
-        endBreakPointId:endBreakPointId,
+        startBreakPointId: startBreakPointId,
+        endBreakPointId: endBreakPointId,
         camera_position: frame.camera_position,
         camera_angle: frame.camera_angle,
         mediaSrc: mediaSrc,
@@ -1591,41 +1593,41 @@ export class MoveService implements OnModuleInit {
       });
     }
 
-    const startBreakPointId = pointIds[pointIds.length-1].startBreakPointId;
-    const endBreakPointId = pointIds[pointIds.length-1].endBreakPointId;
-    const frame = frames[frames.length-1];
+    const startBreakPointId = pointIds[pointIds.length - 1].startBreakPointId;
+    const endBreakPointId = pointIds[pointIds.length - 1].endBreakPointId;
+    const frame = frames[frames.length - 1];
     let mediaSrc =
+      '/' +
+      appId +
+      '/' +
+      startBreakPointId +
+      '/' +
+      frame.file_name.substring(0, frame.file_name.indexOf('.')) +
+      '/' +
+      frame.file_name +
+      '?m=' +
+      new Date().getTime();
+    if (startBreakPointId > endBreakPointId) {
+      frame.mediaSrc =
         '/' +
         appId +
         '/' +
-        startBreakPointId +
+        endBreakPointId +
         '/' +
         frame.file_name.substring(0, frame.file_name.indexOf('.')) +
         '/' +
         frame.file_name +
         '?m=' +
         new Date().getTime();
-      if (startBreakPointId > endBreakPointId) {
-        frame.mediaSrc =
-          '/' +
-          appId +
-          '/' +
-          endBreakPointId +
-          '/' +
-          frame.file_name.substring(0, frame.file_name.indexOf('.')) +
-          '/' +
-          frame.file_name +
-          '?m=' +
-          new Date().getTime();
-      }
-      this.cameraInfos.push({
-        startBreakPointId:startBreakPointId,
-        endBreakPointId:endBreakPointId,
-        camera_position: frame.camera_position,
-        camera_angle: frame.camera_angle,
-        mediaSrc: mediaSrc,
-        isIDR: true,
-      });
+    }
+    this.cameraInfos.push({
+      startBreakPointId: startBreakPointId,
+      endBreakPointId: endBreakPointId,
+      camera_position: frame.camera_position,
+      camera_angle: frame.camera_angle,
+      mediaSrc: mediaSrc,
+      isIDR: true,
+    });
   }
 
   stopJoystick(userId) {

+ 2 - 2
src/rotate/rotate.service.ts

@@ -90,7 +90,7 @@ export class RotateService {
         horizontal_move: 0,
       },
       moveInfo: {},
-      netQua:3,
+      netQua: 3,
       // traceIds: [],
       // actionResponses:[]
     };
@@ -108,7 +108,7 @@ export class RotateService {
     user.camera.position = JSON.parse(
       JSON.stringify(this.firstPoint.camera.position),
     );
-    
+
     console.log('user-init', user);
     this.users[userId] = user;
 

+ 90 - 79
src/scene/scene.service.ts

@@ -45,7 +45,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
     private moveService: MoveService,
     private getRouterService: GetRouterService,
     @Inject(WINSTON_MODULE_PROVIDER) private readonly logger: Logger,
-  ) { }
+  ) {}
   @Client(grpcClientOptions) private readonly client: ClientGrpc;
 
   public _frameInteval: NodeJS.Timeout;
@@ -311,7 +311,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
             const rounded = Number(inMillSeconds).toFixed(3);
             this.logger.info(
               `[timer]-rotate-入队列前: ${rounded}ms -->` +
-              JSON.stringify(stream),
+                JSON.stringify(stream),
             );
             if (!this.stopRotated) {
               await this.seqExehandleRotateStream(stream);
@@ -508,16 +508,16 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
     const playerAngle = newUserStates.playerState.player.angle;
     this.logger.info(
       'stop-data-0' +
-      'trace_id: ' +
-      trace_id +
-      'userId:' +
-      userId +
-      'breakPointId :' +
-      breakPointId +
-      'cameraAngle :' +
-      JSON.stringify(cameraAngle) +
-      'playerAngle: ' +
-      JSON.stringify(playerAngle),
+        'trace_id: ' +
+        trace_id +
+        'userId:' +
+        userId +
+        'breakPointId :' +
+        breakPointId +
+        'cameraAngle :' +
+        JSON.stringify(cameraAngle) +
+        'playerAngle: ' +
+        JSON.stringify(playerAngle),
     );
     //debugger;
     console.log('moveService.stop-1:' + breakPointId);
@@ -563,15 +563,20 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
 
   async getSimplestCameraInfo(appId, userId) {
     if (this.moveService.cameraInfos.length > 20) {
-      const startBreakPointId = this.moveService.cameraInfos[0].startBreakPointId;
-      const endBreakPointId = this.moveService.cameraInfos[this.moveService.cameraInfos.length - 1].endBreakPointId;
-
-      const path = this.getRouterService.searchRoad2(startBreakPointId, endBreakPointId);
+      const startBreakPointId =
+        this.moveService.cameraInfos[0].startBreakPointId;
+      const endBreakPointId =
+        this.moveService.cameraInfos[this.moveService.cameraInfos.length - 1]
+          .endBreakPointId;
+
+      const path = this.getRouterService.searchRoad2(
+        startBreakPointId,
+        endBreakPointId,
+      );
       if (path == null) {
         //可以清空cameraInfos
         this.moveService.cameraInfos = [];
-      }
-      else {
+      } else {
         await this.moveService.updateCameraInfoForDely(appId, userId, path);
       }
     }
@@ -697,15 +702,15 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
       console.log('进入1 - searchRoad');
       this.logger.info(
         'handleWalking-users' +
-        JSON.stringify(this.moveService.users) +
-        ' this.user_id: ' +
-        this.user_id,
+          JSON.stringify(this.moveService.users) +
+          ' this.user_id: ' +
+          this.user_id,
       );
       this.logger.info(
         'handleWalking-currentUser' +
-        JSON.stringify(user) +
-        ' this.user_id: ' +
-        this.user_id,
+          JSON.stringify(user) +
+          ' this.user_id: ' +
+          this.user_id,
       );
       console.log('path-start' + user.breakPointId);
 
@@ -737,7 +742,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
               (item: StreamReplyType, index: number) => {
                 console.log(
                   '20220628test:handleWalking->' +
-                  item['newUserStates'][0].renderInfo.isMoving,
+                    item['newUserStates'][0].renderInfo.isMoving,
                 );
                 //const IDRflag = index % 5 === 0 ? 1 : 3;
                 const IDRflag = item.isIDR ? 1 : 3;
@@ -764,16 +769,16 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
         if (seqs?.length) {
           this.logger.info(
             'walking --队列总览:' +
-            ' 总段数: ' +
-            walkingRes.length +
-            ' 镜头帧数:' +
-            walkingRes[0].length +
-            ' 行走段数:' +
-            (walkingRes[0]?.length
-              ? walkingRes.length - 1
-              : walkingRes.length) +
-            ' 队列总帧数:' +
-            seqs.length,
+              ' 总段数: ' +
+              walkingRes.length +
+              ' 镜头帧数:' +
+              walkingRes[0].length +
+              ' 行走段数:' +
+              (walkingRes[0]?.length
+                ? walkingRes.length - 1
+                : walkingRes.length) +
+              ' 队列总帧数:' +
+              seqs.length,
           );
           const stop = performance.now();
           const inMillSeconds = stop - start;
@@ -812,7 +817,10 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
    */
   async joystick(request: JoystickRequest) {
     // TODO hasJoystickMoveRequest中断
-    this.logger.info('this.hasJoystickMoveRequest', this.hasJoystickMoveRequest);
+    this.logger.info(
+      'this.hasJoystickMoveRequest',
+      this.hasJoystickMoveRequest,
+    );
     if (!this.hasJoystickMoveRequest) {
       this.handlejoystick(request);
     }
@@ -831,7 +839,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
     //console.log('joystickRes有mediaSrc', joystickRes.mediaSrc);
     console.log(
       'handlejoystick-angle->相机角度-------------------------:' +
-      joystickRes['newUserStates'][0].playerState.camera.angle.yaw,
+        joystickRes['newUserStates'][0].playerState.camera.angle.yaw,
     );
     let streamData: StreamFrameType | StreamMetaType;
 
@@ -853,11 +861,11 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
       };
       console.log(
         'handlejoystick-hasMedia->-------------------------:' +
-        ' frame: ' +
-        streamData.frame +
-        mediaSrc +
-        '  IDR :' +
-        setDIR,
+          ' frame: ' +
+          streamData.frame +
+          mediaSrc +
+          '  IDR :' +
+          setDIR,
       );
     } else {
       streamData = {
@@ -876,8 +884,8 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
     const hasPush = hasMedia
       ? await this.streamService.pushFrameToSteam(streamData as StreamFrameType)
       : await this.streamService.pushMetaDataToSteam(
-        streamData as StreamMetaType,
-      );
+          streamData as StreamMetaType,
+        );
 
     if (hasPush.done) {
       this.isJoystickHasStream = true;
@@ -914,9 +922,9 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
         if (complementFrame) {
           console.log(
             '20220627test-complementFrame 进行' +
-            complementFrame.mediaSrc +
-            '***' +
-            this.frameCnt.value,
+              complementFrame.mediaSrc +
+              '***' +
+              this.frameCnt.value,
           );
           // 第二次或N次进入时如果有值直接重新进入流主程
           this.holdSteam();
@@ -991,7 +999,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
       const joystickRes = await this.moveService.seqExeJoystick(request);
       this.logger.info(
         'joystick-breakPointId:' +
-        this.moveService.users[this.user_id].breakPointId,
+          this.moveService.users[this.user_id].breakPointId,
       );
       // 有数据 [0]是rotate数据,[1-infinity]是walking数据
       //this.logger.info('joystickRes', JSON.stringify(joystickRes));
@@ -1076,14 +1084,14 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
         };
         this.logger.info(
           '[media-move]: ' +
-          ', moveframeCnt: ' +
-          this.moveframeCnt +
-          ', clipPath: ' +
-          stream.clipPath +
-          ', mType: ' +
-          stream.mType +
-          ', DIR: ' +
-          stream.DIR,
+            ', moveframeCnt: ' +
+            this.moveframeCnt +
+            ', clipPath: ' +
+            stream.clipPath +
+            ', mType: ' +
+            stream.mType +
+            ', DIR: ' +
+            stream.DIR,
           // stream.metaData,
         );
         this.logger.info(
@@ -1181,6 +1189,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
     this.peer = peer;
     this.streamService.setChannel(channel);
     this.startSteaming.next(true);
+
     // this.startStream();
     // this.handleStream();
     //TODO 正式channel打开记录,记录多少人在线
@@ -1356,16 +1365,16 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
           this.logger.info('frame: ' + frame);
           console.log(
             'networkState:::--->' +
-            ' maxMessageSize: ' +
-            this.channel.maxMessageSize() +
-            ' bytesReceived: ' +
-            this.peer.bytesReceived() +
-            ' bytesSent: ' +
-            this.peer.bytesSent() +
-            ' rtt: ' +
-            this.peer.rtt() +
-            ' state: ' +
-            this.peer.state(),
+              ' maxMessageSize: ' +
+              this.channel.maxMessageSize() +
+              ' bytesReceived: ' +
+              this.peer.bytesReceived() +
+              ' bytesSent: ' +
+              this.peer.bytesSent() +
+              ' rtt: ' +
+              this.peer.rtt() +
+              ' state: ' +
+              this.peer.state(),
           );
           if (frame === 1) {
             // redisData = await this.rotateService.echo(this.user_id, true);
@@ -1375,7 +1384,9 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
               app_id,
               this.user_id,
             );
-            this.logger.info('获取-首屏', redisData);
+            this.logger.warn(
+              'bootstrap:socket::首屏 --->' + JSON.stringify(redisData),
+            );
             this.onSteaming = true;
             this.holdSteam();
             if (redisData && 'mediaSrc' in redisData) {
@@ -1386,7 +1397,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
                 delete redisData.mediaSrc;
                 this.logger.info(
                   `user:${this.user_id}:first render stream` +
-                  JSON.stringify({ path: clipPath, meta: redisData }),
+                    JSON.stringify({ path: clipPath, meta: redisData }),
                 );
                 const status = await this.pushFirstRender(
                   clipPath,
@@ -1415,17 +1426,17 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
 
             console.log(
               '空白流条件-->:' +
-              isOk +
-              ' onMoving: ' +
-              this.onMoving.value +
-              ' onRotating: ' +
-              this.onRotating.value +
-              ' onJoysticking: ' +
-              this.onJoysticking.value +
-              ' onSteaming: ' +
-              this.onSteaming +
-              ' firstRender: ' +
-              this.firstRender,
+                isOk +
+                ' onMoving: ' +
+                this.onMoving.value +
+                ' onRotating: ' +
+                this.onRotating.value +
+                ' onJoysticking: ' +
+                this.onJoysticking.value +
+                ' onSteaming: ' +
+                this.onSteaming +
+                ' firstRender: ' +
+                this.firstRender,
             );
           }