Просмотр исходного кода

1.增加不计入累充购买项判断 2.统一购买项数据结构填充方式 3.新增代金券特惠礼包 4.新增每日礼包

gitxsm 2 недель назад
Родитель
Сommit
84f5b94283

+ 5 - 0
script/common/ProtoID.lua

@@ -1871,4 +1871,9 @@ _ENV[1922]="GC_BZCS_WAR_REPORT"
 _ENV[1923]="CG_BZCS_RANK_REWARD"
 _ENV[1924]="GC_BZCS_RANK_REWARD"
 _ENV[1925]="CG_BZCS_MATCH_REFRESH"
+_ENV[1926]="CG_VOUCHER_SPECIAL_OFFER_QUERY"
+_ENV[1927]="GC_VOUCHER_SPECIAL_OFFER_QUERY"
+_ENV[1928]="CG_ROLE_DAILY_GIFT_QUERY"
+_ENV[1929]="GC_ROLE_DAILY_GIFT_QUERY"
+_ENV[1930]="CG_ROLE_DAILY_GIFT_GET"
 

+ 2 - 0
script/core/ObjHuman.lua

@@ -108,6 +108,7 @@ local BreakThroughTheme = require("battle.BreakThroughTheme")
 local BattleGift = require("battle.BattleGift")
 local BigRPlayerShow = require("broadcast.BigRPlayerShow")
 local BaiZhanChengShenNS = require("baiZhanChengShen.BaiZhanChengShenNS")
+local RoleDailyGift = require("roleSystem.RoleDailyGift")
 
 
 local Json = require("common.Json")
@@ -933,6 +934,7 @@ function updateDaily(human, isGm)
 
 
 	QQBigShot.updateDaily(human)
+	RoleDailyGift.updateDaily(human)
 
 	TriggerLogic.PublishEvent(TriggerDefine.EVENT_TYPE_DAILY_LOGIN, human.db._id, 1)
 	

+ 2 - 1
script/excel/ssecy/yunying.lua

@@ -23,7 +23,7 @@
 [24]={name="周末冲刺",icon=51,sortID=26,panelID=9100,pos=1,funcs={9101},serverIndex={{1,999999}}},
 [25]={name="在线豪礼",icon=52,sortID=27,panelID=18001,pos=1,funcs={18001},serverIndex={{1,999999}}},
 [26]={name="新首充",icon=53,sortID=29,panelID=19001,pos=1,funcs={19001},serverIndex={{1,999999}}},
-[27]={name="代金券",icon=52,sortID=27,panelID=8200,pos=1,funcs={8201,8202},serverIndex={{1,999999}}},
+[27]={name="代金券",icon=52,sortID=27,panelID=8200,pos=1,funcs={8201,8202,8204},serverIndex={{1,999999}}},
 [28]={name="周循环活动",icon=54,sortID=30,panelID=7060,pos=1,funcs={751,752,753,754},serverIndex={{1,999999}}},
 [29]={name="跨服商业活动一",icon=55,sortID=31,panelID=7070,pos=1,funcs={7071,7072,7073,7074},serverIndex={{1,999999}}},
 [30]={name="新日常",icon=56,sortID=56,panelID=20001,pos=1,funcs={201,202,203,204,205,10001,11001},serverIndex={{1,999999}}},
@@ -73,6 +73,7 @@
 [7103]={actName="",icon=7103,effect=0,openLv=1,panelID=7103,moduleFn="present.MergeServerLogin",param=0},
 [8201]={actName="",icon=8201,effect=0,openLv=1,panelID=8201,moduleFn="voucher.VoucherShopLogic",param=0},
 [8202]={actName="",icon=8202,effect=0,openLv=1,panelID=8202,moduleFn="voucher.VoucherShopLogic",param=0},
