test pc 3 年 前
コミット
2c5b2d6d07
4 ファイル変更228 行追加247 行削除
  1. 2 2
      config.dev.yaml
  2. 206 231
      src/move/move.service.ts
  3. 12 7
      src/rotate/rotate.service.ts
  4. 8 7
      src/scene/scene.service.ts

+ 2 - 2
config.dev.yaml

@@ -1,8 +1,8 @@
 
 app:
   prefix: /mnt/metaverse/scene
-  startPoint: 141 #29
-  appId: "0000000007" #"0000000003"
+  startPoint: 22 #141 #29
+  appId: "0000000008" #"0000000007" #"0000000003"
 
 log:
   logFolder: /var/log/metaverse

+ 206 - 231
src/move/move.service.ts

@@ -27,7 +27,7 @@ const seqExeAsyncFn = (asyncFn) => {
   };
 };
 
-const moveInterval = 3;
+let moveInterval = 3;
 
 @Injectable()
 export class MoveService implements OnModuleInit {
@@ -132,7 +132,7 @@ export class MoveService implements OnModuleInit {
   };
   private breakPointInfo: any;
 
-  private cameraInfos = [];
+  public cameraInfos = [];
   public sendingFrameForJoystick = false;
 
   // eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -261,7 +261,6 @@ export class MoveService implements OnModuleInit {
       const replys = [];
       const traceIds = [];
       traceIds.push(traceId);
-
       const checkReplys = await this.modeifyCameraAngle(
         angle,
         userId,
@@ -285,6 +284,7 @@ export class MoveService implements OnModuleInit {
       this.reply['actionResponses'][0].traceId = traceId;
       //const index = Math.floor((user.camera.angle.yaw + 1) / 45) % 8; //过渡需要
       const index = this.getMoveIndex(user.camera.angle.yaw);
+      
       for (let i = 0; i < path.length - 1; ++i) {
         const start_break_point_id = path[i];
         const end_break_point_id = path[i + 1];
@@ -315,18 +315,20 @@ export class MoveService implements OnModuleInit {
           pathReplys[0].isIDR = true;
         }
         //最后一段
-        else if (i == path.length - 2) {
+        if (i == path.length - 2) {
           //最后一帧
           pathReplys[pathReplys.length - 1][
             'newUserStates'
           ][0].renderInfo.isMoving = 0;
         }
+        
         for (let j = 0; j < pathReplys.length; ++j) {
           pathReplys[j].actionResponses[0].actionType = actionType;
         }
         replys.push(pathReplys);
         //replys['P' + start_break_point_id + 'T' + end_break_point_id] =pathReplys;
       }
+
       return replys;
     } catch (error) {
       console.log('MoveService', error);
@@ -434,11 +436,12 @@ export class MoveService implements OnModuleInit {
 
       reply.startBreakPointId = startBreakPointId;
       reply.endBreakPointId = endBreakPointId;
-      if (i == moveFrames.length - 1) {
-        reply.isIDR = true;
-      } else {
-        reply.isIDR = false;
-      }
+      // if (i == moveFrames.length - 1) {
+      //   reply.isIDR = true;
+      // } else {
+      //   reply.isIDR = false;
+      // }
+      reply.isIDR = false;
       replys.push(reply);
     }
     if (i != moveFrames.length - 1) {
@@ -515,9 +518,9 @@ export class MoveService implements OnModuleInit {
       }
       reply.startBreakPointId = startBreakPointId;
       reply.endBreakPointId = endBreakPointId;
-      reply.isIDR = true;
       replys.push(reply);
     }
+    replys[replys.length-1].isIDR = true;
     return replys;
   }
 
@@ -651,222 +654,181 @@ export class MoveService implements OnModuleInit {
   // 顺序旋转请求
   seqExeJoystick = seqExeAsyncFn(this.joystick);
 
-  // async joystick(actionRequest) {
-  //   try {
-  //     const userId = actionRequest['user_id'];
-  //     const traceId = actionRequest['trace_id'];
-  //     const dir_action = actionRequest['dir_action'];
-  //     const actionType = actionRequest['action_type'];
-  //     const user = this.users[userId];
-  //     const breakPointId = user.breakPointId;
-  //     const appId = user.appId;
-
-  //     const replys = [];
-  //     const step = 0.3;
-  //     const closestDis = 85; //小于这个距离就跳到邻居呼吸点
-  //     const distance = step * dir_action.speed_level;
-  //     let angle = null;
-  //     let move_angle = dir_action.move_angle + user.camera.angle.yaw;
-  //     move_angle = move_angle % 360;
-
-  //     //TODO 临时增加断言
-  //     const playerPosition: Point = { x: 0, y: 0, z: 0 };
-  //     playerPosition.x =
-  //       user.player.position.x +
-  //       distance * Math.cos((move_angle / 360) * 2 * Math.PI);
-  //     playerPosition.y =
-  //       user.player.position.y +
-  //       distance * Math.sin((move_angle / 360) * 2 * Math.PI);
-
-  //     //找到邻居点,判断user.player.position与邻居点的距离,如果距离小于closestDis,就要更新camera的position
-  //     let chooseBreakPointId = null;
-  //     const breakPoint = this.breakPointInfo[breakPointId];
-  //     const surroundPointIds = breakPoint.contact;
-  //     //const neighAngles = [];
-  //     const traceIds = [];
-
-  //     user.player.angle.yaw = move_angle;
-  //     traceIds.push(traceId);
-  //     this.reply.traceIds = traceIds;
-  //     this.reply['newUserStates'][0].userId = userId;
-  //     this.reply['actionResponses'][0].traceId = traceId;
-  //     this.reply['newUserStates'][0].playerState.player.angle.yaw = move_angle;
-
-  //     this.reply['newUserStates'][0].playerState.camera.angle = JSON.parse(
-  //       JSON.stringify(user.camera.angle),
-  //     );
-  //     this.reply['newUserStates'][0].playerState.camera.position = JSON.parse(
-  //       JSON.stringify(user.camera.position),
-  //     );
-  //     this.reply['newUserStates'][0].playerState.cameraCenter = JSON.parse(
-  //       JSON.stringify(breakPoint.position),
-  //     );
-  //     this.reply['newUserStates'][0].renderInfo.isMoving = 1;
-  //     this.reply['actionResponses'][0].traceId = traceId;
-  //     this.reply.mediaSrc = null;
-
-  //     if (surroundPointIds.length == 1) {
-  //       return await this.moveDirect(
-  //         playerPosition,
-  //         closestDis,
-  //         breakPointId,
-  //         surroundPointIds[0],
-  //         appId,
-  //         userId,
-  //         traceId,
-  //         actionType,
-  //       );
-  //     }
-
-  //     let count = 0;
-  //     const neighPoints = [];
-  //     //人在哪个角度
-  //     let _angle = this.getAngle(
-  //       breakPoint.position,
-  //       { x: breakPoint.position.x + 1, y: breakPoint.position.y },
-  //       playerPosition,
-  //     );
-  //     if (_angle < 0) {
-  //       _angle += 360;
-  //     }
-
-  //     let singleInfo = null;
-  //     for (let i = 0; i < surroundPointIds.length; ++i) {
-  //       const neighPoint = this.breakPointInfo[surroundPointIds[i]];
-  //       neighPoint.breakPointId = surroundPointIds[i];
-  //       angle = this.getAngle(
-  //         breakPoint.position,
-  //         { x: breakPoint.position.x + 1, y: breakPoint.position.y },
-  //         neighPoint.position,
-  //       );
-  //       if (angle < 0) {
-  //         angle += 360;
-  //       }
-
-  //       //if(angle<45&&angle!=0){
-  //       if (
-  //         // Math.abs(angle - move_angle) < 45 &&
-  //         // Math.abs(angle - move_angle) != 0
-  //         Math.abs(angle - _angle) < 45 &&
-  //         Math.abs(angle - _angle) != 0
-  //       ) {
-  //         neighPoint.angle = angle;
-  //         neighPoints.push(neighPoint);
-  //         ++count;
-  //       } else if (Math.abs(angle - move_angle) == 0) {
-  //         return await this.moveDirect(
-  //           playerPosition,
-  //           closestDis,
-  //           breakPointId,
-  //           surroundPointIds[i],
-  //           appId,
-  //           userId,
-  //           traceId,
-  //           actionType,
-  //         );
-  //       }
-
-  //       //if (angle == 0 && Math.abs(360 - move_angle) < 45) {
-  //       if (angle == 0 && Math.abs(360 - _angle) < 45) {
-  //         neighPoint.angle = angle;
-  //         neighPoints.push(neighPoint);
-  //         ++count;
-  //       }
-
-  //       if(Math.abs(angle - move_angle)<45||Math.abs(angle+360 - move_angle)<45){
-  //         if(singleInfo == null){
-  //           singleInfo = {
-  //             angle:angle,
-  //             breakPointId:surroundPointIds[i]
-  //           }
-  //         }
-  //       }
-  //     }
-
-  //     if (count == 2) {
-  //       //人物移动
-  //       user.player.position = JSON.parse(JSON.stringify(playerPosition));
-  //       this.reply['newUserStates'][0].playerState.player.position = JSON.parse(
-  //         JSON.stringify(playerPosition),
-  //       );
-  //     }
-  //     else{
-  //       if(singleInfo != null){
-  //         return await this.moveDirect(
-  //           playerPosition,
-  //           closestDis,
-  //           breakPointId,
-  //           singleInfo.breakPointId,
-  //           appId,
-  //           userId,
-  //           traceId,
-  //           actionType,
-  //         );
-  //       }
-  //       else if (count == 1) {
-  //         return await this.moveDirect(
-  //           playerPosition,
-  //           closestDis,
-  //           breakPointId,
-  //           neighPoints[0].breakPointId,
-  //           appId,
-  //           userId,
-  //           traceId,
-  //           actionType,
-  //         );
-  //       }
-  //       else if (count == 0) {
-  //         this.reply['newUserStates'][0].playerState.player.position = JSON.parse(
-  //           JSON.stringify(user.player.position),
-  //         );
-  //         this.reply.actionResponses[0].actionType = actionType;
-  //         return this.reply;
-  //       }
-  //     }
-
-  //     //count == 2
-  //     //超出范围了
-  //     if (this.getDistance(playerPosition, breakPoint.position) > closestDis) {
-  //       let offsetAngle1 = Math.abs(_angle - neighPoints[0].angle);
-  //       if (neighPoints[0].angle == 0) {
-  //         offsetAngle1 = Math.min(offsetAngle1, Math.abs(_angle - 360));
-  //       }
-
-  //       let offsetAngle2 = Math.abs(_angle - neighPoints[1].angle);
-  //       if (neighPoints[1].angle == 0) {
-  //         offsetAngle2 = Math.min(offsetAngle2, Math.abs(_angle - 360));
-  //       }
-
-  //       if (offsetAngle1 > offsetAngle2) {
-  //         chooseBreakPointId = neighPoints[1].breakPointId;
-  //       } else {
-  //         chooseBreakPointId = neighPoints[0].breakPointId;
-  //       }
-  //       return await this.moveCamera(
-  //         breakPointId,
-  //         chooseBreakPointId,
-  //         appId,
-  //         userId,
-  //         traceId,
-  //         actionType,
-  //       );
-  //     } else {
-  //       user.player.position = JSON.parse(JSON.stringify(playerPosition));
-  //       this.reply['newUserStates'][0].playerState.player.position = JSON.parse(
-  //         JSON.stringify(user.player.position),
-  //       );
-  //       this.reply.actionResponses[0].actionType = actionType;
-  //       return this.reply;
-  //     }
-  //   } catch (error) {
-  //     console.log('MoveService', error);
-  //     debugger;
-  //     return null;
-  //   }
-  // }
-
   async joystick(actionRequest) {
     try {
+      const userId = actionRequest['user_id'];
+      const traceId = actionRequest['trace_id'];
+      const dir_action = actionRequest['dir_action'];
+      const actionType = actionRequest['action_type'];
+      const user = this.users[userId];
+      const breakPointId = user.breakPointId;
+      const appId = user.appId;
+      moveInterval = 1;
+      const replys = [];
+      const step = 0.4;
+      const closestDis = 45; //小于这个距离就跳到邻居呼吸点
+      const distance = step * dir_action.speed_level;
+      let angle = null;
+      let move_angle = dir_action.move_angle + user.camera.angle.yaw;
+      move_angle = move_angle % 360;
+
+      //TODO 临时增加断言
+      const playerPosition: Point = { x: 0, y: 0, z: 0 };
+      playerPosition.x =
+        user.player.position.x +
+        distance * Math.cos((move_angle / 360) * 2 * Math.PI);
+      playerPosition.y =
+        user.player.position.y +
+        distance * Math.sin((move_angle / 360) * 2 * Math.PI);
+
+      //可行走的区域
+      const area = [
+        {x:-600,y:-300},
+        {x:-600,y:250},
+        {x:550,y:250},
+        {x:550,y:-300}
+      ];
+
+      //找到邻居点,判断user.player.position与邻居点的距离,如果距离小于closestDis,就要更新camera的position
+      const breakPoint = this.breakPointInfo[breakPointId];
+      const surroundPointIds = breakPoint.contact;
+      //const neighAngles = [];
+      const traceIds = [];
+
+      user.player.angle.yaw = move_angle;
+      traceIds.push(traceId);
+      this.reply.traceIds = traceIds;
+      this.reply['newUserStates'][0].userId = userId;
+      this.reply['actionResponses'][0].traceId = traceId;
+      this.reply['newUserStates'][0].playerState.player.angle.yaw = move_angle;
+
+      this.reply['newUserStates'][0].playerState.camera.angle = JSON.parse(
+        JSON.stringify(user.camera.angle),
+      );
+      this.reply['newUserStates'][0].playerState.camera.position = JSON.parse(
+        JSON.stringify(user.camera.position),
+      );
+      this.reply['newUserStates'][0].playerState.cameraCenter = JSON.parse(
+        JSON.stringify(user.player.position),
+      );
+      this.reply['newUserStates'][0].renderInfo.isMoving = 1;
+      this.reply['actionResponses'][0].traceId = traceId;
+      this.reply.mediaSrc = null;
+
+      //人在哪个角度
+      let _angle = this.getAngle(
+        breakPoint.position,
+        { x: breakPoint.position.x + 1, y: breakPoint.position.y },
+        playerPosition,
+      );
+
+      //需要找到最近的邻居点和最接近角度的邻居点
+      let closestNeighorId = null;
+      let closestDisNeighor = null;
+
+      //超出行走区域的时候用得上
+      let minAngleNeighorId = null;
+      let closestAngleNeighor = null;
+
+      for (let i = 0; i < surroundPointIds.length; ++i) {
+        const neighPoint = this.breakPointInfo[surroundPointIds[i]];
+        neighPoint.breakPointId = surroundPointIds[i];
+        angle = this.getAngle(
+          breakPoint.position,
+          { x: breakPoint.position.x + 1, y: breakPoint.position.y },
+          neighPoint.position,
+        );
+
+        let distance = this.getDistance(playerPosition,neighPoint.position);
+        if(closestNeighorId == null || closestDisNeighor>distance){
+          closestNeighorId = surroundPointIds[i]
+          closestDisNeighor = distance;
+        }
+
+        if((this.getOffsetAngle(angle , _angle)<90)&&(minAngleNeighorId == null || this.getOffsetAngle(closestAngleNeighor , _angle)>this.getOffsetAngle(angle , _angle))){
+          minAngleNeighorId = surroundPointIds[i]
+          closestAngleNeighor = angle;
+        }
+      }
+
+      //超出范围了
+      if (this.getDistance(playerPosition, breakPoint.position) > closestDis) {
+        console.log('20220627test-joystick-moveCamera')
+        return await this.moveCamera(
+          breakPointId,
+          closestNeighorId,
+          appId,
+          userId,
+          traceId,
+          actionType,
+        );
+      } 
+      else {
+        let inside = this.isPointInPoly(playerPosition, area);
+        //超出区域
+        if(!inside){
+          if(minAngleNeighorId != null){
+            console.log('20220627test-joystick-moveDirect')
+            return await this.moveDirect(
+              playerPosition,
+              closestDis,
+              breakPointId,
+              minAngleNeighorId,
+              appId,
+              userId,
+              traceId,
+              actionType,
+            );
+          }
+          else{
+            return null;
+          }
+        }
+
+        user.player.position = JSON.parse(JSON.stringify(playerPosition));
+        this.reply['newUserStates'][0].playerState.player.position = JSON.parse(
+          JSON.stringify(user.player.position),
+        );
+        this.reply.actionResponses[0].actionType = actionType;
+
+        const cameraInfo = this.getCameraInfo();
+        if (cameraInfo != null) {
+          console.log('20220627test-joystick-自由-合并,'+this.cameraInfos.length)
+          this.reply['newUserStates'][0].playerState.camera.position =
+            cameraInfo.camera_position;
+          this.reply['newUserStates'][0].playerState.camera.angle =
+            cameraInfo.camera_angle;
+
+          if (cameraInfo.mediaSrc) {
+            this.reply.mediaSrc = cameraInfo.mediaSrc;
+            this.reply.isIDR = cameraInfo.isIDR;
+          }
+
+          user.camera.position = JSON.parse(
+            JSON.stringify(cameraInfo.camera_position),
+          );
+          // console.log(
+          //   'handlejoystick-angle->:自由并过渡更新user.angle' +
+          //     cameraInfo.camera_angle.yaw,
+          // );
+          user.camera.angle.yaw = cameraInfo.camera_angle.yaw;
+
+          this.sendingFrameForJoystick = true;
+        } 
+        else{
+          console.log('20220627test-joystick-自由-不合并')
+        }
+        return this.reply;
+      }
+    } catch (error) {
+      console.log('MoveService', error);
+      debugger;
+      return null;
+    }
+  }
+
+  async joystick2(actionRequest) {
+    try {
       if (this.sendingFrameForJoystick) {
         return null;
       }
@@ -1391,7 +1353,7 @@ export class MoveService implements OnModuleInit {
 
   complementFrame(userId) {
     if (this.cameraInfos.length > 0) {
-      //console.log('handlejoysticktesttest:complementFrame-1 继续'+userId+','+new Date().getTime())
+      console.log('20220627test-执行complementFrame,'+new Date().getTime())
       const user = this.users[userId];
       const cameraInfo = this.cameraInfos.shift();
       this.reply.traceIds = [];
@@ -1440,7 +1402,7 @@ export class MoveService implements OnModuleInit {
   }
 
   stopJoystick(userId) {
-    //console.log('handlejoysticktesttest:stopJoystick');
+    console.log('20220627test:stopJoystick');
     this.reply.traceIds = [];
     const user = this.users[userId];
     this.reply['newUserStates'][0].userId = userId;
@@ -1698,19 +1660,19 @@ export class MoveService implements OnModuleInit {
     return parseFloat(num.toFixed(decimal));
   }
 
-  isPointInPoly(position, breakPointIds) {
+  isPointInPoly(position, points) {
     const x = position.x;
     const y = position.y;
 
     let inside = false;
 
     for (
-      let i = 0, j = breakPointIds.length - 1;
-      i < breakPointIds.length;
+      let i = 0, j = points.length - 1;
+      i < points.length;
       j = i++
     ) {
-      const pt1 = this.breakPointInfo[breakPointIds[i]];
-      const pt2 = this.breakPointInfo[breakPointIds[j]];
+      const pt1 = points[i];
+      const pt2 = points[j];
 
       const xi = pt1.x;
       const yi = pt1.y;
@@ -1739,4 +1701,17 @@ export class MoveService implements OnModuleInit {
     //超过了337
     return 0;
   }
+
+  getOffsetAngle(angle1,angle2){
+    if(angle1<0){
+      angle1 = 360+angle1;
+      //return Math.min(Math.abs(angle1-angle2),Math.abs());
+    }
+
+    if(angle2<0){
+      angle2 = 360+angle2;
+    }
+
+    return Math.min(Math.abs(angle1 - angle2),360 - Math.abs(angle1 - angle2))
+  }
 }

+ 12 - 7
src/rotate/rotate.service.ts

@@ -38,7 +38,7 @@ export class RotateService {
   private replies = {};
   private firstPoint = {
     player: {
-      position: { x: -560.0, y: 320.0, z: 0.0 }, //{ x: -800.0, y: 100.0, z: 0.0 },
+      position: { x: -600.0, y: -250.0, z: 0.0 }, //position: { x: -560.0, y: 320.0, z: 0.0 }, //{ x: -800.0, y: 100.0, z: 0.0 },
       angle: {
         pitch: 0,
         yaw: 0,
@@ -46,7 +46,7 @@ export class RotateService {
       },
     },
     camera: {
-      position: { x: -998.0, y: 319.9999694824219, z: 120.0 }, //{ x: -1141.6719970703125, y: 94.03607940673828, z: 120.0 },
+      position: { x: -1038.0, y: -249.99996948242188, z: 119.99998474121094 }, //{ x: -1141.6719970703125, y: 94.03607940673828, z: 120.0 },  //{ x: -998.0, y: 319.9999694824219, z: 120.0 }
       angle: {
         pitch: 0,
         yaw: 0,
@@ -55,12 +55,14 @@ export class RotateService {
     },
   };
 
-  init(app_id: string, userId: string) {
+  init(app_id: string, userId: string,skinId: string,roomId: string,avatar_id: string) {
     const user = {
       appId: null,
       userId: null,
       breakPointId: null,
       roomId: null,
+      skinId: null,
+      avatar_id: null,
       player: {
         position: { x: -560.0, y: 320.0, z: 0.0 }, //{ x: -800.0, y: 100.0, z: 0.0 },
         angle: {
@@ -89,6 +91,10 @@ export class RotateService {
     user.appId = app_id;
     user.userId = userId;
     user.breakPointId = Number(this.configService.get('app.startPoint')) || 0;
+    user.skinId = skinId;
+    user.roomId = roomId;
+    user.avatar_id = avatar_id;
+
     user.player.position = JSON.parse(
       JSON.stringify(this.firstPoint.player.position),
     );
@@ -475,9 +481,9 @@ export class RotateService {
           playerState: {
             roomTypeId: '',
             person: 0,
-            avatarId: 'My_Actor',
-            skinId: '0000000001',
-            roomId: 'aea5406a-3099-48db-b428-30917872e58a',
+            avatarId: _user.avatar_id,
+            skinId: _user.skinId,
+            roomId: _user.roomId,
             isHost: false,
             isFollowHost: false,
             skinDataVersion: '1008900008',
@@ -522,7 +528,6 @@ export class RotateService {
           },
           relation: 0,
         };
-
         reply['newUserStates'].push(newUserState);
       }
 

+ 8 - 7
src/scene/scene.service.ts

@@ -208,7 +208,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
 
   init(request: InitRequest) {
     try {
-      this.rotateService.init(request.app_id, request.user_id);
+      this.rotateService.init(request.app_id, request.user_id,request.skin_id,request.roomId,request.avatar_id);
       this.cacheService.getClient();
       console.log('rotateService::init');
       this.startSub = this.startSteaming.subscribe((flag) => {
@@ -263,14 +263,14 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
     console.log('rotateUnlock条件--->' + rotateUnlock, this.globalOptLock);
 
     if (rotateUnlock) {
-      console.log('20220627test:handleRotate')
+      //console.log('20220627test:handleRotate')
       const start = performance.now();
       // 当move时处理 _rotateCount是移动端同时触发的问题,rotateStopThrottle是减少重复抖动stop的处理。
       this.holdSteam();
       const redisMeta: StreamReplyType = await this.rotateService.seqExeRotate(
         request,
       );
-
+      
       if (redisMeta && 'mediaSrc' in redisMeta) {
         if (redisMeta.mediaSrc?.length) {
           const src = redisMeta.mediaSrc.split('?')[0];
@@ -739,6 +739,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
           for (let i = 0; i <= walkingRes.length - 1; i++) {
             Array.from(walkingRes[i]).forEach(
               (item: StreamReplyType, index: number) => {
+                console.log('20220628test:handleWalking->'+item['newUserStates'][0].renderInfo.isMoving)
                 //const IDRflag = index % 5 === 0 ? 1 : 3;
                 const IDRflag = item.isIDR ? 1 : 3;
                 const dir = this.isHeaderOrLast(
@@ -861,7 +862,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
       };
     }
 
-    console.log('20220627test-complementFrame 进行1' + '***' + streamData.frame);
+    console.log('20220627test-complementFrame 进行1' + '***' + streamData.frame+','+JSON.parse(streamData.metaData).mediaSrc+','+this.moveService.cameraInfos.length);
     // 过滤新东西, 推完给回false
     this.moveService.sendingFrameForJoystick = true;
 
@@ -874,9 +875,9 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
     if (hasPush.done) {
       this.isJoystickHasStream = true;
       console.log('joystick-hasPush', hasPush);
-      if (this.isJoystickHasStream) {
-        await this.sleep(20);
-      }
+      // if (this.isJoystickHasStream) {
+      //   await this.sleep(20);
+      // }
       this.moveService.sendingFrameForJoystick = false;
       const data = joystickRes as StreamReplyType;
       console.log('handlejoystick-isIDR:' + data.isIDR);