|
@@ -45,8 +45,8 @@ export class MoveService implements OnModuleInit {
|
|
|
traceIds: [],
|
|
|
vehicle: null,
|
|
|
mediaSrc: null,
|
|
|
- moveOver:false,
|
|
|
- moveStart:false,
|
|
|
+ moveOver: false,
|
|
|
+ moveStart: false,
|
|
|
newUserStates: [
|
|
|
{
|
|
|
userId: 'dcff36ae4fc1d',
|
|
@@ -1011,6 +1011,7 @@ export class MoveService implements OnModuleInit {
|
|
|
|
|
|
if (cameraInfo.mediaSrc) {
|
|
|
this.reply.mediaSrc = cameraInfo.mediaSrc;
|
|
|
+<<<<<<< HEAD
|
|
|
}
|
|
|
// if (this.cameraInfos.length == 0) {
|
|
|
// this.reply.moveOver = true;
|
|
@@ -1021,6 +1022,12 @@ export class MoveService implements OnModuleInit {
|
|
|
);
|
|
|
user.camera.angle.yaw = cameraInfo.camera_angle.yaw;
|
|
|
|
|
|
+=======
|
|
|
+ }
|
|
|
+ if (this.cameraInfos.length == 0) {
|
|
|
+ this.reply.moveOver = true;
|
|
|
+ }
|
|
|
+>>>>>>> 7a74beedb6f8bfe0401e0fc837cd96cd26026949
|
|
|
this.sendingFrameForJoystick = true;
|
|
|
} else {
|
|
|
console.log('joystick自由--->不合并');
|
|
@@ -1087,6 +1094,7 @@ export class MoveService implements OnModuleInit {
|
|
|
|
|
|
if (cameraInfo.mediaSrc) {
|
|
|
this.reply.mediaSrc = cameraInfo.mediaSrc;
|
|
|
+<<<<<<< HEAD
|
|
|
}
|
|
|
// if (this.cameraInfos.length == 0) {
|
|
|
// this.reply.moveOver = true;
|
|
@@ -1097,6 +1105,12 @@ export class MoveService implements OnModuleInit {
|
|
|
);
|
|
|
user.camera.angle.yaw = cameraInfo.camera_angle.yaw;
|
|
|
|
|
|
+=======
|
|
|
+ }
|
|
|
+ if (this.cameraInfos.length == 0) {
|
|
|
+ this.reply.moveOver = true;
|
|
|
+ }
|
|
|
+>>>>>>> 7a74beedb6f8bfe0401e0fc837cd96cd26026949
|
|
|
this.sendingFrameForJoystick = true;
|
|
|
}
|
|
|
return this.reply;
|
|
@@ -1178,7 +1192,7 @@ export class MoveService implements OnModuleInit {
|
|
|
|
|
|
if (cameraInfo.mediaSrc) {
|
|
|
this.reply.mediaSrc = cameraInfo.mediaSrc;
|
|
|
- }
|
|
|
+ }
|
|
|
this.reply.moveStart = true;
|
|
|
this.sendingFrameForJoystick = true;
|
|
|
}
|
|
@@ -1186,10 +1200,23 @@ export class MoveService implements OnModuleInit {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- setCameraInfo(appId,moveFrames,startBreakPointId,endBreakPointId) {
|
|
|
+ setCameraInfo(appId, moveFrames, startBreakPointId, endBreakPointId) {
|
|
|
for (let i = 0; i < moveFrames.length; i += 5) {
|
|
|
moveFrames[i].endBreakPointId = endBreakPointId;
|
|
|
- moveFrames[i].mediaSrc = '/' + appId +'/' + startBreakPointId +'/' + moveFrames[i].file_name.substring( 0, moveFrames[i].file_name.indexOf('.'), ) + '/' +moveFrames[i].file_name + '?m=' +new Date().getTime();
|
|
|
+ moveFrames[i].mediaSrc =
|
|
|
+ '/' +
|
|
|
+ appId +
|
|
|
+ '/' +
|
|
|
+ startBreakPointId +
|
|
|
+ '/' +
|
|
|
+ moveFrames[i].file_name.substring(
|
|
|
+ 0,
|
|
|
+ moveFrames[i].file_name.indexOf('.'),
|
|
|
+ ) +
|
|
|
+ '/' +
|
|
|
+ moveFrames[i].file_name +
|
|
|
+ '?m=' +
|
|
|
+ new Date().getTime();
|
|
|
this.cameraInfos.push(moveFrames[i]);
|
|
|
}
|
|
|
}
|
|
@@ -1211,14 +1238,15 @@ export class MoveService implements OnModuleInit {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- complementFrame(userId){
|
|
|
+ complementFrame(userId) {
|
|
|
if (this.cameraInfos.length > 0) {
|
|
|
const user = this.users[userId];
|
|
|
const cameraInfo = this.cameraInfos.shift();
|
|
|
this.reply.traceIds = [];
|
|
|
this.reply['newUserStates'][0].userId = userId;
|
|
|
this.reply['actionResponses'][0].traceId = null;
|
|
|
- this.reply['newUserStates'][0].playerState.player.angle.yaw = user.player.angle.yaw;
|
|
|
+ this.reply['newUserStates'][0].playerState.player.angle.yaw =
|
|
|
+ user.player.angle.yaw;
|
|
|
this.reply['newUserStates'][0].playerState.player.position = JSON.parse(
|
|
|
JSON.stringify(user.player.position),
|
|
|
);
|
|
@@ -1234,18 +1262,23 @@ export class MoveService implements OnModuleInit {
|
|
|
);
|
|
|
this.reply['newUserStates'][0].renderInfo.isMoving = 0;
|
|
|
this.reply['actionResponses'][0].traceId = null;
|
|
|
-
|
|
|
+
|
|
|
if (cameraInfo.mediaSrc) {
|
|
|
this.reply.mediaSrc = cameraInfo.mediaSrc;
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
+<<<<<<< HEAD
|
|
|
// if(this.cameraInfos.length == 0){
|
|
|
// this.reply.moveOver = true;
|
|
|
// }
|
|
|
this.sendingFrameForJoystick = true;
|
|
|
+=======
|
|
|
+ if (this.cameraInfos.length == 0) {
|
|
|
+ this.reply.moveOver = true;
|
|
|
+ }
|
|
|
+>>>>>>> 7a74beedb6f8bfe0401e0fc837cd96cd26026949
|
|
|
return this.reply;
|
|
|
- }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
return null;
|
|
|
}
|
|
|
}
|