Commit 2ffd37cc1c42c330a1d2608a840b758ff3bdacd1

Authored by 熊润斐
2 parents d4ef50f0 580f0906

Merge branch 'tr/bugfix-qa' into tr/bugfix

@@ -80,6 +80,7 @@ ItemType = { @@ -80,6 +80,7 @@ ItemType = {
80 SpeedBox = 16, -- 加速箱子 80 SpeedBox = 16, -- 加速箱子
81 SelectItemBox = 17, -- 自选箱子 81 SelectItemBox = 17, -- 自选箱子
82 CommonPaster = 18, -- 万能贴纸 82 CommonPaster = 18, -- 万能贴纸
  83 + BossTicket = 20, -- boss挑战门票
83 } 84 }
84 85
85 --在这个里面的会记录的是功能开放 对应类型open 而不是 ID 86 --在这个里面的会记录的是功能开放 对应类型open 而不是 ID
@@ -310,6 +311,8 @@ CardType = { @@ -310,6 +311,8 @@ CardType = {
310 PaySignCard = 6, -- 付费签到卡 311 PaySignCard = 6, -- 付费签到卡
311 BattlePassCard = 7, -- 探索指令 312 BattlePassCard = 7, -- 探索指令
312 ActBattleCommandCard = 8, -- 战令活动卡 313 ActBattleCommandCard = 8, -- 战令活动卡
  314 + NormalMonthCardLevelUp = 9, -- 月卡升级
  315 + SuperMonthCardLevelUp = 10, -- 超级月卡升级
313 } 316 }
314 317
315 ShopPackType = { 318 ShopPackType = {
1 -Subproject commit 9ab88a62f1c2ff1121be7547f02668db43dc1f75 1 +Subproject commit 686b192263f5cc221e472e1b9a41d059d581da2d
src/models/Activity.lua
@@ -1039,6 +1039,14 @@ activityFunc[Activity.ActivityType.BattleCommand] = { @@ -1039,6 +1039,14 @@ activityFunc[Activity.ActivityType.BattleCommand] = {
1039 ["init"] = function (self, actType, isCrossDay, notify, actId) 1039 ["init"] = function (self, actType, isCrossDay, notify, actId)
1040 local data = {unlock = 0, freeR = "", payR = "", lvl = 0, sum = 0, week = 0} 1040 local data = {unlock = 0, freeR = "", payR = "", lvl = 0, sum = 0, week = 0}
1041 self:updateActData(actType, data, not notify) 1041 self:updateActData(actType, data, not notify)
  1042 +
  1043 + local rechargeRecord = self.owner.storeData:getProperty("payR")
  1044 + for id, cfg in pairs(csvdb["shop_rechargeCsv"]) do
  1045 + if cfg.shop == 2 and cfg.type == CardType.ActBattleCommandCard then
  1046 + rechargeRecord[id] = nil
  1047 + end
  1048 + end
  1049 + self.owner.storeData:updateProperty({field="payR", value=rechargeRecord})
1042 end, 1050 end,
1043 ["check"] = function(self, actType, notify, id, count) -- 检查 itemid, count 1051 ["check"] = function(self, actType, notify, id, count) -- 检查 itemid, count
1044 local isOpen, actId = self:isOpen(actType) 1052 local isOpen, actId = self:isOpen(actType)
@@ -1082,6 +1090,15 @@ activityFunc[Activity.ActivityType.BattleCommand] = { @@ -1082,6 +1090,15 @@ activityFunc[Activity.ActivityType.BattleCommand] = {
1082 actData["week"] = 0 1090 actData["week"] = 0
1083 self:updateActData(actType, actData, true) 1091 self:updateActData(actType, actData, true)
1084 end, 1092 end,
  1093 + ["close"] = function (self, actType, notify, actId)
  1094 + local rechargeRecord = self.owner.storeData:getProperty("payR")
  1095 + for id, cfg in pairs(csvdb["shop_rechargeCsv"]) do
  1096 + if cfg.shop == 2 and cfg.type == CardType.ActBattleCommandCard then
  1097 + rechargeRecord[id] = nil
  1098 + end
  1099 + end
  1100 + self.owner.storeData:updateProperty({field="payR", value=rechargeRecord})
  1101 + end,
1085 } 1102 }
1086 1103
1087 1104
src/models/RolePlugin.lua
@@ -134,6 +134,12 @@ function RolePlugin.bind(Role) @@ -134,6 +134,12 @@ function RolePlugin.bind(Role)
134 [ItemType.Potion] = function () 134 [ItemType.Potion] = function ()
135 self:addPotion({id = itemId, count = count, notNotify = pms.notNotify, log = pms.log}) 135 self:addPotion({id = itemId, count = count, notNotify = pms.notNotify, log = pms.log})
136 end, 136 end,
  137 + [ItemType.BossTicket] = function ()
  138 + if not self.activity:isOpen("ChallengeLevel") then return end
  139 + local actData = self.activity:getActData("ChallengeLevel")
  140 + actData["ticket"] = (actData["ticket"] or 0) + count
  141 + self.activity:updateActData("ChallengeLevel", actData)
  142 + end,
137 } 143 }
138 144
139 if count > 0 then 145 if count > 0 then
src/models/Store.lua
@@ -17,7 +17,9 @@ Store.schema = { @@ -17,7 +17,9 @@ Store.schema = {
17 growFundR = {"string", ""}, -- 成长基金领取记录 17 growFundR = {"string", ""}, -- 成长基金领取记录
18 18
19 monthCardEx = {"number", 0}, -- 月卡过期时间戳 19 monthCardEx = {"number", 0}, -- 月卡过期时间戳
  20 + monthCardId = {"number", 0}, -- 月卡id
20 smonthCardEx = {"number", 0}, -- 超级月卡过期时间戳 21 smonthCardEx = {"number", 0}, -- 超级月卡过期时间戳
  22 + smonthCardId = {"number", 0}, -- 超级月卡id
21 23
22 battleCard = {"number", 0}, -- 赛季卡 24 battleCard = {"number", 0}, -- 赛季卡
23 battleFR = {"string", ""}, -- 免费赛季卡领取记录 25 battleFR = {"string", ""}, -- 免费赛季卡领取记录
@@ -51,7 +53,7 @@ function Store:updateProperty(params) @@ -51,7 +53,7 @@ function Store:updateProperty(params)
51 return 53 return
52 end 54 end
53 local newValue = self:getProperty(params.field) 55 local newValue = self:getProperty(params.field)
54 - if not params.notNotify then 56 + if not params.notNotify then
55 self:notifyUpdateProperty(params.field, newValue, oldValue) 57 self:notifyUpdateProperty(params.field, newValue, oldValue)
56 end 58 end
57 end 59 end
@@ -77,13 +79,16 @@ end @@ -77,13 +79,16 @@ end
77 -- 发送月卡邮件 79 -- 发送月卡邮件
78 function Store:sendMonthCardEmail() 80 function Store:sendMonthCardEmail()
79 local timeNow = skynet.timex() 81 local timeNow = skynet.timex()
80 - local tabs = {{ex="monthCardEx", t="getMailT1", mail=MailId.MonthCard, alert=MailId.MonthCardEx},  
81 - {ex="smonthCardEx", t="getMailT2", mail=MailId.SuperMonthCard, alert=MailId.SuperMonthCardEx}} 82 +
  83 + local tabs = {{ex="monthCardEx", t="getMailT1", id= self:getProperty("monthCardId")},
  84 + {ex="smonthCardEx", t="getMailT2", id=self:getProperty("smonthCardId")}}
82 for _, v in ipairs(tabs) do 85 for _, v in ipairs(tabs) do
83 local ex = self:getProperty(v.ex) 86 local ex = self:getProperty(v.ex)
84 local ts = self:getProperty(v.t) or 0 87 local ts = self:getProperty(v.t) or 0
85 - local mailId = v.mail  
86 - local alertId = v.alert 88 + local cfg = csvdb["shop_cardCsv"][v.id] or {}
  89 +
  90 + local mailId = cfg.email
  91 + local alertId = cfg.email_2
87 local alertTs = dayLater(ex) - DAY_SEC 92 local alertTs = dayLater(ex) - DAY_SEC
88 if ex > timeNow then 93 if ex > timeNow then
89 local cnt = 0 94 local cnt = 0
@@ -184,24 +189,66 @@ function Store:getHangDropCoef() @@ -184,24 +189,66 @@ function Store:getHangDropCoef()
184 return (1 + globalCsv.hang_drop_exp_coef) or 1, (1 + globalCsv.hang_drop_item_coef) or 1 189 return (1 + globalCsv.hang_drop_exp_coef) or 1, (1 + globalCsv.hang_drop_item_coef) or 1
185 end 190 end
186 191
  192 +function Store:getCurMonthCardLvl(isSuper)
  193 + local id = 0
  194 + if isSuper then
  195 + id = self:getProperty("smonthCardId") or 0
  196 + else
  197 + id = self:getProperty("monthCardId") or 0
  198 + end
  199 + local cfg = csvdb["shop_cardCsv"][id]
  200 + if not cfg then return 0 end
  201 +
  202 + return cfg.level or 0
  203 +end
187 204
188 -- 购买通行证 205 -- 购买通行证
189 function Store:onBuyCard(type, duration, id, actid) 206 function Store:onBuyCard(type, duration, id, actid)
190 local timeNow = skynet.timex() 207 local timeNow = skynet.timex()
191 if type == CardType.NormalMonthCard then 208 if type == CardType.NormalMonthCard then
192 if self:isMonthCardExpire() then 209 if self:isMonthCardExpire() then
  210 + self:updateProperty({field = "monthCardId", value = id})
193 self:updateProperty({field = "monthCardEx", value = timeNow + duration}) 211 self:updateProperty({field = "monthCardEx", value = timeNow + duration})
194 else 212 else
195 self:updateProperty({field = "monthCardEx", value = self:getProperty("monthCardEx") + duration}) 213 self:updateProperty({field = "monthCardEx", value = self:getProperty("monthCardEx") + duration})
196 end 214 end
197 self:sendMonthCardEmail() 215 self:sendMonthCardEmail()
  216 + elseif type == CardType.NormalMonthCardLevelUp then
  217 + if self:isMonthCardExpire() then
  218 + skynet.error(string.format("month card expired, can not level up,%d,%d",self.owner:getProperty("id"), id))
  219 + else
  220 + local cfg = csvdb["shop_cardCsv"][id]
  221 + if not cfg then return end
  222 + local dif = cfg.level - self:getCurMonthCardLvl(false)
  223 + if dif > 1 and dif < 0 then
  224 + return
  225 + end
  226 + self:updateProperty({field = "monthCardId", value = id})
  227 + self:updateProperty({field = "monthCardEx", value = self:getProperty("monthCardEx") + duration})
  228 + end
  229 + self:sendMonthCardEmail()
198 elseif type == CardType.SuperMonthCard then 230 elseif type == CardType.SuperMonthCard then
199 if self:isSuperMonthCardExpire() then 231 if self:isSuperMonthCardExpire() then
  232 + self:updateProperty({field = "smonthCardId", value = id})
200 self:updateProperty({field = "smonthCardEx", value = timeNow + duration}) 233 self:updateProperty({field = "smonthCardEx", value = timeNow + duration})
201 else 234 else
202 self:updateProperty({field = "smonthCardEx", value = self:getProperty("smonthCardEx") + duration}) 235 self:updateProperty({field = "smonthCardEx", value = self:getProperty("smonthCardEx") + duration})
203 end 236 end
204 self:sendMonthCardEmail() 237 self:sendMonthCardEmail()
  238 + elseif type == CardType.SuperMonthCardLevelUp then
  239 + if self:isSuperMonthCardExpire() then
  240 + skynet.error(string.format("super month card expired, can not level up,%d,%d",self.owner:getProperty("id"), id))
  241 + else
  242 + local cfg = csvdb["shop_cardCsv"][id]
  243 + if not cfg then return end
  244 + local dif = cfg.level - self:getCurMonthCardLvl(true)
  245 + if dif > 1 and dif < 0 then
  246 + return
  247 + end
  248 + self:updateProperty({field = "smonthCardId", value = id})
  249 + self:updateProperty({field = "smonthCardEx", value = self:getProperty("smonthCardEx") + duration})
  250 + end
  251 + self:sendMonthCardEmail()
205 elseif type == CardType.PrivilegeCard then 252 elseif type == CardType.PrivilegeCard then
206 if self:isPrivCardExpire() then 253 if self:isPrivCardExpire() then
207 self:updateProperty({field = "privCardEx", value = timeNow + duration}) 254 self:updateProperty({field = "privCardEx", value = timeNow + duration})
@@ -253,7 +300,7 @@ function Store:notifyUpdateProperty(field, newValue, oldValue) @@ -253,7 +300,7 @@ function Store:notifyUpdateProperty(field, newValue, oldValue)
253 key = field, 300 key = field,
254 newValue = newValue, 301 newValue = newValue,
255 oldValue = oldValue, 302 oldValue = oldValue,
256 - } 303 + }
257 SendPacket(actionCodes.Store_updateproperty, MsgPack.pack(datas)) 304 SendPacket(actionCodes.Store_updateproperty, MsgPack.pack(datas))
258 end 305 end
259 306
@@ -494,6 +541,8 @@ function Store:data() @@ -494,6 +541,8 @@ function Store:data()
494 actGoodsFlag = self:getProperty("actGoodsFlag"), 541 actGoodsFlag = self:getProperty("actGoodsFlag"),
495 bpInfo = self:getProperty("bpInfo"), 542 bpInfo = self:getProperty("bpInfo"),
496 totalRR = self:getProperty("totalRR"), 543 totalRR = self:getProperty("totalRR"),
  544 + monthCardId = self:getProperty("monthCardId"),
  545 + smonthCardId = self:getProperty("smonthCardId"),
497 } 546 }
498 end 547 end
499 548