Forráskód Böngészése

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

zhimo 1 éve
szülő
commit
644da20c1d

+ 2 - 6
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/service/impl/GameServerServiceImpl.java

@@ -1,7 +1,5 @@
 package com.zanxiang.game.data.serve.service.impl;
 
-import java.util.List;
-
 import com.google.common.base.CaseFormat;
 import com.zanxiang.game.data.serve.component.DataPowerComponent;
 import com.zanxiang.game.data.serve.pojo.dto.*;
@@ -24,11 +22,9 @@ import org.nutz.dao.sql.Criteria;
 import org.nutz.dao.sql.Sql;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.util.StopWatch;
 import reactor.util.function.Tuple2;
 import reactor.util.function.Tuples;
 
-import javax.annotation.Resource;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
 import java.math.BigDecimal;
@@ -829,7 +825,7 @@ public class GameServerServiceImpl implements IGameServerService {
         StringBuilder sql = new StringBuilder(StringUtils.EMPTY);
         for (int i = 1; i <= 90; i++) {
             sql.append("""
-                    concat(ifnull(round(c.da%d_active_num / e.new_da%d_total_num ,4),0)*100,'/',round(ifnull((d.new_da%d_num + d.old_da%d_num) / d.new_da%d_total_num,0)*100,4),'/',IFNULL(c.da%d_reg_num,0),'/',IFNULL(c.da%d_num,0)) as da_str%d,
+                    concat(ifnull(round(c.da%d_active_num / e.new_da%d_total_num,4),0),'/',round(ifnull((d.new_da%d_num + d.old_da%d_num) / d.new_da%d_total_num,0),4),'/',IFNULL(c.da%d_reg_num,0),'/',IFNULL(c.da%d_num,0)) as da_str%d,
                      """.formatted(i, i, i, i, i, i, i, i));
 
         }
@@ -843,7 +839,7 @@ public class GameServerServiceImpl implements IGameServerService {
         StringBuilder sql = new StringBuilder(StringUtils.EMPTY);
         for (int i = 1; i <= 90; i++) {
             sql.append("""
-                    concat(ifnull(round((SUM(c.da%d_active_num) / SUM(e.new_da%d_total_num)*100) ,4),0),'/',ifnull(round(((SUM(d.new_da%d_num) + SUM(d.old_da%d_num)) / SUM(d.new_da%d_total_num))*100,4),0),'/',IFNULL(SUM(c.da%d_reg_num),0),'/',IFNULL(SUM(c.da%d_num),0)) as da_str%d,
+                    concat(ifnull(round(SUM(c.da%d_active_num) / SUM(e.new_da%d_total_num) ,4),0),'/',ifnull(round(((SUM(d.new_da%d_num) + SUM(d.old_da%d_num)) / SUM(d.new_da%d_total_num)),4),0),'/',IFNULL(SUM(c.da%d_reg_num),0),'/',IFNULL(SUM(c.da%d_num),0)) as da_str%d,
                      """.formatted(i, i, i, i, i, i, i, i));
         }
         return sql.toString();

+ 3 - 0
game-data/game-data-serve/src/main/java/com/zanxiang/game/data/serve/task/GameMonitorAlarmTask.java

@@ -38,9 +38,12 @@ public class GameMonitorAlarmTask {
     @Scheduled(cron = "0 */5 * * * *")
     public void run() {
         log.info("游戏监控告警定时任务开始.");
+        log.info("run{}", run);
         Future<?> future =  taskScheduler.submit(()->{
             try {
+                log.info("游戏监控在线程里开始执行");
                 if (!run) {
+                    log.info("游戏监控告警定时任务本地不执行.");
                     return;
                 }
                 try {

+ 8 - 0
game-module/game-module-manage/src/main/java/com/zanxiang/game/module/manage/controller/GameServerController.java

@@ -107,6 +107,14 @@ public class GameServerController {
         return ResultVO.ok(gameServerService.getServerList(gameId, Boolean.FALSE));
     }
 
+    @ApiOperation(value = "获取参与合服的区服列表")
+    @GetMapping(value = "/merge/server/list")
+    @PreAuthorize(permissionKey = "manage:gameServer:mergeServerList")
+    @ApiResponses(value = {@ApiResponse(code = 200, message = "成功", response = GameServerVO.class)})
+    public ResultVO<List<GameServerVO>> mergeServerList(@RequestParam Long gameId) {
+        return ResultVO.ok(gameServerService.getServerList(gameId, Boolean.TRUE));
+    }
+
     @ApiOperation(value = "获取所有区服列表(无分页)")
     @GetMapping(value = "/all/server/list")
     @PreAuthorize(permissionKey = "manage:gameServer:allServer")

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

@@ -23,7 +23,7 @@ public class SDKApplication {
 
     public static void main(String[] args) {
         SpringApplication.run(SDKApplication.class, args);
-        System.out.println("赞象SDK服务启动成功 <CP发送消息代码提交> ( ´・・)ノ(._.`) \n" +
+        System.out.println("赞象SDK服务启动成功 <H5端加配置字段, 回传修改> ( ´・・)ノ(._.`) \n" +
                 " ___________ _   __\n" +
                 "/  ___|  _  \\ | / /\n" +
                 "\\ `--.| | | | |/ / \n" +

+ 8 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/pojo/vo/GameInitVO.java

@@ -7,6 +7,8 @@ import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
+import java.util.Map;
+
 /**
  * @author : lingfeng
  * @time : 2023-06-29
@@ -47,4 +49,10 @@ public class GameInitVO {
      */
     @ApiModelProperty(notes = "H5游戏配置")
     private H5GameConfigDTO h5GameConfigDTO;
+
+    /**
+     * H5游戏配置新(老的字段 h5GameConfigDTO 保留, 但是新加的字段都只会在这个新字段中返回)
+     */
+    @ApiModelProperty(notes = "H5游戏配置新")
+    private Map<String, Object> h5GameConfigMap;
 }

+ 9 - 9
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/CallBackServiceImpl.java

@@ -79,7 +79,7 @@ public class CallBackServiceImpl implements ICallBackService {
         }
         //查询小游戏信息或者H5游戏相关公众号信息
         GameApplet gameApplet = gameAppletService.getOne(new LambdaQueryWrapper<GameApplet>()
-                .eq(GameApplet::getGameId, user.getGameId()));
+                .eq(GameApplet::getGameId, agent.getGameId()));
         log.error("用户注册回传, userId : {}", user.getId());
         try {
             //腾讯H5回传
@@ -128,7 +128,7 @@ public class CallBackServiceImpl implements ICallBackService {
         }
         //查询小游戏信息或者H5游戏相关公众号信息
         GameApplet gameApplet = gameAppletService.getOne(new LambdaQueryWrapper<GameApplet>()
-                .eq(GameApplet::getGameId, user.getGameId()));
+                .eq(GameApplet::getGameId, agent.getGameId()));
         log.error("用户创角回传, userId : {}", user.getId());
         try {
             //腾讯H5回传
@@ -175,7 +175,7 @@ public class CallBackServiceImpl implements ICallBackService {
         }
         //查询小游戏信息或者H5游戏相关公众号信息
         GameApplet gameApplet = gameAppletService.getOne(new LambdaQueryWrapper<GameApplet>()
-                .eq(GameApplet::getGameId, user.getGameId()));
+                .eq(GameApplet::getGameId, agent.getGameId()));
         log.error("用户订单回传, orderId : {}", platformOrderDTO.getOrderId());
         try {
             //腾讯H5回传
@@ -211,7 +211,7 @@ public class CallBackServiceImpl implements ICallBackService {
     private TencentRoleRegisterRpcDTO transform(User user, Agent agent, GameApplet gameApplet, GameUserRole gameUserRole) {
         return TencentRoleRegisterRpcDTO.builder()
                 .backPolicyId(agent.getBackPolicyId())
-                .gameId(gameUserRole.getGameId())
+                .gameId(agent.getGameId())
                 .adAccountId(agent.getAccountId())
                 .registerTime(gameUserRole.getCreateTime())
                 .channel(agent.getAgentKey())
@@ -230,7 +230,7 @@ public class CallBackServiceImpl implements ICallBackService {
                 .reportUrl(agent.getReportUrl())
                 .build();
         return TtRoleRegisterRpcDTO.builder()
-                .gameId(gameUserRole.getGameId())
+                .gameId(agent.getGameId())
                 .backPolicyId(agent.getBackPolicyId())
                 .accountReport(ttAccountRpcDTO)
                 .wechatAppId(gameApplet == null ? null : gameApplet.getAppId())
@@ -245,7 +245,7 @@ public class CallBackServiceImpl implements ICallBackService {
     private TencentUserDTO transform(User user, Agent agent, GameApplet gameApplet) {
         return TencentUserDTO.builder()
                 .backPolicyId(agent.getBackPolicyId())
-                .gameId(user.getGameId())
+                .gameId(agent.getGameId())
                 .adAccountId(agent.getAccountId())
                 .registerTime(user.getCreateTime())
                 .channel(agent.getAgentKey())
@@ -262,7 +262,7 @@ public class CallBackServiceImpl implements ICallBackService {
                 .reportUrl(agent.getReportUrl())
                 .build();
         return TtUserActiveRpcDTO.builder()
-                .gameId(user.getGameId())
+                .gameId(agent.getGameId())
                 .wechatAppId(gameApplet == null ? null : gameApplet.getAppId())
                 .wechatOpenId(user.getOpenId())
                 .accountReport(ttAccountRpcDTO)
@@ -279,7 +279,7 @@ public class CallBackServiceImpl implements ICallBackService {
     private TencentOrderDTO transform(PlatformOrderDTO platformOrderDTO, User user, Agent agent, GameApplet gameApplet) {
         return TencentOrderDTO.builder()
                 .backPolicyId(agent.getBackPolicyId())
-                .gameId(platformOrderDTO.getGameId())
+                .gameId(agent.getGameId())
                 .adAccountId(agent.getAccountId())
                 .registerTime(user.getCreateTime())
                 .rechargeMoney(platformOrderDTO.getAmount().longValue() * 100)
@@ -303,7 +303,7 @@ public class CallBackServiceImpl implements ICallBackService {
                 .reportUrl(agent.getReportUrl())
                 .build();
         return TtOrderRpcDTO.builder()
-                .gameId(platformOrderDTO.getGameId())
+                .gameId(agent.getGameId())
                 .accountReport(ttAccountRpcDTO)
                 .wechatAppId(gameApplet == null ? null : gameApplet.getAppId())
                 .wechatOpenId(openId)

+ 1 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/GameAppletServiceImpl.java

@@ -192,6 +192,7 @@ public class GameAppletServiceImpl extends ServiceImpl<GameAppletMapper, GameApp
                 .gameName(game.getName())
                 .isPut(game.getIsPut())
                 .h5GameConfigDTO(Strings.isBlank(h5GameConfig) ? null : JsonUtil.toObj(h5GameConfig, H5GameConfigDTO.class))
+                .h5GameConfigMap(Strings.isBlank(h5GameConfig) ? null : JsonUtil.toMapWithClass(h5GameConfig, Map.class))
                 .build();
     }
 }