Explorar o código

修复工会奖励红点、代金券修改倍率、开服排行榜增加日志

SCFC hai 1 ano
pai
achega
c80436a0c1

+ 14 - 0
script/module/present/OpenServerRank.lua

@@ -6,6 +6,8 @@ local Broadcast = require("broadcast.Broadcast")
 local OpenAct = require("present.OpenAct")
 local YunYingLogic = require("yunying.YunYingLogic")
 local DrawCardLogic = require("drawCard.DrawCardLogic")
+local Log = require("common.Log")
+
 --[[
 	开服排名活动 充值排名、招募排名
     local:
@@ -24,6 +26,14 @@ local DrawCardLogic = require("drawCard.DrawCardLogic")
 		onZeroAll()             -- 零点处理回调
 --]]
 
+local function OpenServerRank_WriteLog(human, sztext)
+    if human then
+        sztext = sztext.." _id = "..human.db._id.." name = "..human.db.name
+    end
+    
+    Log.write(Log.LOGID_OSS_COMMON, sztext)
+end
+
 local function getOpenActParam(rankType)
     if rankType == OpenServerRankDB.RANK_TYPE_DAY_TOPUP or 
        rankType == OpenServerRankDB.RANK_TYPE_TOTAL_TOPUP  then return OpenAct.OPEN_ACT_TOPUP_RANK end
@@ -115,6 +125,7 @@ function onCharge(human, price, funcID, buyID)
     if funcConfig.param == OpenAct.OPEN_ACT_TOPUP_RANK then
         OpenServerRankDB.onValueAdd(human, OpenServerRankDB.RANK_TYPE_DAY_TOPUP, price)
         OpenServerRankDB.onValueAdd(human, OpenServerRankDB.RANK_TYPE_TOTAL_TOPUP, price)
+        OpenServerRank_WriteLog(human, "[OpenServerRankDB_onCharge] 玩家充值进行上榜操作 price = "..price.."buyID = "..buyID)
     end
 end
 
@@ -130,6 +141,7 @@ function onDrawCard(human, funcID, value, drawType)
             drawType == DrawCardLogic.DRAWCARD_ID6 then
            OpenServerRankDB.onValueAdd(human, OpenServerRankDB.RANK_TYPE_DAY_DRAW_CARD, value)
            OpenServerRankDB.onValueAdd(human, OpenServerRankDB.RANK_TYPE_TOTAL_DRAW_CARD, value)
+            OpenServerRank_WriteLog(human, "[OpenServerRankDB_onDrawCard] 玩家抽卡进行上榜操作 value = "..value.."drawType = "..drawType)
         end
     end
 end
@@ -143,9 +155,11 @@ function onHuangjingTower(human,funcID, parameter)
     if funcConfig.param == OpenAct.OPEN_ACT_TOWER_RANK then
         local towerLv = human.db.tower and human.db.tower.lv or 0
         OpenServerRankDB.onValueSet(human, OpenServerRankDB.RANK_TYPE_TOTAL_TOWER, towerLv)
+        OpenServerRank_WriteLog(human, "[OpenServerRankDB_onHuangjingTower] 玩家进行上榜操作 towerLv = "..towerLv)
     end 
 end
 
 function onZeroAll(funcID)
+    OpenServerRank_WriteLog(nil, "[OpenServerRank_onZeroAll] 整点进行发奖励操作 funcID = "..funcID)
     OpenServerRankDB.onRewardSend(funcID)
 end

+ 16 - 3
script/module/present/OpenServerRankDB.lua

@@ -104,6 +104,10 @@ QueryForData = {rankType = 1, uuid = 1} -- 通过排名类型和玩家uuid查找
 QueryByUuid = {_id = 1}                 -- 通过DB的uuid更新DB数据
 QueryByRankType = {rankType = 1}        -- 通过排名类型查找DB数据
 
+local function OpenServerRankDB_WriteLog(sztext)
+    Log.write(Log.LOGID_OSS_COMMON, sztext)
+end
+
 local function getOpenActConfig(rankType)
     if rankType == RANK_TYPE_DAY_TOPUP or rankType == RANK_TYPE_TOTAL_TOPUP then 
         return OpenActExcel.topupRank
