test pc 3 anos atrás
pai
commit
c403e387c1
3 arquivos alterados com 11 adições e 8 exclusões
  1. 2 2
      config.dev.yaml
  2. 5 3
      src/move/move.service.ts
  3. 4 3
      src/rotate/rotate.service.ts

+ 2 - 2
config.dev.yaml

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

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

@@ -135,7 +135,8 @@ export class MoveService implements OnModuleInit {
 
   // eslint-disable-next-line @typescript-eslint/no-empty-function
   async onModuleInit() {
-    const app_id = '0000000003';
+    //const app_id = '0000000003';
+    const app_id = '0000000007';
     const prefix = '/mnt/metaverse/scene';
     let path;
     // let path: string;
@@ -1336,7 +1337,7 @@ export class MoveService implements OnModuleInit {
 
   complementFrame(userId) {
     if (this.cameraInfos.length > 0) {
-      //console.log('handlejoysticktesttest:complementFrame-2 继续'+new Date().getTime())
+      //console.log('handlejoysticktesttest:complementFrame-1 继续'+new Date().getTime())
       const user = this.users[userId];
       const cameraInfo = this.cameraInfos.shift();
       this.reply.traceIds = [];
@@ -1375,11 +1376,12 @@ export class MoveService implements OnModuleInit {
       return this.reply;
     } 
     else if (this.cameraInfos.length == 0){
-      //console.log('handlejoysticktesttest:complementFrame-3 停止'+new Date().getTime())
       if(this.reply['newUserStates'][0].renderInfo.isMoving == 1){
+        //console.log('handlejoysticktesttest:complementFrame-2 停止1'+new Date().getTime())
         return this.stopJoystick(userId)
       }
       else{
+        //console.log('handlejoysticktesttest:complementFrame-2 停止2'+new Date().getTime())
         return null;
       }
     }

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

@@ -44,7 +44,7 @@ export class RotateService {
       breakPointId: null,
       roomId: null,
       player: {
-        position: { x: -800.0, y: 100.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,
@@ -52,7 +52,7 @@ export class RotateService {
         },
       },
       camera: {
-        position: { x: -1141.6719970703125, y: 94.03607940673828, z: 120.0 },
+        position: { x: -998.0, y: 319.9999694824219, z: 120.0 },          //{ x: -1141.6719970703125, y: 94.03607940673828, z: 120.0 },
         angle: {
           pitch: 0,
           yaw: 0,
@@ -159,7 +159,8 @@ export class RotateService {
       msg: 'OK',
     };
 
-    reply['newUserStates'][0]['userId'] = userId;
+    reply['newUserStates'][0].playerState.player.position = JSON.parse(JSON.stringify(user.player.position))
+    reply['newUserStates'][0].playerState.camera.position = JSON.parse(JSON.stringify(user.camera.position))
     this.replies[userId] = reply;
     return reply;
   }