Explorar el Código

修改跨服相关bug

SCFC hace 1 año
padre
commit
28d7c475f7

+ 1 - 1
script/common/CommonDB.lua

@@ -457,4 +457,4 @@ end
 function SetCommerceActInfo_SendServerMail(bValue)
 	db.commerceActInfo.bSendServerMail = bValue
 	updateValue(KEY_COMMERCEACT_INFO, db.commerceActInfo)
-end
+end

+ 3 - 1
script/common/InnerProto.lua

@@ -251,7 +251,7 @@ WL_COMMERCE_QUERY_RANK_INFO = {
 LW_COMMERCE_QUERY_SERVER_RANK = 
 {
   {"nSrcServerID",      "int"},       -- 服务器ID
-  {"nServerUuid",       "int"},       -- 服务器唯一区分ID
+  {"nServerUuid",       "string"},       -- 服务器唯一区分ID
   {"nOperate",          "int"},       -- 操作类型
 }
 
@@ -278,6 +278,8 @@ WL_COMMERCE_SEND_HUMAN_PRIZE =
 -- 清理排行榜命令
 LW_COMMERCE_CLEAR_RANK = 
 {
+  {"nRankType",         "int"},       -- 排行类型
+  {"nRankSubType",      "int"},       -- 排行榜小类型
   {"nSrcServerID",      "int"},       -- 服务器ID
 }
 -------------------- 跨服商业活动结束 ---------------------------

+ 4 - 0
script/module/chat/Gm.lua

@@ -2016,4 +2016,8 @@ end
 
 function d3.CSSendMail(human)
 	CommerceManger.CommerveManager_SendMail()
+end
+
+function d3.CSARest(human)
+	CommerceManger.CommerveManager_GMRest(human)
 end

+ 4 - 4
script/module/hero/HeroLogic.lua

@@ -472,8 +472,6 @@ function addHero(human, id, star, cnt, logType, noSend)
         uuid = heroGrid.uuid
 	end
 
-	TriggerLogic.PublishEvent(TriggerDefine.EVENT_TYPE_GETHERO, human.db._id, cnt, star)
-
 	return heroIndex, uuid
 end
 
@@ -529,8 +527,6 @@ function addHeroByGrid(human, heroGrid, logType, noSend)
 	writeLogHeroAdd(human, logType, heroGrid)
 	checkChangeMaxZDL(human, heroGrid)
 
-	-- TriggerLogic.PublishEvent(TriggerDefine.EVENT_TYPE_GETHERO, human.db._id, 1, heroGrid.star)
-
 	return emptyIndex
 end
 
@@ -1113,6 +1109,10 @@ function heroJueXingDo(human, heroID, heroIndex, inputIDList, inputIndexList)
     yunYingActParam[2] = newstar
     yunYingActParam[3] = 1
     YunYingLogic.onCallBack(human, "onHeroStarChange", yunYingActParam)
+
+	print("[heroJueXingDo] 111111")
+	TriggerLogic.PublishEvent(TriggerDefine.EVENT_TYPE_GETHERO, human.db._id, 1, newstar)
+	print("[heroJueXingDo] 222222")
 end
 
 --返还宝石

+ 67 - 48
script/module/middle/MiddleCommonRank.lua

@@ -59,10 +59,9 @@ local MIDDLE_COMMON_RANK = {
 
 }
 
--- 缓存战区已经处理完的全服邮件服务器
+-- 缓存已经要处理的战区个人邮件
 local MIDDLE_SENDSERVER_MAIL = 
 {
-
 }
 
 -- 上榜的最小条件
@@ -366,7 +365,7 @@ local function MiddleCommonRank_SortAllRank(nRankType, nRankSubType, nServerKey)
 
     table.sort(tRankData.rank2data, MiddleCommonRank_CmpRank)
 
-    local maxRank = MiddleCommonRank_GetMaxRankLen(nRankType)
+    local maxRank = MiddleCommonRank_GetMaxRankLen()
     local nNowLen = #tRankData.rank2data
 
     -- 大于了排行榜最大缓存数据
@@ -479,7 +478,7 @@ local function MiddleCommonRank_GetDBDataByUid(nRankType, nRankSubType, nServerK
     MiddleRankQueryForData.uuid = uuid
 
     local data = {}
-    LuaMongo.find(DB.db_middle_rank, CoomonQueryForData)
+    LuaMongo.find(DB.db_middle_rank, MiddleRankQueryForData)
     return LuaMongo.next(data) and data
 end
 
@@ -492,8 +491,10 @@ local function MiddleCommonRank_UpdateDBData(data)
         MiddleRankQueryForData.nServerKey = data.nServerKey
         MiddleRankQueryForData.uuid = data.uuid
         LuaMongo.update(DB.db_middle_rank, MiddleRankQueryForData, data)
+        print("[MiddleCommonRank_UpdateDBData] 存在久数据进行更新")
     else
         LuaMongo.insert(DB.db_middle_rank, data)
+        print("[MiddleCommonRank_UpdateDBData] 不存在久数据直接进行插入")
     end
 end
 
@@ -640,7 +641,7 @@ function MiddleCommonRank_QueryRankInfo(tMsgData)
     if not tRankCacheData or nil == _G.next(tRankCacheData) then
         tSendMsgData.nEnd = 1
     else
-        for nRank, v in ipairs(tRankCacheData.sendRank2data) do
+        for nRank, v in pairs(tRankCacheData.sendRank2data) do
             tSendMsgData.tRankData[0] = tSendMsgData.tRankData[0] + 1
             tSendMsgData.tRankData[tSendMsgData.tRankData[0]] = {
                 nRank = nRank,
@@ -668,69 +669,86 @@ function MiddleCommonRank_QueryServerRank(msg)
         return
     end
 
+    print("[MiddleCommonRank_QueryServerRank] 请求服务器排行榜对应服务器排名 nOperate = "..msg.nOperate.." nServerUuid = "..msg.nServerUuid)
     local tMsgData = InnerMsg.wl.WL_COMMERCE_GET_SERVERRANK_PRIZE
     tMsgData.nOperate = msg.nOperate
 
     local nServerKey = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(msg.nSrcServerID)
     nServerKey = MiddleConnect.MiddleConnect_GetWarZoneServer(nServerKey)
 
+    print("[MiddleCommonRank_QueryServerRank] 请求服务器排行榜对应服务器排名 nServerKey = "..nServerKey)
+
     local tRankCacheData = MiddleCommonRank_GetRankDataByType(CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE,
                             CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_SERVER, nServerKey)
+    local nNowRank = -1
     if not tRankCacheData then
-        tMsgData.nRank = MiddleCommonRank_GetMaxRankLen() + 1
+        print("[MiddleCommonRank_QueryServerRank] 不存在缓存数据")
+        nNowRank = MiddleCommonRank_GetMaxRankLen() + 1
     else
-        for nRank, v in ipairs(tRankCacheData) do
-            if v.uuid == msg.nServerUuid then
-                tMsgData.nRank = nRank
+        print("[MiddleCommonRank_QueryServerRank] 存在缓存数据")
+        for nRank, v in pairs(tRankCacheData.rank2data) do
+            print("[MiddleCommonRank_QueryServerRank] nRank = "..nRank)
+            if "table"== type(v) then
+                print("[MiddleCommonRank_QueryServerRank] nRank = "..nRank.." uuid = "..v.uuid.." type1 = "..type(v.uuid).." type2 = "..type(msg.nServerUuid))
+            end
+
+            if "table"== type(v) and v.uuid == msg.nServerUuid then
+                print("[MiddleCommonRank_QueryServerRank] nRank = "..nRank.." uuid = "..v.uuid.." nServerUuid = "..msg.nServerUuid)
+                nNowRank = nRank
                 break
             end
         end
     end
 
-    if not tMsgData.nRank then
-        tMsgData.nRank = MiddleCommonRank_GetMaxRankLen() + 1
+    if -1 >= nNowRank then
+        nNowRank = MiddleCommonRank_GetMaxRankLen() + 1
     end
 
-    InnerMsg.sendMsg(nSrcFD, tMsgData)
-end
-
--- 服务器发送全服邮件结束
-function MiddleCommonRank_ServerMailOk(msg)
-    -- 先获取对应配置ID,再获取最小的ID
-    local nConfServerID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(msg.nSrcServerID)
-    local nServerKey, nMaxServerID = MiddleConnect.MiddleConnect_GetWarZoneServer(nConfServerID)
+    tMsgData.nRank = nNowRank
 
-    if not MIDDLE_SENDSERVER_MAIL[nServerKey] then
-        MIDDLE_SENDSERVER_MAIL[nServerKey] = {}
-    end
+    print("[MiddleCommonRank_QueryServerRank] 获取到rank = "..nNowRank.." nSrcServerID = "..msg.nSrcServerID.." nServerKey = "..nServerKey)
 
-    MIDDLE_SENDSERVER_MAIL[nServerKey][nConfServerID] = 1
-    
-    local bOK = true
-    for i = nServerKey, nMaxServerID, 1 do
-        if not MIDDLE_SENDSERVER_MAIL[nServerKey][i] then
-            bOK = false
-            break
-        end
-    end
+    InnerMsg.sendMsg(nSrcFD, tMsgData)
+end
 
-    -- 发送全服个人奖励
-    if true == bOK then
-        local tRankData = MiddleCommonRank_GetRankDataByType(CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE,
-                        CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_HUMAN, nServerKey)
-        if tRankData then
-            local tMsgData = InnerMsg.wl.WL_COMMERCE_SEND_HUMAN_PRIZE
-            for nRank, v in ipairs(tRankData) do
+-- 延迟发送个人奖励
+function MiddleCommonRank_SendHumanRankPrize(nRankType, nRankSubType, nServerKey)
+    print("[MiddleCommonRank_SendHumanRankPrize] 开始处理对应的个人排行榜奖励 nRankType = "..nRankType.." nRankSubType = "..nRankSubType.." nServerKey = "..nServerKey)
+    local tRankData = MiddleCommonRank_GetRankDataByType(nRankType, nRankSubType, nServerKey)
+    if tRankData then
+        local tMsgData = InnerMsg.wl.WL_COMMERCE_SEND_HUMAN_PRIZE
+        for nRank, v in ipairs(tRankData.rank2data) do
+            if type(v) == "table" then
                 tMsgData.nRank = nRank
                 tMsgData.uuid = v.uuid
                 local nSrcFD = MiddleManager.getFDBySvrIndex(v.nSrcServerID)
                 if nSrcFD then
+                    print("[MiddleCommonRank_SendHumanRankPrize] nRank = "..nRank.." uuid = "..v.uuid.." nSrcServerID = "..v.nSrcServerID)
                     InnerMsg.sendMsg(nSrcFD, tMsgData)
                 else
-                    print("[MiddleCommonRank_ServerMailOk] 获取不到对应服务器的FD nSrcServerID = "..v.nSrcServerID)
+                    print("[MiddleCommonRank_SendHumanRankPrize] 获取不到对应服务器的FD nSrcServerID = "..v.nSrcServerID)
                 end
             end
         end
+    else
+        print("[MiddleCommonRank_SendHumanRankPrize] 不存在对应的个人排行榜数据 nRankType = "..nRankType.." nRankSubType = "..nRankSubType.." nServerKey = "..nServerKey)
+    end
+
+    print("[MiddleCommonRank_SendHumanRankPrize] 开始处理对应的个人排行榜奖励完成")
+
+end
+
+-- 服务器发送全服邮件结束
+function MiddleCommonRank_ServerMailOk(msg)
+    -- 先获取对应配置ID,再获取最小的ID
+    local nConfServerID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(msg.nSrcServerID)
+    local nServerKey, nMaxServerID = MiddleConnect.MiddleConnect_GetWarZoneServer(nConfServerID)
+
+    if not MIDDLE_SENDSERVER_MAIL[nServerKey] then
+        MIDDLE_SENDSERVER_MAIL[nServerKey] = 1
+        print("[MiddleCommonRank_ServerMailOk] 延迟处理个人邮件奖励 nServerKey = "..nServerKey)
+        -- 延迟处理对应个人排行榜奖励
+        Timer.addLater(10, MiddleCommonRank_SendHumanRankPrize, CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE, CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_HUMAN, nServerKey)
     end
 end
 
@@ -738,18 +756,19 @@ function MiddleCommonRank_ClearRank(msg)
     local nConfServerID = MiddleConnect.MiddleConnect_TrueServerID2ConfServerID(msg.nSrcServerID)
     local nServerKey = MiddleConnect.MiddleConnect_GetWarZoneServer(nConfServerID)
 
-    MiddleCommonRank_ResertCacheData(CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE, CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_SERVER, nServerKey)
-    MiddleCommonRank_ResertCacheData(CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE, CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_HUMAN, nServerKey)
+    MiddleCommonRank_ResertCacheData(msg.nRankType, msg.nRankSubType, nServerKey)
+    print("[MiddleCommonRank_ClearRank] 清理排行榜开始 nRankType = "..msg.nRankType.." nRankSubType = "..msg.nRankSubType.." nServerKey = "..nServerKey)
+    MiddleRankQueryByRankType.nRankType = msg.nRankType
+    MiddleRankQueryByRankType.nRankSubType = msg.nRankSubType
+    MiddleRankQueryByRankType.nServerKey = nServerKey
 
-    MiddleRankQueryForData.nRankType = CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE
-    MiddleRankQueryForData.nRankSubType = CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_SERVER
-    MiddleRankQueryForData.nServerKey = nServerKey
-
-    LuaMongo.find(DB.db_middle_rank, MiddleRankQueryForData)
-    local tData  = {}
+    LuaMongo.find(DB.db_middle_rank, MiddleRankQueryByRankType)
+    local tData = {}
     if not LuaMongo.next(tData) then
+        print("[MiddleCommonRank_ClearRank] 不存在对应的数据")
         return
     end
 
-    LuaMongo.remove(DB.db_middle_rank, MiddleRankQueryForData)
+    LuaMongo.remove(DB.db_middle_rank, MiddleRankQueryByRankType)
+    print("[MiddleCommonRank_ClearRank] 清理排行榜数据完成")
 end

+ 8 - 1
script/module/serverCommerce/Proto.lua

@@ -48,7 +48,9 @@ GC_SERVEERCOMMERCE_ACT_TASKQUERY =
 {
     {"nDay",        1,    "int"},           -- 天数
     {"nNowPoint",   1,    "int"},           -- 当前积分
+    {"nNowDay",     1,    "int"},          -- 当前是第几天
     {"list",        15,   TaskInfo},        -- 奖励信息
+    {"tRed",        8,     "byte"},         -- 天数红点 0 没有 1有
 }
 
 -- 请求领取任务奖励 
@@ -90,6 +92,7 @@ GC_SERVEERCOMMERCE_ACT_CHARGEQUERY = {
     {"nMoney",            1,       "int"},          -- 金额
     {"nChargeDay",        1,        "int"},         -- 已充值天数
     {"list",              10,        CHARGEINFO},    -- 信息
+    {"tRed",              5,        "byte"},         -- 金额红点 0 没有 1有
 }
 
 -- 请求领取连充豪礼
@@ -103,8 +106,9 @@ COMMERCESHOPINFO =
 {
     {"nID",             1,          "int"},         -- 奖励编号
     {"nNeedPoint",      1,          "int"},         -- 需要积分
+    --{"pointItem",       1,          ItemData},      -- 积分物品
     {"nFreeState",      1,          "byte"},        -- 免费奖励状态 0 不可领取 1 - 可领取 2- 已领取
-    {"nPayState",      1,           "byte"},        -- 付费奖励状态 0 不可领取 1 - 可领取 2- 已领取
+    {"nPayState",       1,           "byte"},        -- 付费奖励状态 0 不可领取 1 积分达成未购买, 2 积分未达成但购买 3 可领取 4 已领取
     {"tFreeItem",       5,          ItemData},      -- 免费奖励信息
     {"buyItem",         1,          BuyItem},       -- 直购信息
     {"tPayItem",        5,          ItemData},      -- 付费奖励信息
@@ -137,12 +141,15 @@ ServerCommerceActRankList = {
     {"rankValue",           1,         "int"},      -- 当前排名值     
     {"headFrame",           1,         "int"},      -- 头像框(未上榜为-1)
     {"servername",          1,         "string"},   -- 服务器名称
+    --{"pointItem",           1,          ItemData},  -- 积分物品
 }
 
 ServerCommerceActOnwerData = {
     {"rank",             1,          "int"},        -- 名次(-1未上榜)
     {"rankValue",        1,          "int"},        -- 当前排名值
     {"items",            5,         ItemData},      -- 档位奖励列表(未上榜没有奖励) 
+    {"rankNeedValue",        1,       "int"},     -- 积分物品
+    {"servername",      1,           "string"},     -- 服务器名称
 }
 
 -- 排行榜查询

+ 24 - 0
script/module/serverCommerce/ServerCommerceActCharge.lua

@@ -13,6 +13,13 @@ local CommonDefine = require("common.CommonDefine")
 local ServerCommerceConf = require("excel.ServerCommerce")
 local ServerCommerceManager = require("serverCommerce.ServerCommerceManager")
 
+-- 金额映射红点下标
+local tChargeMoney2Index = 
+{
+    [6] = 1,
+    [98] = 2,
+    [198] = 3,
+}
 
 ----------------------------------------- 内部处理开始 -------------------------------------
 -- 获取配置
@@ -111,6 +118,10 @@ function CommerceActCharge_Query(human, nMoney)
     local tConf = CommerceActCharge_GetCof()
     
     local tMsgData = Msg.gc.GC_SERVEERCOMMERCE_ACT_CHARGEQUERY
+    local tMoney = {}
+    local tRed = tMsgData.tRed
+    tRed[0] = 0
+
     tMsgData.nMoney = nMoney
     local nChargeDay, nLen = 0, 0
     for nID, v in ipairs(tConf) do
@@ -134,6 +145,19 @@ function CommerceActCharge_Query(human, nMoney)
                     Grid.makeItem(tPrizeData.item[nIndex], nGoodsID, nGoodsNum)
                 end
         end
+
+        if not tMoney[v.nMoney] then
+            tMoney[v.nMoney] = 1
+            tRed[0] = tRed[0] + 1
+            tRed[tChargeMoney2Index[v.nMoney]] = 0
+        end
+
+        if tRed[tChargeMoney2Index[v.nMoney]] == 0 then
+            local nState = CommerceActCharge_GetDBPrizeStatus(human, v.nDay, v.nMoney)
+            if nState == CommonDefine.COMMON_PRIZE_STATE_CANGET then
+                tRed[tChargeMoney2Index[v.nMoney]] = 1
+            end
+        end
     end
 
     tMsgData.nChargeDay = nChargeDay

+ 14 - 2
script/module/serverCommerce/ServerCommerceActDefine.lua

@@ -11,7 +11,7 @@ COMMERCEACT_LASTDAY = 7                 -- 持续时间
 COMMERCEACT_BEGINDELATTIME = 10 * 60    -- 延迟10分钟开始
 COMMERCEACT_INITSERVERTIME = 3 * 60     -- 普通服 起服3分钟请求活动是否开始
 COMMERCEACT_INITOPENDAY = 2 * 60        -- 中心服2分钟后请求普通服开服时间
-COMMERCEACT_RANKUPDATE = 5 * 60         -- 普通服 5 分钟请求排行榜数据
+COMMERCEACT_RANKUPDATE = 150            -- 普通服 5 分钟请求排行榜数据
 COMMERCEACT_ENDBATCH = 3                -- 结束批次
 
 COMMERCEACT_NOOPEN = 0                  -- 未开启
@@ -30,4 +30,16 @@ COMMERCEACT_SENDSERVERMAIL = 1          -- 发送全服邮件奖励
 COMMERCEACT_GETSERVERRANK = 2           -- 获取排名
 
 -- 服务器排行榜发送长度
-COMMERCEACT_SERVER_RANKLEN = 10         -- 服务器发送长度
+COMMERCEACT_SERVER_RANKLEN = 10         -- 服务器发送长度
+
+-- 商店付费奖励状态
+COMMERCEACT_SHOP_PAY_STATE0 = 0         -- 不可领取
+COMMERCEACT_SHOP_PAY_STATE1 = 1         -- 积分达成未购买
+COMMERCEACT_SHOP_PAY_STATE2 = 2         -- 积分未达成但购买
+COMMERCEACT_SHOP_PAY_STATE3 = 3         -- 可领取
+COMMERCEACT_SHOP_PAY_STATE4 = 4         -- 已领取
+
+-- 积分物品ID
+COMERCEACT_POINT_GOODSID = 9001         -- 积分物品ID
+
+COMMERCEACT_SHOW_OPENDAY = 8            -- 活动显示所需开服天数

+ 17 - 5
script/module/serverCommerce/ServerCommerceActRank.lua

@@ -141,6 +141,7 @@ local function CommercerActRank_WrapOwnerData(nRankType, nRankSubType, net, uuid
 	net.rankValue = tRankInfo and tRankInfo.nValue or 0
 
  	local len = 0
+    local nNeedPoint = 0
  	if nRank and tRankInfo then
         for _, v in ipairs(ServerCommerceRankConf) do
             if v.nRankType == nRankSubType then
@@ -148,6 +149,7 @@ local function CommercerActRank_WrapOwnerData(nRankType, nRankSubType, net, uuid
                     for index, itemInfo in ipairs(v.Prize) do
                         len = len + 1
                         Grid.makeItem(net.items[index], itemInfo[1], itemInfo[2])
+                        nNeedPoint = v.nPoint
                     end
                     break
                 end
@@ -160,6 +162,7 @@ local function CommercerActRank_WrapOwnerData(nRankType, nRankSubType, net, uuid
                 if v.nOrder[1] > nMinRank then
                     nMinRank = v.nOrder[1]
                     tMinPrize = v.Prize
+                    nNeedPoint = v.nPoint
                 end
             end
         end
@@ -172,6 +175,8 @@ local function CommercerActRank_WrapOwnerData(nRankType, nRankSubType, net, uuid
         end
  	end
 
+    net.rankNeedValue = nNeedPoint
+    net.servername = "寻宝"..Config.NEW_SVR_INDEX.."区"
 	net.items[0] = len
 end
 
@@ -197,10 +202,11 @@ local function CommercerActRank_WrapRankList(nRankType, nRankSubType, net, nRank
         net.servername = ""
 	end
 
-    local len = 0
+    local len, nNeedPoint = 0, 0
     for _, v in ipairs(ServerCommerceRankConf) do
         if v.nRankType == nRankSubType then
             if v.nOrder[1] <= nRank and v.nOrder[2] >= nRank then
+                nNeedPoint = v.nPoint
                 for index, itemInfo in ipairs(v.Prize) do
                     len = len + 1
                     Grid.makeItem(net.items[index], itemInfo[1], itemInfo[2])
@@ -210,6 +216,7 @@ local function CommercerActRank_WrapRankList(nRankType, nRankSubType, net, nRank
         end
     end
  	
+    --Grid.makeItem(net.pointItem, ServerCommerceDefine.COMERCEACT_POINT_GOODSID, nNeedPoint)
 	net.items[0] = len
 end
 ----------------------------------------- 外部调用 -------------------------------------
@@ -352,7 +359,7 @@ function CommercerActRank_SendServerRankPrize(tData)
     local content = mailConfig.content   
     for uuid, human in pairs(ObjHuman.onlineUuid) do
         MailManager.add(MailManager.SYSTEM, uuid, 
-						        title, Util.format(content, rank), tPrize, senderName)
+						        title, Util.format(content, nRank), tPrize, senderName)
         -- 设置该玩家已经发送邮件
         ServerCommerceManager.CommerveManager_SetHumanSendServerMail(human, true)
 
@@ -362,6 +369,7 @@ function CommercerActRank_SendServerRankPrize(tData)
 
     -- 告诉中心服全服邮件在线的处理完成
     ServerCommerceMiddle.CommerceMiddle_TellServerMailOk()
+    print("[CommercerActRank_SendServerRankPrize] 全服在线玩家邮件处理完成")
 end
 
 -- 发送玩家邮件奖励
@@ -389,7 +397,8 @@ function CommercerActRank_SendHumanRankPrize(tData)
     local human = ObjHuman.onlineUuid[uuid]
     local bNowSave = false
     if not human then
-        human = RoleDBLogic.getDb(uuid)
+        human = {}
+        human.db = RoleDBLogic.getDb(uuid)
         bNowSave = true
     end
 
@@ -399,6 +408,9 @@ function CommercerActRank_SendHumanRankPrize(tData)
         return
     end
 
+    table.print_lua_table(human.db.ServerCommerce)
+    print("[CommercerActRank_SendHumanRankPrize] 下发玩家奖励 name = "..human.db.name)
+
     local bSendMail = ServerCommerceManager.CommerveManager_GetHumanSendPlayerMail(human)
     if true == bSendMail then
         szLogText = szLogText .. "已经发送了邮件为什么又一次走到这里 name = "..human.db.name
@@ -415,7 +427,7 @@ function CommercerActRank_SendHumanRankPrize(tData)
     local senderName = mailConfig.senderName
     local content = mailConfig.content
     MailManager.add(MailManager.SYSTEM, uuid, 
-						        title, Util.format(content, rank), tPrize, senderName)
+						        title, Util.format(content, nRank), tPrize, senderName)
 
     -- 写日志
     szLogText = szLogText.."发送奖励成功"
@@ -531,7 +543,7 @@ function CommercerActRank_Query(human, nRankSubType)
         uuid = tostring(Config.NEW_SVR_INDEX)
     end
 
-    print("[CommercerActRank_Query] uuid = "..uuid)
+    -- print("[CommercerActRank_Query] uuid = "..uuid)
 
     if false == CommercerActRank_CheckCache(CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE, nRankSubType, COMMERCE_RANK_SERVER_KEY) then
         CommercerActRank_CreateCache(CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE, nRankSubType, COMMERCE_RANK_SERVER_KEY)

+ 34 - 9
script/module/serverCommerce/ServerCommerceActShop.lua

@@ -16,6 +16,7 @@ local BuyConf = require("excel.buy")
 local CommonDB = require("common.CommonDB")
 local ObjHuman = require("core.ObjHuman")
 local ServerCommerceManager = require("serverCommerce.ServerCommerceManager")
+local ServerCommerceDefine = require("serverCommerce.ServerCommerceActDefine")
 
 local COMMERCEACTFREEID = 1     -- 免费
 local COMMERCEACTPAYID  = 2     -- 付费
@@ -37,7 +38,7 @@ function CreatDB(human)
         human.db.ServerCommerce.Shop[nID] = 
         {
             [COMMERCEACTFREEID] = CommonDefine.COMMON_PRIZE_STATE_NOGET,
-            [COMMERCEACTPAYID] = CommonDefine.COMMON_PRIZE_STATE_NOGET
+            [COMMERCEACTPAYID] = ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE0
         }
     end
 
@@ -95,6 +96,8 @@ function CommerceActShop_Query(human)
 
         -- 封装购买项物品
         BuyLogic.fontBuyItem(human, tNodeData.buyItem, v.nBuyID)
+
+        --Grid.makeItem(tNodeData.pointItem, ServerCommerceDefine.COMERCEACT_POINT_GOODSID, v.nPoint)
     end
 
     Msg.send(tMsgData, human.fd)
@@ -107,14 +110,18 @@ function CommerceActShop_GetPrize(human, nType)
     local tGoods = {}
     for nID, v in ipairs(tConf) do
         local nState = CommerceActShop_GetFreeStatus(human, nID)
+        local bCanGet = false
         if COMMERCEACTPAYID == nType then
             nState = CommerceActShop_GetPayStatus(human, nID)
+            bCanGet = ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE3 == nState
+        else
+            bCanGet = CommonDefine.COMMON_PRIZE_STATE_CANGET == nState
         end
 
-        if CommonDefine.COMMON_PRIZE_STATE_CANGET == nState then
+        if true == bCanGet then
             local tPrize
             if COMMERCEACTPAYID == nType then
-                CommerceActShop_SetPayStatus(human, nID, CommonDefine.COMMON_PRIZE_STATE_GET)
+                CommerceActShop_SetPayStatus(human, nID, ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE4)
                 tPrize = v.PayPrize
             else
                 CommerceActShop_SetFreeStatus(human, nID, CommonDefine.COMMON_PRIZE_STATE_GET)
@@ -161,6 +168,15 @@ function onAllPointChange()
                 bSendClient = true
                 CommerceActShop_SetFreeStatus(human, nID, CommonDefine.COMMON_PRIZE_STATE_CANGET)
             end
+
+            nStatus = CommerceActShop_GetPayStatus(human, nID)
+            if ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE0 == nStatus then
+                -- 变成积分足够,未充值状态
+                CommerceActShop_SetPayStatus(human, nID, ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE1)
+            elseif ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE2 == nStatus then
+                -- 已经是购买状态,积分足够,直接变成可领取
+                CommerceActShop_SetPayStatus(human, nID, ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE3)
+            end
         end
 
         if true == bSendClient then
@@ -171,13 +187,18 @@ end
 
 function onCharge(human, price, funcID, buyID)
     local tConf = CommerceActShop_GetCof()
-    
+    local nNowPoint = CommonDB.GetCommerceActInfo_Point()
+    print("[CommerceActShop_onCharge] nNowPoint = "..nNowPoint)
+
     local nChoseID = 0
+    local tConfData = nil
     for nID, v in ipairs(tConf) do
         if v.nBuyID == buyID then
             local nPayState = CommerceActShop_GetPayStatus(human, nID)
-            if CommonDefine.COMMON_PRIZE_STATE_NOGET == nPayState then
+            -- 状态为0 或者状态为积分达成未购买
+            if ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE0 == nPayState or ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE1 == nPayState then
                 nChoseID = nID
+                tConfData = v
             else
                 print("[CommerceActShop_onCharge] 重复购买了 nBuyID = "..v.nBuyID)
             end
@@ -192,12 +213,16 @@ function onCharge(human, price, funcID, buyID)
         return
     end
 
-    if nChoseID == 0 then
+    if nChoseID == 0 or nil == tConfData then
         return
     end
 
-    CommerceActShop_SetPayStatus(human, nChoseID, CommonDefine.COMMON_PRIZE_STATE_CANGET)
-   
+    if nNowPoint >= tConfData.nPoint then
+        CommerceActShop_SetPayStatus(human, nChoseID, ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE3)
+    else
+        CommerceActShop_SetPayStatus(human, nChoseID, ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE2)
+    end
+
     CommerceActShop_Query(human)
 
     ServerCommerceManager.CommerceAct_SendActInfo(human)
@@ -225,7 +250,7 @@ function isRed(human)
         local nFreeStatus = CommerceActShop_GetFreeStatus(human, nID)
         local nPayState = CommerceActShop_GetPayStatus(human, nID)
         if CommonDefine.COMMON_PRIZE_STATE_CANGET == nFreeStatus or
-            CommonDefine.COMMON_PRIZE_STATE_CANGET == nPayState then
+            ServerCommerceDefine.COMMERCEACT_SHOP_PAY_STATE3 == nPayState then
             return true
         end
     end

+ 61 - 9
script/module/serverCommerce/ServerCommerceActTask.lua

@@ -39,7 +39,6 @@ function CreatDB(human)
     end
 
     human.db.ServerCommerce.Task = {
-        nTime = os.time(),          -- 当前事件
         nTaskPoint = 0,             -- 任务积分
         TaskPrize = {},             -- 任务数据
         TaskPointPrize = {},        -- 任务积分奖励
@@ -78,18 +77,30 @@ end
 
 -- 获取任务奖励DB数据
 local function CommerceActTask_GetTaskDB(human)
+    if not human.db.ServerCommerce.Task then
+        human.db.ServerCommerce.Task = {}
+        CreatDB(human)
+    end
+
     return human.db.ServerCommerce.Task
 end
 
 local function CommerceActTask_GetOpenTime(human)
-    return human.db.ServerCommerce.Task.nTime
+    local nSatrtTime = ServerCommerceManager.CommerceAct_GetOpenAndEndTime()
+    if 0 >= nSatrtTime then
+        print("[CommerceActTask_GetOpenTime] 获取的活动开始数据不正确 ")
+        return 0
+    end
+
+    return nSatrtTime
 end
 
 -- 获取任务状态
 local function CommerceActTask_GetTaskStatus(human, nID, nTaskType)
     local tDBData = CommerceActTask_GetTaskDB(human)
 
-    if not tDBData.TaskPrize[nTaskType] or not tDBData.TaskPrize[nTaskType].taskStatus[nID] then
+    if not tDBData.TaskPrize or not tDBData.TaskPrize[nTaskType] or not tDBData.TaskPrize[nTaskType].taskStatus[nID] then
+        print("[CommerceActTask_GetTaskStatus] 不存在对应的DB数据!!! 没有初始化吗?")
         return CommonDefine.COMMON_PRIZE_STATE_NOGET
     end
 
@@ -245,15 +256,20 @@ local function CommerceActTask_EvnentGetHero(nEventType, uuid, nValue1, nValue2)
     local tConf = CommerceActTask_GetTaskCof()
     for nID, v in ipairs(tConf) do
         if v.nTaskType == nEventType then
-            if not v.nTaskArgument then
+            if not v.nTaskArgument or v.nTaskArgument == "" then
                 print("[CommerceActTask_EvnentGetHero] 获得英雄但是没有获取到对应的配置参数要求")
             else
+                --print("[CommerceActTask_EvnentGetHero] 存在对应参数 nTaskArgument = "..v.nTaskArgument)
                 local tTaskArgument = Util.split(v.nTaskArgument , "|")
+                table.print_lua_table(tTaskArgument)
                 if 2 ~= #tTaskArgument then
                     print("[CommerceActTask_EvnentGetHero] 获取的任务 参数数量不正确")
                 else
-                    if nNum >= tTaskArgument[1] and nStar >= tTaskArgument[2] then
+                    if nNum >= tonumber(tTaskArgument[1]) and nStar >= tonumber(tTaskArgument[2]) then
+                        --print("CommerceActTask_EvnentGetHero 条件满足")
                         CommerceActTask_AddTaskFinishNum(human, nEventType, 1)
+                        --local nNewNum = CommerceActTask_GetTaskFinishNum(human, nEventType)
+                        --print("CommerceActTask_EvnentGetHero 条件满足, 新的数量为 nNewNum = "..nNewNum)
                         bCheck = true
                     end
                 end
@@ -314,10 +330,21 @@ end
 -- 请求战区集结任务信息
 function CommerceActTask_QueryTask(human, nDay)
     local tConf = CommerceActTask_GetTaskCof()
+    local nOpenTime = CommerceActTask_GetOpenTime(human)
+    if 0 >= nOpenTime then
+        print("[CommerceActTask_QueryTask] 获取的开服时间不正确")    
+        return
+    end
+
+    local nDiffDay = Util.diffDay(nOpenTime) + 1
     local tMsgData = Msg.gc.GC_SERVEERCOMMERCE_ACT_TASKQUERY
     tMsgData.nDay = nDay
+    tMsgData.nNowDay = nDiffDay
     tMsgData.nNowPoint = CommerceActTask_GetTaskPoint(human)
 
+    local tDay = {}
+    local tRed = tMsgData.tRed
+    tRed[0] = 0
     local tListData = tMsgData.list
     tListData[0] = 0
     for nID, v in ipairs(tConf) do
@@ -337,6 +364,19 @@ function CommerceActTask_QueryTask(human, nDay)
                 Grid.makeItem(tNode.item[i], tItemData[1], tItemData[2])
             end
         end
+
+        if not tDay[v.nDay] then
+            tDay[v.nDay] = 1
+            tRed[0] = tRed[0] + 1
+            tRed[v.nDay] = 0
+        end
+
+        if tRed[v.nDay] == 0 and v.nDay <= nDiffDay then
+            local nState = CommerceActTask_GetTaskStatus(human, nID, v.nTaskType)
+            if nState == CommonDefine.COMMON_PRIZE_STATE_CANGET then
+                tRed[v.nDay] = 1
+            end
+        end
     end
 
     Msg.send(tMsgData, human.fd)
@@ -438,7 +478,12 @@ function isRed(human)
     local tConf = CommerceActTask_GetTaskCof()
 
     local nOpenTime = CommerceActTask_GetOpenTime(human)
-    local nDiffDay = Util.diffDay(nOpenTime) 
+    if 0 >= nOpenTime then
+        print("[CommerceActTask_isRed] 不正确的活动开启时间")
+        return false
+    end
+
+    local nDiffDay = Util.diffDay(nOpenTime) + 1
     for nID, v in ipairs(tConf) do
         if v.nDay <= nDiffDay then
             local nState = CommerceActTask_GetTaskStatus(human, nID, v.nTaskType)
@@ -459,10 +504,11 @@ function isRed(human)
     return false
 end
 
-function onLogin(human)
+-- 订阅任务数据
+function CommerceActTask_HumanSubEvent(human)
     local tConf = CommerceActTask_GetTaskCof()
-
     local tTaskType = {}
+
     for nID, v in ipairs(tConf) do
         if not tTaskType[v.nTaskType] then
             local nState = CommerceActTask_GetTaskStatus(human, nID, v.nTaskType)
@@ -473,9 +519,15 @@ function onLogin(human)
         end
     end
 
+    table.print_lua_table(tTaskType)
+
     -- 订阅事件
     for nTaskType, v in pairs(tTaskType) do
         CommerceActTask_SubEvent(human.db._id, nTaskType)
-        print("[onLogin] 玩家订阅了事件 nTaskType = "..nTaskType)
+        print("[CommerceActTask_SubEvent] 玩家订阅了事件 nTaskType = "..nTaskType)
     end
+end
+
+function onLogin(human)
+    CommerceActTask_HumanSubEvent(human)
 end

+ 69 - 9
script/module/serverCommerce/ServerCommerceManager.lua

@@ -48,6 +48,11 @@ local function CommerceAct_SendData(tMsgData, fd)
     Msg.send(tMsgData, fd)
 end
 
+local function CommerceAct_CheckOpenDay()
+    local nNowOpenDay = CommonDB.getServerOpenDay()
+    return nNowOpenDay >= ServerCommerceActDefine.COMMERCEACT_SHOW_OPENDAY
+end
+
 -- 创建玩家DB数据
 function CommerceAct_CreateHumanDB(human)
     local nBatchID = 1
@@ -83,6 +88,10 @@ function CommerceAct_SendActInfo(human)
         return
     end
 
+    if false == CommerceAct_CheckOpenDay() then
+        return
+    end
+
     print("[CommerceAct_SendActInfo] 下发活动数据 开始 ")
 
     local tMsgData = Msg.gc.GC_SERVEERCOMMERCE_ACT_ALLINFO
@@ -165,6 +174,7 @@ local function CommerceAct_Begin()
     -- 遍历在线玩家
     for uuid, human in pairs(ObjHuman.onlineUuid) do
         CommerceAct_BeginAllAct(human)
+        CommerceAct_SendActInfo(human)
     end
 end
 
@@ -222,7 +232,7 @@ end
 local function CommerceAct_CreateCommonDB()
     local nNowTime = os.time()
     local tCommerceInfo = CommonDB.GetCommerceActInfo()
-    local nEndTime = nNowTime + ServerCommerceActDefine.COMMERCEACT_LASTDAY * 86400
+    local nEndTime = nNowTime + (ServerCommerceActDefine.COMMERCEACT_LASTDAY - 1)* 86400
     local tEndDate = os.date("*t",nEndTime)
     tEndDate.hour = ServerCommerceActDefine.COMMERCEACT_ENDTIME
     tEndDate.min = 0
@@ -270,6 +280,10 @@ local function CommerceAct_CreateCacheInfo(nOpen, bLater)
 
     if bLater == true then
         Timer.addLater(ServerCommerceActDefine.COMMERCEACT_BEGINDELATTIME, CommerceAct_LaterBeginAct)
+    else
+        for uuid, human in pairs(ObjHuman.onlineUuid) do
+            CommerceAct_SendActInfo(human)
+        end
     end
 end
 
@@ -286,6 +300,8 @@ local function CommerceAct_ActCheckOpen_InitServer(nOpen, nOperate, nServerKey)
         if not tCommerceInfo or nil == _G.next(tCommerceInfo) then
             print("[CommerceAct_ActCheckOpen_InitServer] 不存在commonDB数据开始创建")
             CommerceAct_CreateCommonDB()
+            -- 清理排行榜数据
+            CommerceAct_ClearRankInfo()
         else
             -- 存在数据检查是否结束
             if true == CommerceAct_CheckActIsOverTime() then
@@ -320,6 +336,14 @@ local function CommerceAct_SetHumanPoint(human, nValue)
     human.db.ServerCommerce.nPoint = nValue
 end
 
+-- 获取开始时间
+function CommerceAct_GetOpenAndEndTime()
+    if not tCommerceActInfo or not tCommerceActInfo.nStartTime or not tCommerceActInfo.nEendTime then
+        return 0, 0
+    end
+
+    return tCommerceActInfo.nStartTime, tCommerceActInfo.nEendTime
+end
 ----------------------------------------- 外部调用开始 -------------------------------------
 function onZeroAll(funcID)
     local nNowTime = os.time()
@@ -357,7 +381,7 @@ end
 function onHour(hour)
     local nNowTime = os.time()
     local tDate = os.date("*t",nNowTime)
-
+    print("[CommerceAct_onHour] 进入整点时间判断 hour = "..hour.." nNowTime = "..nNowTime)
     if tDate.hour == ServerCommerceActDefine.COMMERCEACT_ENDTIME then
         if not tCommerceActInfo or tCommerceActInfo.nOpen == ServerCommerceActDefine.COMMERCEACT_NOOPEN then
             return
@@ -365,15 +389,17 @@ function onHour(hour)
 
         local tCommerceDBInfo = CommonDB.GetCommerceActInfo()
         if not tCommerceDBInfo or nil == _G.next(tCommerceDBInfo) then
-            print("[CommerceAct_onZeroAll] 存在缓存数据, 但是获取不到DB数据")
+            print("[CommerceAct_onHour] 存在缓存数据, 但是获取不到DB数据")
             return
         end
 
         local nEndTime = tCommerceDBInfo.nEndTime
+        print("[CommerceAct_onHour] nNowTime = "..nNowTime.." nEndTime = "..nEndTime)
         if nEndTime <= nNowTime then
             -- 活动结束处理
             CommerceAct_End()
             tCommerceActInfo.nSendRankMail = true
+            tCommerceActInfo.isRun = false
         end
     end
 end
@@ -433,6 +459,11 @@ function CommerceAct_IsRun()
         return false
     end
 
+    if false == CommerceAct_CheckOpenDay() then
+        print("[CommerceAct_IsRun] 开服时间不符合条件 nNowOpenDay = ", CommonDB.getServerOpenDay())
+        return false
+    end
+
     return tCommerceActInfo.isRun
 end
 
@@ -444,9 +475,10 @@ function onLogin(human, funcID)
 
     -- 下发活动基础数据
     if true == CommerceAct_IsRun() then
+        print("[CommerceManger_onLogin] 玩家进入进行注册")
         local tCommonDBData = CommonDB.GetCommerceActInfo()
         if not tCommonDBData or nil == _G.next(tCommonDBData) then
-            print("[onLogin] 玩家登录不存在对应的数据通用DB数据!!!!")
+            print("[CommerceManger_onLogin] 玩家登录不存在对应的数据通用DB数据!!!!")
             return
         end
 
@@ -473,7 +505,12 @@ function onLogin(human, funcID)
         -- 不在活动中
         local tCommonDBData = CommonDB.GetCommerceActInfo()
         if not tCommonDBData or nil == _G.next(tCommonDBData) then
-            print("[onLogin] 玩家登录不存在对应的数据通用DB数据!!!!")
+            print("[CommerceManger_onLogin] 玩家登录不存在对应的数据通用DB数据!!!!")
+            return
+        end
+
+        if false == CommerceAct_CheckActIsOverTime() then
+            print("[CommerceManger_onLogin] 当前还在活动时间内,返回")
             return
         end
 
@@ -501,6 +538,9 @@ end
 
 -- 是否开启
 function isOpen(human, YYInfo, funcConfig)
+    if false == CommerceAct_CheckOpenDay() then
+        return 0
+    end
     local bRet = CommerceAct_IsRun()
     local nRet = bRet and 1 or 0
     print("CommerceAct_isOpen 结束 nRet = "..nRet)
@@ -517,12 +557,15 @@ function isRed(human, YYInfo, funcConfig)
         return
     end
 
-    
+    if false == CommerceAct_CheckOpenDay() then
+        return
+    end
+
     if not human.db.ServerCommerce then
         CommerceAct_CreateHumanDB(human)
     end
 
-    local bRet = false
+    local bRet
     for _, module in pairs(tCommerceActModuel) do
         if module and module.isRed then
             bRet = module.isRed(human)
@@ -530,7 +573,7 @@ function isRed(human, YYInfo, funcConfig)
                 break
             end
         end
-    end
+    end  
 
     return bRet
 end
@@ -654,6 +697,7 @@ function CommerveManager_GMClear(human)
         end
     end
 
+    table.print_lua_table(human.db.ServerCommerce)
     print("[CommerveManager_GMClear] 玩家重置数据完成 name = "..human.db.name)
 end
 
@@ -669,9 +713,25 @@ end
 
 -- GM 发送邮件
 function CommerveManager_SendMail()
+    CommonDB.SetCommerceActInfo_SendServerMail(false)
     CommerceAct_End()
 end
 
 function CommerceMiddle_AddTaskPoint(human, nNum)
     ServerCommerceTask.CommerceTask_AddPoint(human, nNum)
-end
+end
+
+function CommerveManager_GMRest(human)
+    CommerceAct_End()
+    print("[CommerveManager_GMRest] 发送邮件处理完成")
+    
+    CommonDB.SetCommerceActInfo({})
+    print("[CommerveManager_GMRest] 处理公共DB数据结束")
+
+    CommerceAct_ClearRankInfo()
+    print("[CommerveManager_GMRest] 发送清理排行榜命令完成")
+
+
+    CommerceAct_GetActOpen(ServerCommerceActDefine.COMMERCEACT_SERVEROPEN)
+    print("[CommerveManager_GMRest] 重新请求数据")
+end 

+ 11 - 5
script/module/serverCommerce/ServerCommerceMiddle.lua

@@ -118,7 +118,7 @@ function CommerveMiddle_HumanPointChange(human, nPoint)
     tMsgData.nRankType = CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE
     tMsgData.nRankSubType = CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_HUMAN
     tMsgData.nOperate = CommonDefine.COMMONRANK_VALUE_REPLACE
-    tMsgData.servername = "寻宝"..Config.NEW_SVR_INDEX..""
+    tMsgData.servername = "寻宝"..Config.NEW_SVR_INDEX..""
 
     InnerMsg.sendMsg(0, tMsgData)
     print("[CommerveMiddle_HumanPointChange] 发送玩家排行榜信息结束 name = "..tMsgData.name.." nValue = "..tMsgData.nValue)
@@ -128,7 +128,7 @@ end
 function CommerveMiddle_ServerPointChange(nPoint)
     local tMsgData = InnerMsg.lw.LW_COMMERCE_RANK_POINT_CHANGE
     tMsgData.uuid = Config.NEW_SVR_INDEX
-    tMsgData.name = "寻宝"..Config.NEW_SVR_INDEX..""
+    tMsgData.name = "寻宝"..Config.NEW_SVR_INDEX..""
     tMsgData.head = -1
     tMsgData.headFrame = -1
     tMsgData.nSrcServerID = Config.SVR_INDEX
@@ -136,7 +136,7 @@ function CommerveMiddle_ServerPointChange(nPoint)
     tMsgData.nRankType = CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE
     tMsgData.nRankSubType = CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_SERVER
     tMsgData.nOperate = CommonDefine.COMMONRANK_VALUE_REPLACE
-    tMsgData.servername = "寻宝"..Config.NEW_SVR_INDEX..""
+    tMsgData.servername = "寻宝"..Config.NEW_SVR_INDEX..""
 
     InnerMsg.sendMsg(0, tMsgData)
 
@@ -174,13 +174,13 @@ end
 function CommerceMiddle_QueryServerRank(nOperate)
     local tMsgData = InnerMsg.lw.LW_COMMERCE_QUERY_SERVER_RANK
     tMsgData.nSrcServerID = Config.SVR_INDEX
-    tMsgData.nServerUuid = Config.NEW_SVR_INDEX
+    tMsgData.nServerUuid = tostring(Config.NEW_SVR_INDEX)
     tMsgData.nOperate = nOperate
     InnerMsg.sendMsg(0, tMsgData)
 end
 
 -- 获取到 当前服务器排行最新的排名
-function CommerceMiddle_GetServerRank(fd, msg)
+function CommerceMiddle_GetServerRank(msg)
     ServerCommerceRank.CommercerActRank_GetServerRank(msg)
 end
 
@@ -189,6 +189,7 @@ function CommerceMiddle_TellServerMailOk()
     local tMsgData = InnerMsg.lw.LW_COMMERCE_TELL_SERVER_MAILOK
     tMsgData.nSrcServerID = Config.SVR_INDEX
     InnerMsg.sendMsg(0, tMsgData)
+    print("[CommerceMiddle_TellServerMailOk] 通知中心服当前服务器在线全服玩家邮件结束")
 end
 
 function CommerceMiddle_GetHumanRank(msg)
@@ -197,6 +198,11 @@ end
 
 function CommerceMiddle_ClearRank()
     local tMsgData = InnerMsg.lw.LW_COMMERCE_CLEAR_RANK
+    tMsgData.nRankType = CommonDefine.COMMONRANK_TYPE_SERVERCOMMERCE
+    tMsgData.nRankSubType = CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_SERVER
     tMsgData.nSrcServerID = Config.SVR_INDEX
     InnerMsg.sendMsg(0, tMsgData)
+
+    tMsgData.nRankSubType = CommonDefine.COMMONRANK_SUB_TYPE_SERVERCOMMERCE_HUMAN
+    InnerMsg.sendMsg(0, tMsgData)
 end

+ 2 - 0
script/module/union/UnionTecLogic.lua

@@ -425,7 +425,9 @@ function techLvUp(human,occu,tier)
     RoleAttr.doCalc(human)
     ObjHuman.sendAttr(human, RoleDefine.ZHANDOULI)
 
+    print("[techLvUp] 111111\n")
     TriggerLogic.PublishEvent(TriggerDefine.EVENT_TYPE_UNIONSKILLUP, human.db._id, 1)
+    print("[techLvUp] 222222\n")
 end
 
 function checkisFirstRest(human)

+ 1 - 0
script/module/yunying/YunYingLogic.lua

@@ -841,6 +841,7 @@ function onHour(hour)
         return
     end
 
+    print("[YunYingLogic-onHour] 开启处理整点 hour = "..hour)
     for yyID, YYInfo in pairs(ID2YYInfo) do
         for i = 1, #YYInfo.config.funcs do
             local funcID = YYInfo.config.funcs[i]