Commit a33ade6c06745e0c294b1c955149e506f58def2a

Authored by liuzujun
1 parent d593a874

rmb礼包改钻石礼包

src/actions/HangAction.lua
@@ -127,7 +127,7 @@ local function checkReward(role, isTreasure) @@ -127,7 +127,7 @@ local function checkReward(role, isTreasure)
127 127
128 --挂机得到的宝藏加入到挂机奖励 128 --挂机得到的宝藏加入到挂机奖励
129 if isTreasure or false == true then 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 if next(treasureList) ~= nil then 131 if next(treasureList) ~= nil then
132 for id, val in pairs(treasureList) do 132 for id, val in pairs(treasureList) do
133 local award = val.award:toNumMap() 133 local award = val.award:toNumMap()
@@ -458,7 +458,7 @@ function _M.getRewardRpc(agent , data) @@ -458,7 +458,7 @@ function _M.getRewardRpc(agent , data)
458 residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} 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 SendPacket(actionCodes.Hang_getRewardRpc, MsgPack.pack({ 463 SendPacket(actionCodes.Hang_getRewardRpc, MsgPack.pack({
464 reward = reward, 464 reward = reward,
@@ -528,7 +528,7 @@ function _M.quickRpc(agent , data) @@ -528,7 +528,7 @@ function _M.quickRpc(agent , data)
528 residence_time = time, --挂机或排名时长 528 residence_time = time, --挂机或排名时长
529 residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} 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 SendPacket(actionCodes.Hang_quickRpc, MsgPack.pack({ 533 SendPacket(actionCodes.Hang_quickRpc, MsgPack.pack({
534 reward = reward, 534 reward = reward,
src/actions/StoreAction.lua
@@ -267,7 +267,7 @@ function _M.shopBuyRpc(agent , data) @@ -267,7 +267,7 @@ function _M.shopBuyRpc(agent , data)
267 local id = msg.id 267 local id = msg.id
268 local count = msg.count or 1 268 local count = msg.count or 1
269 269
270 - local dataSet = csvdb["shop_normalCsv"][id] 270 + local dataSet = csvdb["shop_normalCsv"][id]
271 if not dataSet then return end 271 if not dataSet then return end
272 272
273 if dataSet.unlock ~= "" then 273 if dataSet.unlock ~= "" then
@@ -277,6 +277,13 @@ function _M.shopBuyRpc(agent , data) @@ -277,6 +277,13 @@ function _M.shopBuyRpc(agent , data)
277 end 277 end
278 end 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 local buyRecord = role.storeData:getProperty("buyR") 287 local buyRecord = role.storeData:getProperty("buyR")
281 if math.illegalNum(count, 1, (dataSet.limit == 0 and math.huge or dataSet.limit - (buyRecord[id] or 0))) then 288 if math.illegalNum(count, 1, (dataSet.limit == 0 and math.huge or dataSet.limit - (buyRecord[id] or 0))) then
282 skynet.error(string.format("shop buy over limit, user_id:%d, goods_id:%d", role:getProperty("id"), id)) 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,19 +305,19 @@ function _M.shopBuyRpc(agent , data)
298 desc = "pvpShop" 305 desc = "pvpShop"
299 end 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 if dataSet.limit ~= 0 then 310 if dataSet.limit ~= 0 then
304 buyRecord[id] = (buyRecord[id] or 0) + count 311 buyRecord[id] = (buyRecord[id] or 0) + count
305 role.storeData:updateProperty({field = "buyR", value = buyRecord}) 312 role.storeData:updateProperty({field = "buyR", value = buyRecord})
306 end 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 local gift = {} 316 local gift = {}
310 for _id, _count in pairs(dataSet.gift:toNumMap()) do 317 for _id, _count in pairs(dataSet.gift:toNumMap()) do
311 gift[_id] = _count * count 318 gift[_id] = _count * count
312 end 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 if dataSet.shop == 1 then 322 if dataSet.shop == 1 then
316 role:checkTaskEnter("ShopAll", {count = count}) 323 role:checkTaskEnter("ShopAll", {count = count})
1 -Subproject commit 423f19786662b906ac46231e20c36aa5ae35205b 1 +Subproject commit bd13610bc236a8df4eede66365eb499ecd5b3c45
src/models/RoleBattle.lua
@@ -99,7 +99,8 @@ function Role:checkBattleCheat(battleType, params) @@ -99,7 +99,8 @@ function Role:checkBattleCheat(battleType, params)
99 for arr, _ in pairs(checkCheatAttrs) do 99 for arr, _ in pairs(checkCheatAttrs) do
100 temp[arr] = hero[arr] 100 temp[arr] = hero[arr]
101 end 101 end
102 - selfTeamServer[hero.type] = temp 102 + selfTeamServer[hero.type] = temp
  103 + self:log_battle_hero(hero.type, "hangTeam")
103 end 104 end
104 -- local carbonData = csvdb["idle_battleCsv"][params.id] 105 -- local carbonData = csvdb["idle_battleCsv"][params.id]
105 -- enemyServer = packBattleEnemyCommon(carbonData) 106 -- enemyServer = packBattleEnemyCommon(carbonData)
@@ -112,6 +113,7 @@ function Role:checkBattleCheat(battleType, params) @@ -112,6 +113,7 @@ function Role:checkBattleCheat(battleType, params)
112 temp[arr] = hero[arr] 113 temp[arr] = hero[arr]
113 end 114 end
114 selfTeamServer[hero.type] = temp 115 selfTeamServer[hero.type] = temp
  116 + self:log_battle_hero(hero.type, "towerTeam")
115 end 117 end
116 -- local carbonData = csvdb["tower_battleCsv"][params.id] 118 -- local carbonData = csvdb["tower_battleCsv"][params.id]
117 -- enemyServer = packBattleEnemyCommon(carbonData) 119 -- enemyServer = packBattleEnemyCommon(carbonData)
@@ -124,6 +126,7 @@ function Role:checkBattleCheat(battleType, params) @@ -124,6 +126,7 @@ function Role:checkBattleCheat(battleType, params)
124 temp[arr] = hero[arr] 126 temp[arr] = hero[arr]
125 end 127 end
126 selfTeamServer[hero.type] = temp 128 selfTeamServer[hero.type] = temp
  129 + self:log_battle_hero(hero.type, "bonusTeam")
127 end 130 end
128 -- local carbonData = csvdb["bonus_battleCsv"][params.id] 131 -- local carbonData = csvdb["bonus_battleCsv"][params.id]
129 -- enemyServer = packBattleEnemyCommon(carbonData) 132 -- enemyServer = packBattleEnemyCommon(carbonData)
@@ -136,6 +139,7 @@ function Role:checkBattleCheat(battleType, params) @@ -136,6 +139,7 @@ function Role:checkBattleCheat(battleType, params)
136 temp[arr] = hero[arr] 139 temp[arr] = hero[arr]
137 end 140 end
138 selfTeamServer[hero.type] = temp 141 selfTeamServer[hero.type] = temp
  142 + self:log_battle_hero(hero.type, "workTeam")
139 end 143 end
140 -- local carbonData = csvdb["bonus_battleCsv"][params.id] 144 -- local carbonData = csvdb["bonus_battleCsv"][params.id]
141 -- enemyServer = packBattleEnemyCommon(carbonData) 145 -- enemyServer = packBattleEnemyCommon(carbonData)
@@ -149,6 +153,7 @@ function Role:checkBattleCheat(battleType, params) @@ -149,6 +153,7 @@ function Role:checkBattleCheat(battleType, params)
149 temp[arr] = hero[arr] 153 temp[arr] = hero[arr]
150 end 154 end
151 selfTeamServer[hero.type] = temp 155 selfTeamServer[hero.type] = temp
  156 + self:log_battle_hero(hero.type, "pvpcTeam")
152 end 157 end
153 end 158 end
154 cheat["pvph"] = cheat["pvpc"] 159 cheat["pvph"] = cheat["pvpc"]
@@ -197,7 +202,6 @@ function Role:checkBattle(battleType, params) @@ -197,7 +202,6 @@ function Role:checkBattle(battleType, params)
197 202
198 local fixData = { 203 local fixData = {
199 hang = function() 204 hang = function()
200 - dump(self:getProperty("hangTS"))  
201 for slot, hero in pairs(self:getProperty("hangTS").heros) do 205 for slot, hero in pairs(self:getProperty("hangTS").heros) do
202 selflist[slot] = hero.type 206 selflist[slot] = hero.type
203 end 207 end
src/models/RolePlugin.lua
@@ -398,10 +398,11 @@ function RolePlugin.bind(Role) @@ -398,10 +398,11 @@ function RolePlugin.bind(Role)
398 return true, less 398 return true, less
399 end 399 end
400 for itemId, count in pairs(itemCountT) do 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 local last = self:getItemCount(itemId) - count 406 local last = self:getItemCount(itemId) - count
406 if last < 0 then 407 if last < 0 then
407 less[itemId] = -last 408 less[itemId] = -last
@@ -2799,6 +2800,10 @@ function RolePlugin.bind(Role) @@ -2799,6 +2800,10 @@ function RolePlugin.bind(Role)
2799 return level 2800 return level
2800 end 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 end 2807 end
2803 2808
2804 return RolePlugin 2809 return RolePlugin
2805 \ No newline at end of file 2810 \ No newline at end of file
src/models/Store.lua
@@ -440,19 +440,19 @@ function Store:OnTriggerLimitTimePack(eventType, param) @@ -440,19 +440,19 @@ function Store:OnTriggerLimitTimePack(eventType, param)
440 end 440 end
441 end 441 end
442 if config ~= nil then 442 if config ~= nil then
443 - local rechargeCfg = csvdb["shop_rechargeCsv"][config.packId] 443 + local rechargeCfg = csvdb["shop_normalCsv"][config.packId]
444 if rechargeCfg then 444 if rechargeCfg then
445 limitPack[rechargeCfg.id] = {timeNow + rechargeCfg.time, config.id} 445 limitPack[rechargeCfg.id] = {timeNow + rechargeCfg.time, config.id}
446 self.owner:log("push_gift", { 446 self.owner:log("push_gift", {
447 gift_id = rechargeCfg.id, --礼包ID 447 gift_id = rechargeCfg.id, --礼包ID
448 - gift_name = rechargeCfg.title, --礼包名称 448 + gift_name = rechargeCfg.descId, --礼包名称
449 }) 449 })
450 -- 每日抽卡限时礼包 触发重置 450 -- 每日抽卡限时礼包 触发重置
451 if eventType == TriggerEventType.DrawHeroCnt then 451 if eventType == TriggerEventType.DrawHeroCnt then
452 - local payR = self:getProperty("payR") 452 + local payR = self:getProperty("buyR")
453 if payR[rechargeCfg.id] then 453 if payR[rechargeCfg.id] then
454 payR[rechargeCfg.id] = nil 454 payR[rechargeCfg.id] = nil
455 - self:updateProperty({field = "payR", value = payR}) 455 + self:updateProperty({field = "buyR", value = payR})
456 end 456 end
457 end 457 end
458 self:updateProperty({field = "limitTPack", value = limitPack}) 458 self:updateProperty({field = "limitTPack", value = limitPack})