gitxsm há 12 horas atrás
pai
commit
fbdd5fa7bc
1 ficheiros alterados com 19 adições e 9 exclusões
  1. 19 9
      script/module/absAct/FootballMatchLogic.lua

+ 19 - 9
script/module/absAct/FootballMatchLogic.lua

@@ -29,6 +29,7 @@
             roundResults = {        -- 5轮结果 player/ai: 0没进 1进球 2未出
             roundResults = {        -- 5轮结果 player/ai: 0没进 1进球 2未出
                 { player = 2, ai = 2 }, ...
                 { player = 2, ai = 2 }, ...
             },
             },
+            isEnd = 0,              -- 上一场是否刚结束(QUERY state=3, 新开一局时清除)
         },
         },
     }
     }
     协议推送:
     协议推送:
@@ -332,6 +333,7 @@ local function finishMatch(human, id, match, winner)
     end
     end
     BagLogic.addItemList(human, copyItemList(getMatchReward(isWin)), LOGTAG)
     BagLogic.addItemList(human, copyItemList(getMatchReward(isWin)), LOGTAG)
     match.phase = PHASE_IDLE
     match.phase = PHASE_IDLE
+    match.isEnd = 1
     YunYingLogic.sendBanner(human)
     YunYingLogic.sendBanner(human)
     local config = AbsActExcel.absActivity[id]
     local config = AbsActExcel.absActivity[id]
     if config then
     if config then
@@ -409,16 +411,23 @@ local function fillQueryNet(msgRet, human, id)
     msgRet.winCnt = absAct.winCnt
     msgRet.winCnt = absAct.winCnt
     fillPageRedDotArr(msgRet, absAct)
     fillPageRedDotArr(msgRet, absAct)
     fillCostItem(msgRet)
     fillCostItem(msgRet)
-    if not match or match.phase == PHASE_IDLE then
-        msgRet.opponentName = ""
-        msgRet.round = 0
-        msgRet.state = STATE_IDLE
+    if match and match.phase ~= PHASE_IDLE then
+        msgRet.opponentName = match.opponentName or ""
+        msgRet.round = match.round or 1
+        msgRet.state = phaseToQueryState(match.phase)
         fillAllRoundResults(msgRet, match)
         fillAllRoundResults(msgRet, match)
         return
         return
     end
     end
-    msgRet.opponentName = match.opponentName or ""
-    msgRet.round = match.round or 1
-    msgRet.state = phaseToQueryState(match.phase)
+    if match and match.isEnd == 1 then
+        msgRet.opponentName = match.opponentName or ""
+        msgRet.round = match.round or 0
+        msgRet.state = STATE_ROUND_END
+        fillAllRoundResults(msgRet, match)
+        return
+    end
+    msgRet.opponentName = ""
+    msgRet.round = 0
+    msgRet.state = STATE_IDLE
     fillAllRoundResults(msgRet, match)
     fillAllRoundResults(msgRet, match)
 end
 end
 
 
@@ -637,6 +646,7 @@ function startMatch(human, id)
         playerScore = 0,
         playerScore = 0,
         aiScore = 0,
         aiScore = 0,
         roundResults = initMatchResults(),
         roundResults = initMatchResults(),
+        isEnd = 0,
     }
     }
     sendQuery(human, id)
     sendQuery(human, id)
 end
 end
@@ -724,8 +734,8 @@ local function playerSave(human, id, saveDir)
         playerDir = saveDir,
         playerDir = saveDir,
         opponentDir = aiShootDir,
         opponentDir = aiShootDir,
         isGoal = goal and 1 or 0,
         isGoal = goal and 1 or 0,
-        round = round,
-        state = STATE_ROUND_END,
+        round = match.round,
+        state = STATE_SHOOT,
     })
     })
 end
 end