Browse Source

Merge branch 'dev' of GameCenter/game-center into master

zhimo 3 days ago
parent
commit
43a19da1c8

+ 1 - 1
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/SDKApplication.java

@@ -25,7 +25,7 @@ public class SDKApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <放开设备注册账号的限制-只限制仙剑导量包> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <角色信息上报-等级更新回传-01> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 8 - 4
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameUserRoleServiceImpl.java

@@ -176,6 +176,8 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
                 + "_" + param.getRoleId(), 0L, 20L, TimeUnit.SECONDS)) {
             return Boolean.TRUE;
         }
+        //判断是否等级变更
+        boolean updateRoleLevel = param.getRoleLevel() > gameUserRole.getRoleLevel();
         //角色vip等级
         if (param.getRoleVipLevel() != null) {
             gameUserRole.setRoleVipLevel(param.getRoleVipLevel());
@@ -183,17 +185,19 @@ public class GameUserRoleServiceImpl extends ServiceImpl<GameUserRoleMapper, Gam
         //角色战力和帮派信息
         if (param.getRolePower() != null && param.getRolePower() > 0L) {
             gameUserRole.setRolePower(param.getRolePower());
-            if (param.getExtra() != null && Strings.isNotBlank(JsonUtil.toString(param.getExtra()))) {
-                gameUserRole.setExtra(JsonUtil.toString(param.getExtra()));
-            }
         }
+        //角色帮派/国家信息更新
+        if (param.getExtra() != null && Strings.isNotBlank(JsonUtil.toString(param.getExtra()))) {
+            gameUserRole.setExtra(JsonUtil.toString(param.getExtra()));
+        }
+        //其他信息更新
         gameUserRole.setRoleName(param.getRoleName());
         gameUserRole.setRoleLevel(param.getRoleLevel());
         gameUserRole.setServerName(param.getServerName());
         gameUserRole.setUpdateTime(LocalDateTime.now());
         boolean result = super.updateById(gameUserRole);
         //等级变更
-        if (param.getRoleLevel() > gameUserRole.getRoleLevel()) {
+        if (updateRoleLevel) {
             //用户创角回传
             callBackService.roleCallBack(gameUserRole);
             //玩家消息推送