|
@@ -61,6 +61,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
private joystickSub: any;
|
|
|
private clickQueueSub: any;
|
|
|
private _rotateCurrentFame = -1;
|
|
|
+ private _rotateCount = -1;
|
|
|
|
|
|
private streamServiceSub: any;
|
|
|
// private roRequestQueue: RxQueue = new DelayQueue(20);
|
|
@@ -240,6 +241,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
|
|
|
async rotate(request: RotateRequest) {
|
|
|
this.handleRotate(request);
|
|
|
+ this._rotateCount += 1;
|
|
|
//this.logger.log('request', request)
|
|
|
// this.roRequestQueue.next(request);
|
|
|
// if (!this.roRequestQueueSub) {
|
|
@@ -261,8 +263,8 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
let redisMeta: StreamReplyType;
|
|
|
this.onRotating.next(true);
|
|
|
const start = performance.now();
|
|
|
- // 当move时处理
|
|
|
- if (this.onMoving.value) {
|
|
|
+ // 当move时处理 _rotateCount是移动端同时触发的问题
|
|
|
+ if (this.onMoving.value && this._rotateCount > 5) {
|
|
|
const lastStreamFrame = this.lastMoveStreamFrame.getValue();
|
|
|
const metaData: StreamReplyType = JSON.parse(
|
|
|
lastStreamFrame.metaData,
|
|
@@ -413,6 +415,7 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
try {
|
|
|
// if (!this.onMoving.getValue()) {
|
|
|
const start = performance.now();
|
|
|
+ this._rotateCount = 0;
|
|
|
const user = this.moveService.users[this.user_id];
|
|
|
this.logger.log('进入1 - searchRoad');
|
|
|
this.logger.log('path-start' + user.breakPointId);
|
|
@@ -528,10 +531,11 @@ export class SceneService implements OnModuleInit, OnModuleDestroy {
|
|
|
async handlejoystick(request: JoystickRequest) {
|
|
|
try {
|
|
|
//const joystickRes = await this.moveService.joystick(request);
|
|
|
+ this._rotateCount = 0;
|
|
|
const joystickRes = await this.moveService.seqExeJoystick(request);
|
|
|
this.logger.log(
|
|
|
'joystick-breakPointId:' +
|
|
|
- this.moveService.users[this.user_id].breakPointId,
|
|
|
+ this.moveService.users[this.user_id].breakPointId,
|
|
|
);
|
|
|
// 有数据 [0]是rotate数据,[1-infinity]是walking数据
|
|
|
this.logger.log('joystickRes-1', joystickRes);
|