|
@@ -154,28 +154,47 @@ export class MoveService {
|
|
|
const traceIds = [];
|
|
|
traceIds.push(traceId);
|
|
|
|
|
|
+ debugger;
|
|
|
//纠正,旋转传到缓存里
|
|
|
const checkReplys = [];
|
|
|
// console.log('矫正: ' + angle + ' 度');
|
|
|
- for (let i = 0; i < angle; ++i) {
|
|
|
- // console.warn('矫正一次:' + i);
|
|
|
- const reply = await this.rotateService.rotateForAngle(userId, 1);
|
|
|
- // console.warn(
|
|
|
- // '矫正:' + reply.newUserStates[0].playerState.camera.angle.yaw,
|
|
|
- // );
|
|
|
- reply.traceIds = [];
|
|
|
- reply.traceIds.push(traceId);
|
|
|
- const actionResponse = this.rotateService.createActionResponse(
|
|
|
- actionType,
|
|
|
- traceId,
|
|
|
- );
|
|
|
- reply.actionResponses = [];
|
|
|
- reply.actionResponses.push(actionResponse);
|
|
|
- checkReplys.push(reply);
|
|
|
+ if(angle>22){
|
|
|
+ for (let i = 0; i < angle; ++i) {
|
|
|
+ // console.warn('矫正一次:' + i);
|
|
|
+ const reply = await this.rotateService.rotateForAngle(userId, 1);
|
|
|
+ // console.warn(
|
|
|
+ // '矫正:' + reply.newUserStates[0].playerState.camera.angle.yaw,
|
|
|
+ // );
|
|
|
+ reply.traceIds = [];
|
|
|
+ reply.traceIds.push(traceId);
|
|
|
+ const actionResponse = this.rotateService.createActionResponse(
|
|
|
+ actionType,
|
|
|
+ traceId,
|
|
|
+ );
|
|
|
+ reply.actionResponses = [];
|
|
|
+ reply.actionResponses.push(actionResponse);
|
|
|
+ checkReplys.push(reply);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ for (let i = angle; i >-1; --i) {
|
|
|
+ // console.warn('矫正一次:' + i);
|
|
|
+ const reply = await this.rotateService.rotateForAngle(userId, -1);
|
|
|
+ // console.warn(
|
|
|
+ // '矫正:' + reply.newUserStates[0].playerState.camera.angle.yaw,
|
|
|
+ // );
|
|
|
+ reply.traceIds = [];
|
|
|
+ reply.traceIds.push(traceId);
|
|
|
+ const actionResponse = this.rotateService.createActionResponse(
|
|
|
+ actionType,
|
|
|
+ traceId,
|
|
|
+ );
|
|
|
+ reply.actionResponses = [];
|
|
|
+ reply.actionResponses.push(actionResponse);
|
|
|
+ checkReplys.push(reply);
|
|
|
+ }
|
|
|
}
|
|
|
//replys['P' + user.breakPointId + 'T' + user.breakPointId] = checkReplys;
|
|
|
replys.push(checkReplys);
|
|
|
-
|
|
|
//过渡传到缓存里
|
|
|
this.reply.traceIds = traceIds;
|
|
|
this.reply['newUserStates'][0].userId = userId;
|
|
@@ -219,6 +238,7 @@ export class MoveService {
|
|
|
);
|
|
|
const endBreakPoint = JSON.parse(endBreakPointRes);
|
|
|
pathReplys = this.createCacheReplys(
|
|
|
+ appId,
|
|
|
moveFrames,
|
|
|
traceId,
|
|
|
userId,
|
|
@@ -242,6 +262,7 @@ export class MoveService {
|
|
|
}
|
|
|
|
|
|
createCacheReplys(
|
|
|
+ appId,
|
|
|
moveFrames,
|
|
|
traceId,
|
|
|
userId,
|
|
@@ -294,7 +315,7 @@ export class MoveService {
|
|
|
|
|
|
reply.mediaSrc =
|
|
|
'/' +
|
|
|
- '0000000001' +
|
|
|
+ appId +
|
|
|
'/' +
|
|
|
breakPointId +
|
|
|
'/' +
|
|
@@ -419,7 +440,7 @@ export class MoveService {
|
|
|
reply['actionResponses'][0].traceId = traceId;
|
|
|
reply.mediaSrc =
|
|
|
'/' +
|
|
|
- '0000000001' +
|
|
|
+ appId +
|
|
|
'/' +
|
|
|
breakPointId +
|
|
|
'/' +
|
|
@@ -443,7 +464,7 @@ export class MoveService {
|
|
|
const breakPointId = user.breakPointId;
|
|
|
const appId = user.appId;
|
|
|
//只是移动人物
|
|
|
- if (dir_action.speed_level < 7) {
|
|
|
+ if (dir_action.speed_level < 9) {
|
|
|
user.player.angle.yaw = dir_action.move_angle;
|
|
|
this.reply['newUserStates'][0]['userId'] = userId;
|
|
|
this.reply['newUserStates'][0].playerState.player.position =
|
|
@@ -472,7 +493,7 @@ export class MoveService {
|
|
|
const redisData = JSON.parse(redisDataRes);
|
|
|
this.reply.mediaSrc =
|
|
|
'/' +
|
|
|
- '0000000001' +
|
|
|
+ appId +
|
|
|
'/' +
|
|
|
breakPointId +
|
|
|
'/' +
|
|
@@ -481,6 +502,7 @@ export class MoveService {
|
|
|
redisData.fileName +
|
|
|
'?m=' +
|
|
|
new Date().getTime();
|
|
|
+ console.log('人物旋转:'+user.player.angle.yaw);
|
|
|
return this.reply;
|
|
|
}
|
|
|
//选择过渡
|
|
@@ -577,6 +599,7 @@ export class MoveService {
|
|
|
const endBreakPoint = JSON.parse(endBreakPointRes);
|
|
|
|
|
|
const pathReplys = this.createCacheReplys(
|
|
|
+ appId,
|
|
|
moveFrames,
|
|
|
traceId,
|
|
|
userId,
|