|
|
@ -440,19 +440,16 @@ public class ScreenService implements IScreenService{ |
|
|
|
long endSend = gameRecord.getEndTime() - System.currentTimeMillis(); |
|
|
|
System.out.println("开始延时:" + startSend + ",结束延时:" + endSend); |
|
|
|
System.out.println("发送开始时间" + new Date()); |
|
|
|
// delayProducer.sendDelayMessage(json.toJSONString(), startSend > 0 ? startSend : 0);
|
|
|
|
|
|
|
|
// JSONObject json2 = new JSONObject();
|
|
|
|
// json2.put("name", "修改游戏结束状态");
|
|
|
|
// delayProducer2.sendDelayMessage(json2.toJSONString(), endSend > 0 ? endSend : 0);
|
|
|
|
ScheduledExecutorService executor = Executors.newScheduledThreadPool(10); |
|
|
|
//更新开始状态
|
|
|
|
sendMsg.sendMsg(executor, startSend, () -> { |
|
|
|
gameRecord.setGameStatus(GameConstant.GAME_PREPARATION); |
|
|
|
System.out.println(GameConstant.GAME_PREPARATION + "start: "+new Date()); |
|
|
|
gameRecord.setGameStatus(GameConstant.GAME_PROCESSING); |
|
|
|
gameRecordDao.updateByPrimaryKeySelective(gameRecord); |
|
|
|
}); |
|
|
|
//更新结束状态
|
|
|
|
sendMsg.sendMsg(executor, endSend, () -> { |
|
|
|
System.out.println(GameConstant.GAME_COMPLETED + "end: "+new Date()); |
|
|
|
gameRecord.setGameStatus(GameConstant.GAME_COMPLETED); |
|
|
|
gameRecordDao.updateByPrimaryKeySelective(gameRecord); |
|
|
|
}); |
|
|
|