+[8204]={actName="特惠",icon=8204,effect=0,openLv=1,panelID=8204,moduleFn="voucher.VoucherSpecialOffer",param=0},
 [9001]={actName="",icon=9001,effect=0,openLv=5,panelID=8001,moduleFn="absAct.NewHeroLogic",param=405013},
 [9101]={actName="",icon=9101,effect=0,openLv=1,panelID=9100,moduleFn="WeekendLoopActivity.WeekendLoopActManager",param=0},
 [17001]={actName="",icon=17001,effect=0,openLv=5,panelID=3609,moduleFn="present.OpenServerActPowerUp",param=0},

+ 25 - 23
script/module/absAct/NewHeroLogic.lua

@@ -164,29 +164,31 @@ function getAndSendMsg(human, id, actId)
 
         local buyID = v.buyID
         msgRet.giftlist[index].buyMsg[0] = 1
-        if v.buyID == 0 then
-            msgRet.giftlist[index].buyMsg[1] = {
-                buyID = buyID,
-                region = "zuanshi",
-                cost = v.price,
-                icon = 0,
-                name = "",
-                isFirst = 0,
-                desc = "",
-                doubleCnt = 0,
-                actDoubleCnt = 0,
-                useDoubleCnt = 0,
-                buyCnt = 0,
-                vipExp = 0,
-                yuanjia = 0,
-                zhekou = 0,
-                voucher = 0,
-                productId = "",
-                nCanBuyNum = 0,
-            }
-        else
-            BuyLogic.fontBuyItem(human, msgRet.giftlist[index].buyMsg[1], buyID)
-        end
+        -- if v.buyID == 0 then
+        --     msgRet.giftlist[index].buyMsg[1] = {
+        --         buyID = buyID,
+        --         region = "zuanshi",
+        --         cost = v.price,
+        --         icon = 0,
+        --         name = "",
+        --         isFirst = 0,
+        --         desc = "",
+        --         doubleCnt = 0,
+        --         actDoubleCnt = 0,
+        --         useDoubleCnt = 0,
+        --         buyCnt = 0,
+        --         vipExp = 0,
+        --         yuanjia = 0,
+        --         zhekou = 0,
+        --         voucher = 0,
+        --         productId = "",
+        --         nCanBuyNum = 0,
+        --     }
+        -- else
+        --     BuyLogic.fontBuyItem(human, msgRet.giftlist[index].buyMsg[1], buyID)
+        -- end
+
+        BuyLogic.fontBuyItem(human, msgRet.giftlist[index].buyMsg[1], buyID)
     end
     msgRet.giftlist[0] = index
     if index == 0 then

+ 9 - 0
script/module/roleSystem/Handler.lua

@@ -2,6 +2,7 @@ local RoleSystemLogic = require("roleSystem.RoleSystemLogic")
 local RoleRealmLogic = require("roleSystem.RoleRealmLogic")
 local RoleStorageBox = require("roleSystem.RoleStorageBox")
 local RoleOpenPrize = require("roleSystem.RoleOpenPrize")
+local RoleDailyGift = require("roleSystem.RoleDailyGift")
 
 function CG_ROLESYSTEM_QUERY(human, msg)
 	
@@ -36,3 +37,11 @@ end
 function CG_ROLESTORAGEBOX_QUERY(human, msg)
    RoleStorageBox.Query(human)
 end
+
+function CG_ROLE_DAILY_GIFT_QUERY(human, msg)
+   RoleDailyGift.Query(human)
+end
+
+function CG_ROLE_DAILY_GIFT_GET(human, msg)
+   RoleDailyGift.Get(human)
+end

+ 10 - 0
script/module/roleSystem/Proto.lua

@@ -86,4 +86,14 @@ GC_ROLESTORAGEBOX_QUERY = {
 	{"itemList", 			 15,  ItemData},	-- 剩余道具数据数量
 }
 
+-----------------------每日好礼(小7渠道)------------------------------
+CG_ROLE_DAILY_GIFT_QUERY = {}
+
+GC_ROLE_DAILY_GIFT_QUERY = {
+	{"status",	1,	"byte"},	-- 0不可领取 1可领取 2已领取
+	{"item",	1,	ItemData},
+}
+
+CG_ROLE_DAILY_GIFT_GET = {}
+
 -------------------------------------------------------------

