|
@@ -102,6 +102,10 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
|
}
|
|
|
//等级提升更新
|
|
|
if (Objects.equals(dataType, DataTypeEnum.TYPE_LEVEL_UP.getDateType())) {
|
|
|
+ //更新频率限制, 20秒更新一次, 避免游戏实时战力高频上报
|
|
|
+ if (!distributedLockComponent.doLock(RedisKeyConstant.ROLE_LEVEL_UP + userData.getUserId(), 0L, 20L, TimeUnit.SECONDS)) {
|
|
|
+ return Boolean.TRUE;
|
|
|
+ }
|
|
|
return super.update(new LambdaUpdateWrapper<GameUserRole>()
|
|
|
.set(GameUserRole::getRoleName, param.getRoleName())
|
|
|
.set(GameUserRole::getRoleLevel, param.getRoleLevel())
|
|
@@ -156,6 +160,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
|
.createTime(param.getRoleGradeUpdateTime() == null || param.getRoleGradeUpdateTime() <= 0 ? LocalDateTime.now() : DateUtil.secondToLocalDateTime(param.getRoleGradeUpdateTime()))
|
|
|
.updateTime(LocalDateTime.now())
|
|
|
.lastLoginTime(LocalDateTime.now())
|
|
|
+ .extra(param.getExtra() == null ? null : JsonUtil.toString(param.getExtra()))
|
|
|
.build();
|
|
|
super.save(userRole);
|
|
|
//更新玩家创角数
|