|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.game.business.domain.AppGame;
|
|
|
import com.game.business.service.IAppGameService;
|
|
|
import com.game.business.websocket.server.WebSocketServer;
|
|
|
+import com.game.common.utils.DateUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
@@ -32,18 +33,28 @@ public class AppGameHanaderTask {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- AppGame appGame = appGameService.selectAppGameByCode(gameCode);
|
|
|
+ int countdown = 59;
|
|
|
|
|
|
- if(appGame == null) return;
|
|
|
-
|
|
|
- int countdown = 60;
|
|
|
+ boolean isStart = false;
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
|
while (true){
|
|
|
|
|
|
- try {
|
|
|
+ AppGame appGame = appGameService.selectAppGameByCode(gameCode);
|
|
|
+ if(appGame == null) return;
|
|
|
+
|
|
|
+ String ss = DateUtils.dateTimeNow(DateUtils.SS);
|
|
|
+ int miao = Integer.parseInt(ss);
|
|
|
|
|
|
+ try {
|
|
|
+ if(!isStart){
|
|
|
+ if(miao != 0){
|
|
|
+ isStart = true;
|
|
|
+ Thread.sleep(1000L);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
// 推送倒计时
|
|
|
jsonObject.put("type", "1");
|
|
|
jsonObject.put("countDown", countdown);
|