+ 1 - 0
script/module/roleSystem/RoleSystemDefine.lua

@@ -11,6 +11,7 @@ ROLE_SYS_ID_109 =  109  -- QQ大咖
 ROLE_SYS_ID_110 =  110  -- 系统开启奖励
 ROLE_SYS_ID_111 =  111  -- 无限高抽
 ROLE_SYS_ID_112 =  112  -- 闯关主题
+ROLE_SYS_ID_113 =  113  -- 每日好礼(小7渠道)
 
 ROLE_SYS_ID_201 =  201  -- 主界面中-聊天
 ROLE_SYS_ID_202 =  202  -- 主界面中-战报

+ 25 - 18
script/module/topup/BuyLogic.lua

@@ -50,7 +50,10 @@ local OpenServerGiftPackage = require("present.OpenServerGiftPackage")
 local CommonDefine = require("common.CommonDefine")
 local ZhuanpanGift = require("zhuanpan.ZhuanpanGift")
 local VoucherInvest = require("voucher.VoucherInvest")
+local VoucherSpecialOffer = require("voucher.VoucherSpecialOffer")
+local VoucherSpecialOffer = require("voucher.VoucherSpecialOffer")
 local CommonActLoginGift = require("absAct.CommonActLoginGift")
+local ExcludedAccRechargeIdCfg = require("excel.buy").excludedAccRechargeIds
 
 BUY_CODE_NORMAL = 0   -- 正常调平台的充值接口
 BUY_CODE_WX_KEFU = 1  -- 微信小程序客服充值接口
@@ -75,6 +78,20 @@ local function SetFirstMark(human, nValue)
 	human.db.nFirstBuy = nValue
 end
 
+-- 检查该购买项是否不计入累充,true-不计入, false-计入
+local function isExcludedAccRechargeId(buyId)
+	if not ExcludedAccRechargeIdCfg or not ExcludedAccRechargeIdCfg[1] or not ExcludedAccRechargeIdCfg[1].excludedAccRechargeIds then
+		return false
+	end
+
+	local excludedAccRechargeIds = ExcludedAccRechargeIdCfg[1].excludedAccRechargeIds
+	if table.find(excludedAccRechargeIds, buyId) then
+		return true
+	end
+
+	return false
+end
+
 -- 是否充值过
 function isChange(human)
     if not human.db.topupAcount or human.db.topupAcount <= 0 then
@@ -165,6 +182,7 @@ end
 -- 封装BuyItem结构体
 function fontBuyItem(human, net, buyID)
 	net.nCanBuyNum = 0
+	net.disableVoucher = 1
 	if buyID == 0 then
 		net.buyID = buyID
 		net.region = "zuanshi"
@@ -213,6 +231,7 @@ function fontBuyItem(human, net, buyID)
 		net.voucher = conf.Voucher
 		-- net.productId = conf.productid
 		net.productId = getRealProductId(human, buyID, region)
+		net.disableVoucher = conf.disableVoucher or 1
 		if conf.module and conf.module ~= "" then
 			local tModule = load("return require(\"" .. conf.module .. "\")")()
 			if tModule and tModule.GetRemainNum then
@@ -378,6 +397,11 @@ function cmd.VoucherInvest(human, buyConf, isFirst, buyCnt, buyNum)
 	VoucherInvest.onCharge(human, nBuyID, buyNum)
 end
 
+function cmd.voucherSpecialOffer(human, buyConf, isFirst, buyCnt, buyNum)
+	local nBuyID = buyConf.id
+	VoucherSpecialOffer.onCharge(human, nBuyID, buyNum)
+end
+
 function cmd.CommonActLoginGift(human, buyConf, isFirst, buyCnt, buyNum)
 	local nBuyID = buyConf.id
 	CommonActLoginGift.onCharge(human, nBuyID, buyNum)
