gemercheung %!s(int64=3) %!d(string=hai) anos
pai
achega
24121de9c9
Modificáronse 1 ficheiros con 12 adicións e 16 borrados
  1. 12 16
      src/scene/scene.service.ts

+ 12 - 16
src/scene/scene.service.ts

@@ -206,10 +206,19 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
   }
   }
 
 
   async rotate(request: RotateRequest) {
   async rotate(request: RotateRequest) {
-
     if (this.isHasWalkingJoints()) {
     if (this.isHasWalkingJoints()) {
       this.globalOptLock = true;
       this.globalOptLock = true;
     }
     }
+
+    if (
+      this.onMoving.getValue() &&
+      this.globalOptLock &&
+      // this._rotateCount > 5 &&
+      !this.rotateStopThrottle
+    ) {
+      this.handleRotateStop(request);
+      debugger;
+    }
     this.handleRotate(request);
     this.handleRotate(request);
     this._rotateCount += 1;
     this._rotateCount += 1;
     //this.logger.log('request', request)
     //this.logger.log('request', request)
@@ -234,20 +243,6 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
       const start = performance.now();
       const start = performance.now();
 
 
       // 当move时处理 _rotateCount是移动端同时触发的问题,rotateStopThrottle是减少重复抖动stop的处理。
       // 当move时处理 _rotateCount是移动端同时触发的问题,rotateStopThrottle是减少重复抖动stop的处理。
-
-      if (
-        this.onMoving.getValue() &&
-        this.globalOptLock &&
-        // this._rotateCount > 5 &&
-        !this.rotateStopThrottle
-      ) {
-
-        // this.handleRotateStop(request);
-        debugger;
-
-        // return;
-      }
-
       this.onRotating.next(true);
       this.onRotating.next(true);
 
 
       const redisMeta: StreamReplyType = await this.rotateService.seqExeRotate(
       const redisMeta: StreamReplyType = await this.rotateService.seqExeRotate(
@@ -786,6 +781,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
   }
   }
 
 
   cleanMoveSteam() {
   cleanMoveSteam() {
+    this.moveQueue.clean();
     if (this.moveQueueSubscription) {
     if (this.moveQueueSubscription) {
       this.moveQueueSubscription.unsubscribe();
       this.moveQueueSubscription.unsubscribe();
       this.moveQueueSubscription = null;
       this.moveQueueSubscription = null;
@@ -874,7 +870,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
               this.lastMovingPointArray = [];
               this.lastMovingPointArray = [];
               this.hasJoystickMoveRequest = false;
               this.hasJoystickMoveRequest = false;
               this.cleanMoveSteam();
               this.cleanMoveSteam();
-              this.globalOptLock = false;
+              // this.globalOptLock = false;
               this.resumeStream();
               this.resumeStream();
               this.logger.log('move end');
               this.logger.log('move end');
             }, 200);
             }, 200);