Переглянути джерело

提交对应的天梯赛修改

SCFC 11 місяців тому
батько
коміт
9d55f3e922

+ 1 - 0
script/module/jjcnewladder/jjcNewLadderDB.lua

@@ -370,6 +370,7 @@ function JjcNewLadderDB_initAfterStart()
                 end
             end
         else
+            JjcNewLadderDB_LoadData()
             print("[JjcNewLadderDB_initAfterStart] 不在活动时间内不处理")
         end
 

+ 10 - 6
script/module/jjcnewladder/jjcNewLadderLogic.lua

@@ -414,6 +414,7 @@ local function JjcNewLadder_SendLast3Rank(human)
             tData.worshipCnt = v.worshipCnt
             tData.worshipState = JjcNewLadderLogic_GetWorShip(human, v.uuid)
         end
+        tMsgData.tList[0] = nIndex
     end
 
     Msg.send(tMsgData, human.fd)
@@ -699,13 +700,13 @@ end
 
 -- 点赞成功
 function JjcNewLadderLogic_AddWorShipOK(tData)
-    if not tLast3RankPlayerInfo then
+    if not tLast3RankPlayerInfo or  not tLast3RankPlayerInfo.tLastRankInfo then
         print("[JjcNewLadderLogic_AddWorShipOK] 为什么点赞完不存在数据了")
         return
     end
 
     local uuidDes, nNowWorShip = tData.uuidDes, tData.nNowWorShip
-    for _, v in pairs(tLast3RankPlayerInfo) do
+    for _, v in pairs(tLast3RankPlayerInfo.tLastRankInfo) do
         if v.uuid == uuidDes then
             v.worshipCnt = nNowWorShip
             break
@@ -737,12 +738,12 @@ end
 
 -- 更新缓存的点赞数据
 function JjcNewLadderLogic_UpdateWorShip(tData)
-    if not tLast3RankPlayerInfo then
+    if not tLast3RankPlayerInfo or not tLast3RankPlayerInfo.tLastRankInfo then
         print("[JjcNewLadderLogic_UpdateWorShip] 更新缓存的点赞数据 为什么不存在数据了")
         return
     end
 
-    for _, v in pairs(tLast3RankPlayerInfo) do
+    for _, v in pairs(tLast3RankPlayerInfo.tLastRankInfo) do
         if v.uuid == tData.uuidDes then
             v.worshipCnt = tData.nNowWorShip
             break
@@ -756,6 +757,9 @@ function JjcNewLadderLogic_GetRankInfo(tData)
     local nFirst = 1
     for i = 1, JjcNewLadderDefine.JJC_NEWLADDER_RANK_SEND_LEN, 1 do
         local tRank = JjcNewLadderDB.JjcNewLadderDB_GetDBDataByRank(i)
+        if not tRank then
+            
+        end
         table.insert(tSendRankData, {tRankData = tRank, nRank = i})
 
         local nLen = #tSendRankData
@@ -1162,7 +1166,7 @@ end
 
 -- 膜拜
 function JjcNewLadderLogic_Worship(human, uuid)
-    if not tLast3RankPlayerInfo then
+    if not tLast3RankPlayerInfo or not tLast3RankPlayerInfo.tLastRankInfo  then
         print("[JjcNewLadderLogic_Worship] 不存在上一轮数据排名前3的数据")
         return
     end
@@ -1173,7 +1177,7 @@ function JjcNewLadderLogic_Worship(human, uuid)
     end
 
     local nServerID
-    for _, v in pairs(tLast3RankPlayerInfo) do
+    for _, v in pairs(tLast3RankPlayerInfo.tLastRankInfo) do
         if v.uuid == uuid then
             nServerID = v.nServerID
             break

+ 3 - 1
script/module/jjcnewladder/jjcNewLadderMiddle.lua

@@ -286,11 +286,12 @@ function WL_JJC_NEWLADDER_WORSHIP_CHANGE_C2D(msg)
     local tLast3RankInfo = CommonDB.GetJjcLadderLast3RankInfo()
     local uuid, nAddNum = msg.uuidDes, msg.nAddNum
 
-    local nNowWorShip
+    local nNowWorShip, nSrcServerID
     for _, v in pairs(tLast3RankInfo) do
         if v.uuid == uuid then
             v.worshipCnt = v.worshipCnt + nAddNum
             nNowWorShip = v.worshipCnt + 1
+            nSrcServerID = v.nServerID
             break
         end
     end
@@ -305,6 +306,7 @@ function WL_JJC_NEWLADDER_WORSHIP_CHANGE_C2D(msg)
     local tMsgData = InnerMsg.lw.LW_JJC_NEWLADDER_WORSHIP_CHANGE_D2C
     tMsgData.uuidDes = uuid
     tMsgData.nNowWorShip = nNowWorShip
+    tMsgData.nSrcServerID = nSrcServerID
 
     InnerMsg.sendMsg(0, tMsgData)
 end