@@ -480,28 +504,11 @@ function buy(human, arg, nolog)
 end
 
 
--- 临时处理,不加入累充的购买项
-local notAddTopupList = {
-	[90501] = true,
-	[90502] = true,
-	[90503] = true,
-	[90504] = true,
-	[90511] = true,
-	[90512] = true,
-	[90513] = true,
-	[90514] = true,
-	[90515] = true,
-	[90516] = true,
-	[90517] = true,
-	[90518] = true,
-}
-
-
 function afterCharge(human,oJsonInput, buyID, buyConf, buyNum)
 	--local price = oJsonInput.topupMoney
 	local buyConf = BuyExcel[buyID]
 	local price = oJsonInput.price or buyConf.CN
-	if price and price > 0 and buyConf.cmd ~= "voucherbuy" and not notAddTopupList[buyID] then
+	if price and price > 0 and buyConf.cmd ~= "voucherbuy" and not isExcludedAccRechargeId(buyID) then
 		TopupLogic.clacTopupAcount(human, price, buyID, buyNum)
 		
 		local msgRet = Msg.gc.GC_NOTICE_DADIAN

+ 9 - 1
script/module/voucher/Handler.lua

@@ -6,8 +6,8 @@
 --------------------------------
 
 local voucherShopLogic = require("voucher.VoucherShopLogic")
-
 local VoucherInvest = require("voucher.VoucherInvest")
+local VoucherSpecialOffer = require("voucher.VoucherSpecialOffer")
 
 -- 请求代金券商店信息
 function CG_VOUCHER_QUERY_SHOP(human, msg)
@@ -34,4 +34,12 @@ end
 
 function CG_VOUCHER_INVEST_GET(human, msg)
     VoucherInvest.VoucherInvest_Get(human)
+end
+
+function CG_VOUCHER_SPECIAL_OFFER_QUERY(human, msg)
+    VoucherSpecialOffer.VoucherSpecialOffer_Query(human)
+end
+
+function CG_VOUCHER_SPECIAL_OFFER_QUERY(human, msg)
+    VoucherSpecialOffer.VoucherSpecialOffer_Query(human)
 end

+ 31 - 1
script/module/voucher/Proto.lua

@@ -68,4 +68,34 @@ GC_VOUCHER_INVEST_QUERY = {
 }
 
 -- 领取奖励
-CG_VOUCHER_INVEST_GET = {}
+CG_VOUCHER_INVEST_GET = {}
+
+---------------------------------------代金券特惠---------------------------
+
+VOUCHER_SPECIAL_OFFER_INFO = {
+    {"buyItem",     1,      BuyItem},       -- 直购信息
+    {"nowBuyCnt",   1,      "short"},       -- 当前已购买次数
+    {"maxBuyCnt",   1,      "short"},       -- 最大可购买次数
+    {"giftItem",    4,      ItemData},     -- 礼包道具
+}
+
+CG_VOUCHER_SPECIAL_OFFER_QUERY = {}
+
+GC_VOUCHER_SPECIAL_OFFER_QUERY = {
+    {"giftArr",     2,      VOUCHER_SPECIAL_OFFER_INFO},   -- 代金券特惠礼包
+}
+
+---------------------------------------代金券特惠---------------------------
+
+VOUCHER_SPECIAL_OFFER_INFO = {
+    {"buyItem",     1,      BuyItem},       -- 直购信息
+    {"nowBuyCnt",   1,      "short"},       -- 当前已购买次数
+    {"maxBuyCnt",   1,      "short"},       -- 最大可购买次数
+    {"giftItem",    4,      ItemData},     -- 礼包道具
+}
+
+CG_VOUCHER_SPECIAL_OFFER_QUERY = {}
+
+GC_VOUCHER_SPECIAL_OFFER_QUERY = {
+    {"giftArr",     2,      VOUCHER_SPECIAL_OFFER_INFO},   -- 特惠礼包
+}