|
|
@ -87,6 +87,12 @@ public class ClientService implements IClientService { |
|
|
|
//查询结果,返回对应的信息
|
|
|
|
return joinResult(gameUserJoins.get(0), gameRecord, isGroup, join.getGroupId()); |
|
|
|
} |
|
|
|
if (isGroup) { |
|
|
|
if (ObjectUtil.isNull(join.getGroupId())) { |
|
|
|
log.info("分组信息为空"); |
|
|
|
throw new BaseException(CodeEnum.GROUP_NOT_CHOICE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//游戏已结束
|
|
|
|
if (gameRecord.getGameStatus().byteValue() == GameConstant.GAME_COMPLETED) { |
|
|
@ -107,7 +113,6 @@ public class ClientService implements IClientService { |
|
|
|
} |
|
|
|
|
|
|
|
// 判断是否达到组内上限
|
|
|
|
// if (gameRecord.getMemberLimit())
|
|
|
|
if (isGroup) { |
|
|
|
GameUserJoinGroupExample groupExample = new GameUserJoinGroupExample(); |
|
|
|
groupExample.createCriteria().andGameGroupIdEqualTo(join.getGroupId()); |
|
|
@ -134,7 +139,7 @@ public class ClientService implements IClientService { |
|
|
|
userJoin.setLocalStartTime(prepare || processing ? gameRecord.getStartTime() + timeMore : 0); |
|
|
|
userJoin.setLocalEndTime(prepare || processing ? gameRecord.getEndTime() + timeMore : 0); |
|
|
|
// 获取头像和用户名
|
|
|
|
JsonResponse<MemberVo.MemberInfo> memberInfo = tallFeignClient.getMemberByUserId(userId, join.getProjectId()); |
|
|
|
JsonResponse<MemberVo.MemberInfo> memberInfo = tallFeignClient.getMemberByUserId(userId, gameRecord.getTaskId()); |
|
|
|
if (memberInfo.getData() == null) { |
|
|
|
memberInfo = tallFeignClient.getUserByUserId(userId); |
|
|
|
} |
|
|
@ -166,10 +171,6 @@ public class ClientService implements IClientService { |
|
|
|
gameUserJoinDao.insertSelective(userJoin); |
|
|
|
//如果是分组游戏,则添加用户与组的关联表
|
|
|
|
if (isGroup) { |
|
|
|
if (ObjectUtil.isNull(join.getGroupId())) { |
|
|
|
log.info("分组信息为空"); |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
GameUserJoinGroup userJoinGroup = new GameUserJoinGroup(); |
|
|
|
userJoinGroup.setId(snowflake.nextId()); |
|
|
|
userJoinGroup.setUserJoinId(userJoin.getId()); |
|
|
|