Commit a33ade6c06745e0c294b1c955149e506f58def2a
1 parent
d593a874
rmb礼包改钻石礼包
Showing
6 changed files
with
34 additions
and
18 deletions
Show diff stats
src/actions/HangAction.lua
... | ... | @@ -127,7 +127,7 @@ local function checkReward(role, isTreasure) |
127 | 127 | |
128 | 128 | --挂机得到的宝藏加入到挂机奖励 |
129 | 129 | if isTreasure or false == true then |
130 | - local treasureList= role.dailyData:checkTreasureList(hangInfo.carbonId) | |
130 | + local treasureList= role.dailyData:checkTreasureList(hangInfo.carbonId) or {} | |
131 | 131 | if next(treasureList) ~= nil then |
132 | 132 | for id, val in pairs(treasureList) do |
133 | 133 | local award = val.award:toNumMap() |
... | ... | @@ -458,7 +458,7 @@ function _M.getRewardRpc(agent , data) |
458 | 458 | residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
459 | 459 | }) |
460 | 460 | |
461 | - role:mylog("hang_action", {desc = "hangReward", int1 = hangTime}) | |
461 | + role:mylog("hang_action", {desc = "hangReward", int1 = hangInfo.carbonId, int2=hangTime}) | |
462 | 462 | |
463 | 463 | SendPacket(actionCodes.Hang_getRewardRpc, MsgPack.pack({ |
464 | 464 | reward = reward, |
... | ... | @@ -528,7 +528,7 @@ function _M.quickRpc(agent , data) |
528 | 528 | residence_time = time, --挂机或排名时长 |
529 | 529 | residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
530 | 530 | }) |
531 | - role:mylog("hang_action", {desc = "quick", short1 = curCount}) | |
531 | + role:mylog("hang_action", {desc = "quick", int1 = hangInfo.carbonId, short1 = curCount}) | |
532 | 532 | |
533 | 533 | SendPacket(actionCodes.Hang_quickRpc, MsgPack.pack({ |
534 | 534 | reward = reward, | ... | ... |
src/actions/StoreAction.lua
... | ... | @@ -267,7 +267,7 @@ function _M.shopBuyRpc(agent , data) |
267 | 267 | local id = msg.id |
268 | 268 | local count = msg.count or 1 |
269 | 269 | |
270 | - local dataSet = csvdb["shop_normalCsv"][id] | |
270 | + local dataSet = csvdb["shop_normalCsv"][id] | |
271 | 271 | if not dataSet then return end |
272 | 272 | |
273 | 273 | if dataSet.unlock ~= "" then |
... | ... | @@ -277,6 +277,13 @@ function _M.shopBuyRpc(agent , data) |
277 | 277 | end |
278 | 278 | end |
279 | 279 | |
280 | + --判断是否是活动商品 | |
281 | + if dataSet.activity_id and dataSet.activity_id ~= 0 then | |
282 | + local actCfg = csvdb["activity_ctrlCsv"][dataSet.activity_id] | |
283 | + if not actCfg then return 2 end | |
284 | + if not role.activity:isOpenById(dataSet.activity_id, "ActShopGoods") then return 3 end | |
285 | + end | |
286 | + | |
280 | 287 | local buyRecord = role.storeData:getProperty("buyR") |
281 | 288 | if math.illegalNum(count, 1, (dataSet.limit == 0 and math.huge or dataSet.limit - (buyRecord[id] or 0))) then |
282 | 289 | skynet.error(string.format("shop buy over limit, user_id:%d, goods_id:%d", role:getProperty("id"), id)) |
... | ... | @@ -298,19 +305,19 @@ function _M.shopBuyRpc(agent , data) |
298 | 305 | desc = "pvpShop" |
299 | 306 | end |
300 | 307 | |
301 | - if not role:checkItemEnough(cost) then return end | |
308 | + if not role:checkItemEnough(cost) then return 4 end | |
302 | 309 | |
303 | 310 | if dataSet.limit ~= 0 then |
304 | 311 | buyRecord[id] = (buyRecord[id] or 0) + count |
305 | 312 | role.storeData:updateProperty({field = "buyR", value = buyRecord}) |
306 | 313 | end |
307 | - role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count}}) | |
314 | + role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, short1 = dataSet.shop}}) | |
308 | 315 | |
309 | 316 | local gift = {} |
310 | 317 | for _id, _count in pairs(dataSet.gift:toNumMap()) do |
311 | 318 | gift[_id] = _count * count |
312 | 319 | end |
313 | - local reward = role:award(gift, {log = {desc = desc, int1 = id, int2 = count}}) | |
320 | + local reward = role:award(gift, {log = {desc = desc, int1 = id, int2 = count, short1=dataSet.shop}}) | |
314 | 321 | |
315 | 322 | if dataSet.shop == 1 then |
316 | 323 | role:checkTaskEnter("ShopAll", {count = count}) | ... | ... |
src/models/RoleBattle.lua
... | ... | @@ -99,7 +99,8 @@ function Role:checkBattleCheat(battleType, params) |
99 | 99 | for arr, _ in pairs(checkCheatAttrs) do |
100 | 100 | temp[arr] = hero[arr] |
101 | 101 | end |
102 | - selfTeamServer[hero.type] = temp | |
102 | + selfTeamServer[hero.type] = temp | |
103 | + self:log_battle_hero(hero.type, "hangTeam") | |
103 | 104 | end |
104 | 105 | -- local carbonData = csvdb["idle_battleCsv"][params.id] |
105 | 106 | -- enemyServer = packBattleEnemyCommon(carbonData) |
... | ... | @@ -112,6 +113,7 @@ function Role:checkBattleCheat(battleType, params) |
112 | 113 | temp[arr] = hero[arr] |
113 | 114 | end |
114 | 115 | selfTeamServer[hero.type] = temp |
116 | + self:log_battle_hero(hero.type, "towerTeam") | |
115 | 117 | end |
116 | 118 | -- local carbonData = csvdb["tower_battleCsv"][params.id] |
117 | 119 | -- enemyServer = packBattleEnemyCommon(carbonData) |
... | ... | @@ -124,6 +126,7 @@ function Role:checkBattleCheat(battleType, params) |
124 | 126 | temp[arr] = hero[arr] |
125 | 127 | end |
126 | 128 | selfTeamServer[hero.type] = temp |
129 | + self:log_battle_hero(hero.type, "bonusTeam") | |
127 | 130 | end |
128 | 131 | -- local carbonData = csvdb["bonus_battleCsv"][params.id] |
129 | 132 | -- enemyServer = packBattleEnemyCommon(carbonData) |
... | ... | @@ -136,6 +139,7 @@ function Role:checkBattleCheat(battleType, params) |
136 | 139 | temp[arr] = hero[arr] |
137 | 140 | end |
138 | 141 | selfTeamServer[hero.type] = temp |
142 | + self:log_battle_hero(hero.type, "workTeam") | |
139 | 143 | end |
140 | 144 | -- local carbonData = csvdb["bonus_battleCsv"][params.id] |
141 | 145 | -- enemyServer = packBattleEnemyCommon(carbonData) |
... | ... | @@ -149,6 +153,7 @@ function Role:checkBattleCheat(battleType, params) |
149 | 153 | temp[arr] = hero[arr] |
150 | 154 | end |
151 | 155 | selfTeamServer[hero.type] = temp |
156 | + self:log_battle_hero(hero.type, "pvpcTeam") | |
152 | 157 | end |
153 | 158 | end |
154 | 159 | cheat["pvph"] = cheat["pvpc"] |
... | ... | @@ -197,7 +202,6 @@ function Role:checkBattle(battleType, params) |
197 | 202 | |
198 | 203 | local fixData = { |
199 | 204 | hang = function() |
200 | - dump(self:getProperty("hangTS")) | |
201 | 205 | for slot, hero in pairs(self:getProperty("hangTS").heros) do |
202 | 206 | selflist[slot] = hero.type |
203 | 207 | end | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -398,10 +398,11 @@ function RolePlugin.bind(Role) |
398 | 398 | return true, less |
399 | 399 | end |
400 | 400 | for itemId, count in pairs(itemCountT) do |
401 | - if count <= 0 then | |
402 | - -- 判断物品数量值不应该小于等于0 | |
403 | - less[itemId] = 0 | |
404 | - else | |
401 | + --if count <= 0 then | |
402 | + -- -- 判断物品数量值不应该小于等于0 | |
403 | + -- less[itemId] = 0 | |
404 | + --else | |
405 | + if count > 0 then | |
405 | 406 | local last = self:getItemCount(itemId) - count |
406 | 407 | if last < 0 then |
407 | 408 | less[itemId] = -last |
... | ... | @@ -2799,6 +2800,10 @@ function RolePlugin.bind(Role) |
2799 | 2800 | return level |
2800 | 2801 | end |
2801 | 2802 | |
2803 | + function Role:log_battle_hero(heroType, desc) | |
2804 | + self:mylog("hero_action", {desc = desc, int1 = heroType}) | |
2805 | + end | |
2806 | + | |
2802 | 2807 | end |
2803 | 2808 | |
2804 | 2809 | return RolePlugin |
2805 | 2810 | \ No newline at end of file | ... | ... |
src/models/Store.lua
... | ... | @@ -440,19 +440,19 @@ function Store:OnTriggerLimitTimePack(eventType, param) |
440 | 440 | end |
441 | 441 | end |
442 | 442 | if config ~= nil then |
443 | - local rechargeCfg = csvdb["shop_rechargeCsv"][config.packId] | |
443 | + local rechargeCfg = csvdb["shop_normalCsv"][config.packId] | |
444 | 444 | if rechargeCfg then |
445 | 445 | limitPack[rechargeCfg.id] = {timeNow + rechargeCfg.time, config.id} |
446 | 446 | self.owner:log("push_gift", { |
447 | 447 | gift_id = rechargeCfg.id, --礼包ID |
448 | - gift_name = rechargeCfg.title, --礼包名称 | |
448 | + gift_name = rechargeCfg.descId, --礼包名称 | |
449 | 449 | }) |
450 | 450 | -- 每日抽卡限时礼包 触发重置 |
451 | 451 | if eventType == TriggerEventType.DrawHeroCnt then |
452 | - local payR = self:getProperty("payR") | |
452 | + local payR = self:getProperty("buyR") | |
453 | 453 | if payR[rechargeCfg.id] then |
454 | 454 | payR[rechargeCfg.id] = nil |
455 | - self:updateProperty({field = "payR", value = payR}) | |
455 | + self:updateProperty({field = "buyR", value = payR}) | |
456 | 456 | end |
457 | 457 | end |
458 | 458 | self:updateProperty({field = "limitTPack", value = limitPack}) | ... | ... |