|
@@ -111,15 +111,8 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
.eq(GameUserRole::getRoleId, gameUserRoleParam.getRoleId()));
|
|
.eq(GameUserRole::getRoleId, gameUserRoleParam.getRoleId()));
|
|
//更新游戏角色
|
|
//更新游戏角色
|
|
if (gameUserRole != null) {
|
|
if (gameUserRole != null) {
|
|
- //判断是否等级变更
|
|
|
|
- boolean updateRoleLevel = gameUserRoleParam.getRoleLevel() > gameUserRole.getRoleLevel();
|
|
|
|
//角色更新
|
|
//角色更新
|
|
- this.gameRoleUpdate(gameUserRoleParam, gameUserRole, userData);
|
|
|
|
- //玩家消息推送
|
|
|
|
- if (updateRoleLevel) {
|
|
|
|
- pushMsgService.pushMsgByLevelUpdate(gameUserRoleParam, userData);
|
|
|
|
- }
|
|
|
|
- return Boolean.TRUE;
|
|
|
|
|
|
+ return this.gameRoleUpdate(gameUserRoleParam, gameUserRole, userData);
|
|
}
|
|
}
|
|
//新建游戏角色
|
|
//新建游戏角色
|
|
this.gameRoleCreate(gameUserRoleParam, userData);
|
|
this.gameRoleCreate(gameUserRoleParam, userData);
|
|
@@ -168,15 +161,8 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
}
|
|
}
|
|
//等级提升更新
|
|
//等级提升更新
|
|
if (gameUserRole != null && Objects.equals(dataType, DataTypeEnum.TYPE_LEVEL_UP.getDateType())) {
|
|
if (gameUserRole != null && Objects.equals(dataType, DataTypeEnum.TYPE_LEVEL_UP.getDateType())) {
|
|
- //判断是否等级变更
|
|
|
|
- boolean updateRoleLevel = param.getRoleLevel() > gameUserRole.getRoleLevel();
|
|
|
|
//角色更新
|
|
//角色更新
|
|
- boolean result = this.gameRoleUpdate(param, gameUserRole, userData);
|
|
|
|
- //玩家消息推送
|
|
|
|
- if (updateRoleLevel) {
|
|
|
|
- pushMsgService.pushMsgByLevelUpdate(param, userData);
|
|
|
|
- }
|
|
|
|
- return result;
|
|
|
|
|
|
+ return this.gameRoleUpdate(param, gameUserRole, userData);
|
|
}
|
|
}
|
|
//退出游戏
|
|
//退出游戏
|
|
if (Objects.equals(dataType, DataTypeEnum.TYPE_EXIT_GAME.getDateType())) {
|
|
if (Objects.equals(dataType, DataTypeEnum.TYPE_EXIT_GAME.getDateType())) {
|
|
@@ -193,6 +179,8 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
0L, 20L, TimeUnit.SECONDS)) {
|
|
0L, 20L, TimeUnit.SECONDS)) {
|
|
return Boolean.TRUE;
|
|
return Boolean.TRUE;
|
|
}
|
|
}
|
|
|
|
+ //判断是否等级变更
|
|
|
|
+ boolean updateRoleLevel = param.getRoleLevel() > gameUserRole.getRoleLevel();
|
|
//玩家信息
|
|
//玩家信息
|
|
GameUser gameUser = gameUserService.getOne(new LambdaQueryWrapper<GameUser>()
|
|
GameUser gameUser = gameUserService.getOne(new LambdaQueryWrapper<GameUser>()
|
|
.eq(GameUser::getGameId, userData.getGameId())
|
|
.eq(GameUser::getGameId, userData.getGameId())
|
|
@@ -218,6 +206,13 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
gameUserRole.setServerName(param.getServerName());
|
|
gameUserRole.setServerName(param.getServerName());
|
|
gameUserRole.setUpdateTime(LocalDateTime.now());
|
|
gameUserRole.setUpdateTime(LocalDateTime.now());
|
|
boolean result = super.updateById(gameUserRole);
|
|
boolean result = super.updateById(gameUserRole);
|
|
|
|
+ //等级变更
|
|
|
|
+ if (updateRoleLevel) {
|
|
|
|
+ //用户创角回传
|
|
|
|
+ callBackService.roleCallBack(gameUserRole);
|
|
|
|
+ //玩家消息推送
|
|
|
|
+ pushMsgService.pushMsgByLevelUpdate(param, userData);
|
|
|
|
+ }
|
|
//角色更新数据埋点发送到卡夫卡
|
|
//角色更新数据埋点发送到卡夫卡
|
|
kafkaService.eventTrack(KafkaEventTrackEnum.KAFKA_EVENT_TRACK_ROLE_UPDATE, JsonUtil.toString(gameUserRole));
|
|
kafkaService.eventTrack(KafkaEventTrackEnum.KAFKA_EVENT_TRACK_ROLE_UPDATE, JsonUtil.toString(gameUserRole));
|
|
return result;
|
|
return result;
|