|
@@ -43,6 +43,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
private moveframeCnt = -1;
|
|
|
private joystickFrameCnt = -1;
|
|
|
private rotateFirstIDR = true;
|
|
|
+ private rotateStopThrottle = false; //防止多次瞬间解触发
|
|
|
|
|
|
private sceneGrpcService: SceneGrpcService;
|
|
|
private channel: DataChannel;
|
|
@@ -233,29 +234,6 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
this.rotateService.init(request.app_id, request.user_id);
|
|
|
this.cacheService.getClient();
|
|
|
// 加载
|
|
|
- // let path: string;
|
|
|
- // if (process.env.NODE_ENV === 'development') {
|
|
|
- // path = join(
|
|
|
- // __dirname,
|
|
|
- // `../ws/${request.app_id}/points-${request.app_id}.json`,
|
|
|
- // );
|
|
|
- // console.log('测试服JSON', path);
|
|
|
- // }
|
|
|
- // if (process.env.NODE_ENV === 'production') {
|
|
|
- // path = join(
|
|
|
- // `${this.configService.get('app.prefix')}/${request.app_id}/points-${
|
|
|
- // request.app_id
|
|
|
- // }.json`,
|
|
|
- // );
|
|
|
- // console.log('正式服JSON', path);
|
|
|
- // }
|
|
|
-
|
|
|
- // this.moveService.loadJSON(path);
|
|
|
- // this.getRouterService.loadJSON(path);
|
|
|
-
|
|
|
- // this.moveService.init(request.app_id, request.user_id);
|
|
|
-
|
|
|
- // this.initUsers(request.app_id, request.user_id);
|
|
|
} catch (error) {
|
|
|
this.logger.error('error', error);
|
|
|
}
|
|
@@ -291,7 +269,12 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
this.onRotating.next(true);
|
|
|
const start = performance.now();
|
|
|
// 当move时处理 _rotateCount是移动端同时触发的问题
|
|
|
- if (this.onMoving.value && this._rotateCount > 5) {
|
|
|
+ if (
|
|
|
+ this.onMoving.value &&
|
|
|
+ this._rotateCount > 5 &&
|
|
|
+ !this.rotateStopThrottle
|
|
|
+ ) {
|
|
|
+ this.rotateStopThrottle = true;
|
|
|
const lastStreamFrame = this.lastMoveStreamFrame.getValue();
|
|
|
// const lastMoveStreamFrameBk = this.lastMoveStreamFrameBk;
|
|
|
//TODO对比
|
|
@@ -750,6 +733,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
// this.clickQueueSub.unsubscribe();
|
|
|
// this.clickQueueSub = null;
|
|
|
// }
|
|
|
+ this.rotateStopThrottle = false;
|
|
|
}
|
|
|
handleMoveSteam() {
|
|
|
this.moveQueueSubscription = this.moveQueue.subscribe(
|
|
@@ -787,7 +771,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
);
|
|
|
// 记录lastMoveStreamFrame给打断逻辑使用
|
|
|
this.lastMoveStreamFrame.next(streamData);
|
|
|
- this.lastMoveStreamFrameBk = streamData;
|
|
|
+ // this.lastMoveStreamFrameBk = streamData;
|
|
|
const res = await this.streamService.pushFrameToSteam(streamData);
|
|
|
|
|
|
const isLastFrameIndex = this.lastMovingPointArray.findIndex(
|