kk 1 неделя назад
Родитель
Сommit
ad41b1ecae

+ 13 - 2
game-business/src/main/java/com/game/business/task/AppGameHanaderTask.java

@@ -36,7 +36,7 @@ public class AppGameHanaderTask {
 
         if(appGame == null) return;
 
-        int countdown = 52;
+        int countdown = 60;
 
         JSONObject jsonObject = new JSONObject();
 
@@ -46,9 +46,20 @@ public class AppGameHanaderTask {
 
                 // 推送倒计时
                 jsonObject.put("type", "1");
-                jsonObject.put("countdown", countdown);
+                jsonObject.put("countDown", countdown);
+                jsonObject.put("gameId", appGame.getId());
+                jsonObject.put("gameDate", appGame.getGameDate());
                 webSocketServer.sendMessageAll(jsonObject.toJSONString());
 
+                // 推送封盘消息
+                if(countdown == 16){
+                    jsonObject = new JSONObject();
+                    jsonObject.put("type", "4");
+                    jsonObject.put("gameId", appGame.getId());
+                    jsonObject.put("gameDate", appGame.getGameDate());
+                    webSocketServer.sendMessageAll(jsonObject.toJSONString());
+                }
+
                 // 开奖
                 if(countdown == 7){
                     appGameLotteryAutoTask.autoTask(appGame.getId());

+ 6 - 2
game-business/src/main/java/com/game/business/task/AppGameLotteryAutoTask.java

@@ -181,7 +181,10 @@ public class AppGameLotteryAutoTask {
 
             JSONObject gameLottery = new JSONObject();
             gameLottery.put("type", "2");
+            gameLottery.put("gameId", appGame.getId());
+            gameLottery.put("gameDate", appGame.getGameDate());
             gameLottery.put("gameLottery", lottertSucc);
+
             webSocketServer.sendMessageAll(gameLottery.toJSONString());
 
 
@@ -238,12 +241,13 @@ public class AppGameLotteryAutoTask {
         appGame.setId(gameId);
         appGame.setGameTime(time);
 
-        if(countdown == 2){
+        if(countdown == 0){
 
-            appGame.setGameDate(DateUtils.getTime());
+            appGame.setGameDate(DateUtils.dateTimeNow());
 
             JSONObject dateJson = new JSONObject();
             dateJson.put("type", "3");
+            dateJson.put("gameId", appGame.getId());
             dateJson.put("gameDate", appGame.getGameDate());
             webSocketServer.sendMessageAll(dateJson.toJSONString());