@@ -588,6 +592,8 @@ function onValueSet(human, rankType, tValue)
 	dbData.time = os.time()
 	dbData.rankType = rankType
 	dbData.uuid = human.db._id
+    local szText = "[OpenServerRankDB_onValueSet] 设置玩家排行榜数据 uuid = "..dbData.uuid.." name = "..human.db.name.." rankType ="..rankType.." Value = "..tValue
+    OpenServerRankDB_WriteLog(szText)
 	billboardSet(dbData)
 end
 
@@ -628,16 +634,23 @@ function boardReward(mailID, rankType)
 	    local senderName = mailConfig.senderName
 	    local content = mailConfig.content	    
         local mailSends = MAIL_SEND_CACHE[rankType] 
-
+        
         for rank,uuid in pairs(mailSends) do
             local rankInfo = getRankInfo(rankType, rank)
+            local szText = "[OpenServerRankDB_boardReward] rankType = "..rankType.." rank = "..rank.." uuid = "..uuid
             if rankInfo then
                 local rewardInfo = getRewardInfoByInfo(rankType, rankInfo)
 			    if rewardInfo then	
 		            MailManager.add(MailManager.SYSTEM, uuid, 
-						        title, Util.format(content, rank), rewardInfo, senderName)           
-                end        
+						        title, Util.format(content, rank), rewardInfo, senderName)
+                    szText = szText.." 正常发送奖励"        
+                else
+                    szText = szText.." 获取不到玩家对应位置奖励配置数据!"
+                end
+            else
+                szText = szText.." 获取不到玩家的相关排行榜数据!!"
             end
+            OpenServerRankDB_WriteLog(szText)
         end
 
         MAIL_SEND_CACHE[rankType] = nil

+ 5 - 2
script/module/union/UnionDonateLogic.lua

@@ -214,6 +214,7 @@ function getDonateReward(human,id)
     -- 发放物品
     BagLogic.addItemList(human, config.reward, "union_donate")
     unionDonateQuery(human)
+    RoleSystemLogic.onDot(human, RoleSystemDefine.ROLE_SYS_ID_1003)
 end
 
 function updateDaily(human)
@@ -267,6 +268,7 @@ end
 function isDot(human)
     -- 有可捐赠次数
     if human.db.unionDonate == nil then
+        print("[isDot] 公会可捐赠直接返回")
         return true
     end
 
@@ -280,11 +282,12 @@ function isDot(human)
     for i = 1,len do
         local v = UnionExcel.donateReward[i]
         if human.db.donateReward == nil or human.db.donateReward[i] == nil then
-        if union.donate ~= nil and union.donate[1] >= v.needExp then
+            if union.donate ~= nil and union.donate[1] >= v.needExp then
+                print("[isDot] 公会可捐赠直接返回 i = "..i.." union.donate[1] = "..union.donate[1].." needExp = "..v.needExp)
                 return true
             end
         end
     end
 
-    return 
+    return false
 end

+ 8 - 3
script/module/voucher/VoucherShopDefine.lua

@@ -8,10 +8,15 @@
 -- 膨胀概率
 INFLATIONPROBABILITY = 
 {
-    [2]     =   89.99,
-    [5]     =   99.99,  -- 10.0,
-    [10]    =   100,    -- 0.01,
+    [90] = 1.2,
+    [99] = 1.5,
+    [100] = 3,
 }
+-- {
+--     [1.2]     =   90.00,
+--     [1.5]     =   99.00,  -- 9,
+--     [3]       =   100,    -- 1,
+-- }
 
 VOUCHERITME_ID = 31             -- 代金券物品ID
 

+ 2 - 2
script/module/voucher/VoucherShopLogic.lua

@@ -149,8 +149,8 @@ local function VoucherShop_GetAddNum(tConfig)
     if VoucherShopDefine.VOUCHERTYPE_INFLATION == tConfig.tData.nType then
         local nRandNum = math.random(1, 100)
         for nID, v in pairs(VoucherShopDefine.INFLATIONPROBABILITY) do
-            if nRandNum <= v then
-                nMultiple = nID
+            if nRandNum <= nID then
+                nMultiple = v
                 break
             end
         end