|
@@ -8,6 +8,7 @@ import com.fdkk.fdkkmeta.domain.dto.RouteDto;
|
|
import com.fdkk.fdkkmeta.domain.entity.mysql.BreakpointsEntity;
|
|
import com.fdkk.fdkkmeta.domain.entity.mysql.BreakpointsEntity;
|
|
import com.fdkk.fdkkmeta.domain.entity.mysql.UserEntity;
|
|
import com.fdkk.fdkkmeta.domain.entity.mysql.UserEntity;
|
|
import com.fdkk.fdkkmeta.domain.po.AnglePO;
|
|
import com.fdkk.fdkkmeta.domain.po.AnglePO;
|
|
|
|
+import com.fdkk.fdkkmeta.domain.po.JoystickPO;
|
|
import com.fdkk.fdkkmeta.domain.po.PointPO;
|
|
import com.fdkk.fdkkmeta.domain.po.PointPO;
|
|
import com.fdkk.fdkkmeta.domain.po.RotateRequestPO;
|
|
import com.fdkk.fdkkmeta.domain.po.RotateRequestPO;
|
|
import com.fdkk.fdkkmeta.grpc.*;
|
|
import com.fdkk.fdkkmeta.grpc.*;
|
|
@@ -244,7 +245,6 @@ public class sceneGrpcServer extends SceneGrpcServiceGrpc.SceneGrpcServiceImplBa
|
|
rotateRequestPO.setRotation_action(rotation_action);
|
|
rotateRequestPO.setRotation_action(rotation_action);
|
|
rotateRequestPO.setTrace_id(trace_id);
|
|
rotateRequestPO.setTrace_id(trace_id);
|
|
rotateRequestPO.setUser_id(user_id);
|
|
rotateRequestPO.setUser_id(user_id);
|
|
-
|
|
|
|
//redisCache.setCacheObject("setCacheRequest:"+user_id,rotateRequestPO);
|
|
//redisCache.setCacheObject("setCacheRequest:"+user_id,rotateRequestPO);
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -374,9 +374,37 @@ public class sceneGrpcServer extends SceneGrpcServiceGrpc.SceneGrpcServiceImplBa
|
|
userInfo.put("roomId",user.getRoomId());
|
|
userInfo.put("roomId",user.getRoomId());
|
|
userInfo.put("isHost",false);
|
|
userInfo.put("isHost",false);
|
|
userInfo.put("isFollowHost",false);
|
|
userInfo.put("isFollowHost",false);
|
|
- userInfo.put("skinDataVersion","");
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ userInfo.put("skinDataVersion",user.getSkinDataVersion());
|
|
|
|
+ userInfo.put("avatarComponents","");
|
|
|
|
+ userInfo.put("nickName",user.getNickName());
|
|
|
|
+ userInfo.put("movingMode",0); //后续会修改
|
|
|
|
+ userInfo.put("attitude","walk");
|
|
|
|
+ userInfo.put("areaName","");
|
|
|
|
+ userInfo.put("pathName","");
|
|
|
|
+ userInfo.put("pathId","thirdwalk");
|
|
|
|
+ userInfo.put("avatarSize",1);
|
|
|
|
+ Extra extra = Extra.newBuilder().setRemoveWhenDisconnected(true).build();
|
|
|
|
+ userInfo.put("extra",extra);
|
|
|
|
+ userInfo.put("prioritySync",false);
|
|
|
|
+
|
|
|
|
+ Space.Builder player = Space.newBuilder();
|
|
|
|
+ PointPO playerPosition = user.getPlayerPosition();
|
|
|
|
+ Point playerPt = Point.newBuilder().setX(String.valueOf(playerPosition.getX())).setY(String.valueOf(playerPosition.getY())).setZ(String.valueOf(playerPosition.getZ())).build();
|
|
|
|
+ player.setPosition(playerPt);
|
|
|
|
+ AnglePO playerAngle = user.getPlayerAngle();
|
|
|
|
+ AngleUe4 playerAg =AngleUe4.newBuilder().setPitch(playerAngle.getPitch()).setYaw(playerAngle.getYaw()).setRoll(playerAngle.getRoll()).build();
|
|
|
|
+ player.setAngle(playerAg);
|
|
|
|
+ userInfo.put("player",player);
|
|
|
|
+
|
|
|
|
+ userInfo.put("camera",null);
|
|
|
|
+ userInfo.put("cameraCenter",null);
|
|
|
|
+
|
|
|
|
+ State playerState = createPlayerState(userInfo);
|
|
|
|
+ RenderInfo renderInfo = createRenderInfo();
|
|
|
|
+ Event event = createEvent();
|
|
|
|
+
|
|
|
|
+ UserState userState = createUserState( user.getUserId(), playerState, renderInfo, event);
|
|
|
|
+ builder.addNewUserStates(userState);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//builder.setNewUserStates();
|
|
//builder.setNewUserStates();
|
|
@@ -696,17 +724,26 @@ public class sceneGrpcServer extends SceneGrpcServiceGrpc.SceneGrpcServiceImplBa
|
|
*/
|
|
*/
|
|
int actionType = request.getActionType();
|
|
int actionType = request.getActionType();
|
|
DirAction dirAction = request.getDirAction();
|
|
DirAction dirAction = request.getDirAction();
|
|
-
|
|
|
|
String trace_id = request.getTraceId();
|
|
String trace_id = request.getTraceId();
|
|
String user_id = request.getUserId();
|
|
String user_id = request.getUserId();
|
|
String packet_id = request.getPacketId();
|
|
String packet_id = request.getPacketId();
|
|
|
|
|
|
- UserEntity user = userService.findUserId(user_id);
|
|
|
|
- Long breakPointId = user.getBreakPointId();
|
|
|
|
|
|
+ JoystickPO joystickPO = new JoystickPO();
|
|
|
|
+ joystickPO.setAction_type(actionType);
|
|
|
|
+ JSONObject dir_action = new JSONObject();
|
|
|
|
+ dir_action.put("move_angle",dirAction.getMoveAngle());
|
|
|
|
+ dir_action.put("speed_level",dirAction.getSpeedLevel());
|
|
|
|
+ joystickPO.setDir_action(dir_action);
|
|
|
|
+ joystickPO.setTrace_id(trace_id);
|
|
|
|
+ joystickPO.setUser_id(user_id);
|
|
|
|
+ joystickPO.setPacket_id(packet_id);
|
|
|
|
+ //redisCache.setCacheObject("setCacheRequest:"+user_id,joystickPO);
|
|
|
|
+ //UserEntity user = userService.findUserId(user_id);
|
|
|
|
+ //Long breakPointId = user.getBreakPointId();
|
|
//获得当前点所有邻居点
|
|
//获得当前点所有邻居点
|
|
//TODO 获取棋盘邻居点 getContact
|
|
//TODO 获取棋盘邻居点 getContact
|
|
- BreakpointsEntity breakpointsEntity = breakpointsService.findByAppIdAndBreakPointId(user.getAppId(), breakPointId);
|
|
|
|
- log.info("breakpointsEntity-getContact",breakpointsEntity.getContact());
|
|
|
|
|
|
+ //BreakpointsEntity breakpointsEntity = breakpointsService.findByAppIdAndBreakPointId(user.getAppId(), breakPointId);
|
|
|
|
+ //log.info("breakpointsEntity-getContact",breakpointsEntity.getContact());
|
|
//找到与角度move_angle最近的邻居点
|
|
//找到与角度move_angle最近的邻居点
|
|
//移动player,并且更新相机角度
|
|
//移动player,并且更新相机角度
|
|
NormalReply.Builder builder = NormalReply.newBuilder();
|
|
NormalReply.Builder builder = NormalReply.newBuilder();
|