gemercheung vor 3 Jahren
Ursprung
Commit
610d7a1e05

+ 1 - 0
config.dev.yaml

@@ -1,6 +1,7 @@
 
 app:
   prefix: /mnt/metaverse/scene
+  startPoint: 93
 
 queueConfig:
   move: 10

+ 1 - 0
config.production.yaml

@@ -1,6 +1,7 @@
 
 app:
   prefix: /mnt/metaverse/scene
+  startPoint: 93
 
 queueConfig:
   move: 10

+ 1 - 0
config.production1.yaml

@@ -1,5 +1,6 @@
 app:
   prefix: /mnt/metaverse/scene
+  startPoint: 93
 
 queueConfig:
   move: 10

+ 2 - 1
config.yaml

@@ -1,9 +1,10 @@
 app:
   prefix: /mnt/metaverse/scene
+  startPoint: 100
 
 queueConfig:
   move: 10
-  rotate: 5
+  rotate: 2
 
 http:
   host: '0.0.0.0'

+ 3 - 1
src/move/move.service.ts

@@ -4,6 +4,7 @@ import {
   Logger,
   OnModuleInit,
 } from '@nestjs/common';
+import { ConfigService } from '@nestjs/config';
 import { readFileSync } from 'fs';
 import { join } from 'path';
 import { CacheService } from 'src/cache/cache.service';
@@ -35,6 +36,7 @@ export class MoveService implements OnModuleInit {
   constructor(
     private cacheService: CacheService,
     private rotateService: RotateService,
+    private configService: ConfigService,
   ) {}
   private logger: Logger = new Logger('MoveService');
   private Actions = {
@@ -178,7 +180,7 @@ export class MoveService implements OnModuleInit {
 
     user.appId = app_id;
     user.userId = userId;
-    user.breakPointId = 100;
+    user.breakPointId = this.configService.get('app.startPoint') || 0;
     this.users[userId] = user;
   }
 

+ 4 - 3
src/rotate/rotate.service.ts

@@ -1,4 +1,5 @@
 import { Injectable, Logger } from '@nestjs/common';
+import { ConfigService } from '@nestjs/config';
 import { CacheService } from 'src/cache/cache.service';
 // import { SceneService } from 'src/scene/scene.service';
 
@@ -24,7 +25,8 @@ const seqExeAsyncFn = (asyncFn) => {
 export class RotateService {
   constructor(
     private cacheService: CacheService, // private sceneService: SceneService,
-  ) {}
+    private configService: ConfigService,
+  ) { }
   private actionRequestPool = {};
   private logger: Logger = new Logger('rotateService');
   private Actions = {
@@ -68,9 +70,8 @@ export class RotateService {
 
     user.appId = app_id;
     user.userId = userId;
-    user.breakPointId = 93;
+    user.breakPointId = this.configService.get('app.startPoint') || 0;
     this.users[userId] = user;
-
     const reply = {
       traceIds: [],
       vehicle: null,

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

@@ -684,7 +684,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
         );
         console.log(
           '[media-move-lastMovingPointArray]',
-          JSON.stringify(this.lastMovingPointArray),
+          this.lastMovingPointArray?.length,
         );
         this.lastMoveStreamFrame.next(streamData);
         const res = await this.streamService.pushFrameToSteam(streamData);