gemercheung 3 năm trước cách đây
mục cha
commit
f350294840
3 tập tin đã thay đổi với 38 bổ sung33 xóa
  1. 2 2
      config.dev.yaml
  2. 2 2
      config.production1.yaml
  3. 34 29
      src/scene/scene.service.ts

+ 2 - 2
config.dev.yaml

@@ -3,8 +3,8 @@ app:
   prefix: /mnt/metaverse/scene
 
 queueConfig:
-  move: 20
-  rotate: 20
+  move: 10
+  rotate: 10
 
 http:
   host: '0.0.0.0'

+ 2 - 2
config.production1.yaml

@@ -3,8 +3,8 @@ app:
   prefix: /mnt/metaverse/scene
 
 queueConfig:
-  move: 20
-  rotate: 20
+  move: 8
+  rotate: 8
 
 
 http:

+ 34 - 29
src/scene/scene.service.ts

@@ -375,24 +375,26 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
           }
 
           // 二维数组 做move 序列, move类型
-          for (let i = 1; i < walkingRes.length; i++) {
-            console.log('walkingRes', walkingRes[i]);
-            Array.from(walkingRes[i]).forEach(
-              (item: StreamReplyType, index: number) => {
-                const dir = this.isHeaderOrLast(
-                  index,
-                  walkingRes[i].length - 1,
-                );
-                item.DIR = dir ? 1 : 3;
-                //将每段最后一个推入lastMovingPointArray
-                if (index === walkingRes[i].length - 1) {
-                  this.lastMovingPointArray.push({
-                    mediaSrc: item.mediaSrc,
-                    metaData: item,
-                  });
-                }
-              },
-            );
+          if (walkingRes?.length >= 1) {
+            for (let i = 1; i < walkingRes.length; i++) {
+              console.log('walkingRes', walkingRes[i]);
+              Array.from(walkingRes[i]).forEach(
+                (item: StreamReplyType, index: number) => {
+                  const dir = this.isHeaderOrLast(
+                    index,
+                    walkingRes[i].length - 1,
+                  );
+                  item.DIR = dir ? 1 : 3;
+                  //将每段最后一个推入lastMovingPointArray
+                  if (index === walkingRes[i].length - 1) {
+                    this.lastMovingPointArray.push({
+                      mediaSrc: item.mediaSrc,
+                      metaData: item,
+                    });
+                  }
+                },
+              );
+            }
           }
 
           // walkingRes marker to everybody
@@ -446,18 +448,21 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
                 console.log('rotateCamData无数据');
               }
               // 二维数组 做move 序列, move类型
-              for (let i = 1; i < joystickRes.length; i++) {
-                console.log('walkingRes', joystickRes[i]);
-                Array.from(joystickRes[i]).forEach(
-                  (item: StreamReplyType, index: number) => {
-                    const dir = this.isHeaderOrLast(
-                      index,
-                      joystickRes[i].length - 1,
-                    );
-                    item.DIR = dir ? 1 : 3;
-                  },
-                );
+              if (joystickRes?.length >= 1) {
+                for (let i = 1; i < joystickRes.length; i++) {
+                  console.log('joystickRes', joystickRes[i]);
+                  Array.from(joystickRes[i]).forEach(
+                    (item: StreamReplyType, index: number) => {
+                      const dir = this.isHeaderOrLast(
+                        index,
+                        joystickRes[i].length - 1,
+                      );
+                      item.DIR = dir ? 1 : 3;
+                    },
+                  );
+                }
               }
+
               const seqs = Array.from(
                 joystickRes,
               ).flat() as any as StreamReplyType[];