ludo游戏结束ticket判断

This commit is contained in:
2025-08-07 15:54:50 +08:00
parent 32f5327d9c
commit 04ba511018

View File

@@ -163,29 +163,30 @@ public class MiniGameForNavSettleListener implements ApplicationListener<MiniGam
long durationSecond = Duration.between(miniGameMatchRound.getCreateTime().toInstant(), Instant.now()).getSeconds();
log.info("[ludo] 结算战局 match结果 {} roomId {} roundId {} fromMatchId {} fromUid {} toMatchId {} toUid {} winUid {} winReward {} 成功匹配时间 {} 距离现在 {} 秒 gameEndDto {}",
log.info("[ludo] 结算战局 match结果 {} roomId {} roundId {} fromMatchId {} fromUid {} toMatchId {} toUid {} winUid {} winReward {} 成功匹配时间 {} 距离现在 {} 秒 gameEndDto {} gameModeDto {}",
updateMatchResult, miniGameMatchRound.getRoomId(), miniGameMatchRound.getId(), miniGameMatchRound.getFromUid(), miniGameMatchRound.getFromUid(), miniGameMatchRound.getToMatchId(), miniGameMatchRound.getToUid(),
winUid, winner, miniGameMatchRound.getCreateTime(), durationSecond,
JSON.toJSONString(gameEndDto));
JSON.toJSONString(gameEndDto), JSON.toJSONString(gameModeDto));
for (PlayerResultDto result : results){
if (result.getIs_ai() == Constant.Yes1No0.YES){
continue;
}
miniGameLudoUserRecordService.saveUserRecord(MiniGameLudoUserRecord.EntranceEnum.HOME.getValue(), gameEndDto, result, BigDecimal.valueOf(gameModeDto.getTicket()));
BigDecimal ticket = BigDecimal.valueOf(gameModeDto.getTicket());
miniGameLudoUserRecordService.saveUserRecord(MiniGameLudoUserRecord.EntranceEnum.HOME.getValue(), gameEndDto, result, ticket);
if (result.getIs_escaped() == Constant.Yes1No0.YES){
continue;
}
if (gameModeDto.getTicket().compareTo(Double.NaN) > 0){
if (ticket.compareTo(BigDecimal.ZERO) > 0){
MiniGamePaidLudoSettlementRecord record = new MiniGamePaidLudoSettlementRecord();
record.setMgId(mgId);
record.setRoundId(miniGameMatchRound.getGameRoundId());
record.setRoomUid(roomId);
record.setUid(Long.valueOf(result.getUid()));
record.setTicket(BigDecimal.valueOf(gameModeDto.getTicket()));
record.setTicket(ticket);
record.setGameBeginTime(new Date(gameEndDto.getBattle_start_at() * 1000));
record.setGameEndTime(new Date(gameEndDto.getBattle_end_at() * 1000));
applicationContext.publishEvent(new MiniGamePaidLudoSettlementEvent(record));