test pc 3 年之前
父節點
當前提交
23ba24f66e
共有 1 個文件被更改,包括 9 次插入10 次删除
  1. 9 10
      src/move/move.service.ts

+ 9 - 10
src/move/move.service.ts

@@ -1335,13 +1335,8 @@ export class MoveService implements OnModuleInit {
   }
 
   complementFrame(userId) {
-    if (this.cameraInfos == null) {
-      console.log('handlejoysticktesttest:complementFrame-1 结束'+new Date().getTime())
-      this.cameraInfos = [];
-      return null;
-    }
-    else if (this.cameraInfos.length > 0) {
-      console.log('handlejoysticktesttest:complementFrame-2 继续'+new Date().getTime())
+    if (this.cameraInfos.length > 0) {
+      //console.log('handlejoysticktesttest:complementFrame-2 继续'+new Date().getTime())
       const user = this.users[userId];
       const cameraInfo = this.cameraInfos.shift();
       this.reply.traceIds = [];
@@ -1380,9 +1375,13 @@ export class MoveService implements OnModuleInit {
       return this.reply;
     } 
     else if (this.cameraInfos.length == 0){
-      console.log('handlejoysticktesttest:complementFrame-3 停止'+new Date().getTime())
-      this.cameraInfos = null;
-      return this.stopJoystick(userId)
+      //console.log('handlejoysticktesttest:complementFrame-3 停止'+new Date().getTime())
+      if(this.reply['newUserStates'][0].renderInfo.isMoving == 1){
+        return this.stopJoystick(userId)
+      }
+      else{
+        return null;
+      }
     }
   }