|
@@ -66,6 +66,9 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
@Autowired
|
|
@Autowired
|
|
private IDistributedLockComponent distributedLockComponent;
|
|
private IDistributedLockComponent distributedLockComponent;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private IPushMsgService pushMsgService;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private IGameExtService gameExtService;
|
|
private IGameExtService gameExtService;
|
|
|
|
|
|
@@ -105,7 +108,14 @@ 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);
|
|
this.gameRoleUpdate(gameUserRoleParam, gameUserRole, userData);
|
|
|
|
+
|
|
|
|
+ if (updateRoleLevel) {
|
|
|
|
+ pushMsgService.pushMsgByLevelUpdate(gameUserRoleParam, userData);
|
|
|
|
+ }
|
|
return Boolean.TRUE;
|
|
return Boolean.TRUE;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -154,8 +164,16 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
LoginTypeEnum.LOGIN_IN.getLoginType());
|
|
LoginTypeEnum.LOGIN_IN.getLoginType());
|
|
}
|
|
}
|
|
|
|
|
|
- if (Objects.equals(dataType, DataTypeEnum.TYPE_LEVEL_UP.getDateType())) {
|
|
+ if (gameUserRole != null && Objects.equals(dataType, DataTypeEnum.TYPE_LEVEL_UP.getDateType())) {
|
|
- return this.gameRoleUpdate(param, gameUserRole, userData);
|
|
+
|
|
|
|
+ boolean updateRoleLevel = param.getRoleLevel() > gameUserRole.getRoleLevel();
|
|
|
|
+
|
|
|
|
+ boolean result = this.gameRoleUpdate(param, gameUserRole, userData);
|
|
|
|
+
|
|
|
|
+ if (updateRoleLevel) {
|
|
|
|
+ pushMsgService.pushMsgByLevelUpdate(param, userData);
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
}
|
|
}
|
|
|
|
|
|
if (Objects.equals(dataType, DataTypeEnum.TYPE_EXIT_GAME.getDateType())) {
|
|
if (Objects.equals(dataType, DataTypeEnum.TYPE_EXIT_GAME.getDateType())) {
|
|
@@ -245,6 +263,8 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
callBackService.roleCallBack(userRole, userData);
|
|
callBackService.roleCallBack(userRole, userData);
|
|
|
|
|
|
kafkaService.eventTrack(KafkaEventTrackEnum.KAFKA_EVENT_TRACK_ROLE_CREATE, JsonUtil.toString(userRole));
|
|
kafkaService.eventTrack(KafkaEventTrackEnum.KAFKA_EVENT_TRACK_ROLE_CREATE, JsonUtil.toString(userRole));
|
|
|
|
+
|
|
|
|
+ this.callListenIn(param, userData);
|
|
}
|
|
}
|
|
|
|
|
|
private GameUserRole transform(GameUserRoleUpdateParam param, UserData userData, GameUser gameUser, User user) {
|
|
private GameUserRole transform(GameUserRoleUpdateParam param, UserData userData, GameUser gameUser, User user) {
|
|
@@ -326,8 +346,7 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
|
|
.build();
|
|
.build();
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
+ private void callListenIn(GameUserRoleUpdateParam param, UserData userData) {
|
|
- public void callListenIn(GameUserRoleUpdateParam param, UserData userData) {
|
|
|
|
Map<String, String> map = new HashMap<>(2);
|
|
Map<String, String> map = new HashMap<>(2);
|
|
map.put("json", JsonUtil.toString(param));
|
|
map.put("json", JsonUtil.toString(param));
|
|
map.put("userData", JsonUtil.toString(userData));
|
|
map.put("userData", JsonUtil.toString(userData));
|