test pc 3 éve
szülő
commit
47b5dd98b3
1 módosított fájl, 7 hozzáadás és 18 törlés
  1. 7 18
      src/move/move.service.ts

+ 7 - 18
src/move/move.service.ts

@@ -45,6 +45,8 @@ export class MoveService implements OnModuleInit {
     traceIds: [],
     vehicle: null,
     mediaSrc: null,
+    moveOver:false,
+    moveStart:false,
     newUserStates: [
       {
         userId: 'dcff36ae4fc1d',
@@ -435,7 +437,7 @@ export class MoveService implements OnModuleInit {
   updateUser(userId, breakPointId, lastReply) {
     const user = this.users[userId];
     user.breakPointId = breakPointId;
-
+    console.log('handlejoystick:updateUser');
     if (lastReply.actionResponses[0].actionType != 15) {
       user.player.position =
         lastReply['newUserStates'][0].playerState.player.position;
@@ -790,7 +792,6 @@ export class MoveService implements OnModuleInit {
     const user = this.users[userId];
     const breakPointId = user.breakPointId;
     const appId = user.appId;
-
     const step = 0.3;
     const closestDis = 85; //小于这个距离就跳到邻居呼吸点
     const distance = step * dir_action.speed_level;
@@ -1172,21 +1173,8 @@ export class MoveService implements OnModuleInit {
         Math.floor(user.camera.angle.yaw / 45);
       const moveFramesRes = await this.cacheService.get(key);
       const moveFrames = JSON.parse(moveFramesRes);
-      this.setCameraInfo(moveFrames);
-      // const pathReplys = this.createCacheReplys(
-      //   appId,
-      //   moveFrames,
-      //   traceId,
-      //   userId,
-      //   breakPointId,
-      //   chooseBreakPointId,
-      //   true,
-      // );
-      // for (let i = 0; i < pathReplys.length; ++i) {
-      //   pathReplys[i].actionResponses[0].actionType = actionType;
-      // }
-      // replys.push(pathReplys);
-      user.breakPointId = chooseBreakPointId;
+      this.setCameraInfo(moveFrames,chooseBreakPointId);
+      //user.breakPointId = chooseBreakPointId;
       const cameraInfo = this.getCameraInfo();
       if (cameraInfo != null) {
         this.reply['newUserStates'][0].playerState.camera.position =
@@ -1226,8 +1214,9 @@ export class MoveService implements OnModuleInit {
     }
   }
 
-  setCameraInfo(moveFrames) {
+  setCameraInfo(moveFrames,endBreakPointId) {
     for (let i = 0; i < moveFrames.length; i += 5) {
+      moveFrames[i].endBreakPointId = endBreakPointId;
       this.cameraInfos.push(moveFrames[i]);
     }
   }