diff --git a/src/actions/HangAction.lua b/src/actions/HangAction.lua index 5a220e7..f7b11d6 100644 --- a/src/actions/HangAction.lua +++ b/src/actions/HangAction.lua @@ -127,7 +127,7 @@ local function checkReward(role, isTreasure) --挂机得到的宝藏加入到挂机奖励 if isTreasure or false == true then - local treasureList= role.dailyData:checkTreasureList(hangInfo.carbonId) + local treasureList= role.dailyData:checkTreasureList(hangInfo.carbonId) or {} if next(treasureList) ~= nil then for id, val in pairs(treasureList) do local award = val.award:toNumMap() @@ -458,7 +458,7 @@ function _M.getRewardRpc(agent , data) residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} }) - role:mylog("hang_action", {desc = "hangReward", int1 = hangTime}) + role:mylog("hang_action", {desc = "hangReward", int1 = hangInfo.carbonId, int2=hangTime}) SendPacket(actionCodes.Hang_getRewardRpc, MsgPack.pack({ reward = reward, @@ -528,7 +528,7 @@ function _M.quickRpc(agent , data) residence_time = time, --挂机或排名时长 residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} }) - role:mylog("hang_action", {desc = "quick", short1 = curCount}) + role:mylog("hang_action", {desc = "quick", int1 = hangInfo.carbonId, short1 = curCount}) SendPacket(actionCodes.Hang_quickRpc, MsgPack.pack({ reward = reward, diff --git a/src/actions/StoreAction.lua b/src/actions/StoreAction.lua index 0b4d20e..fc0eed2 100644 --- a/src/actions/StoreAction.lua +++ b/src/actions/StoreAction.lua @@ -267,7 +267,7 @@ function _M.shopBuyRpc(agent , data) local id = msg.id local count = msg.count or 1 - local dataSet = csvdb["shop_normalCsv"][id] + local dataSet = csvdb["shop_normalCsv"][id] if not dataSet then return end if dataSet.unlock ~= "" then @@ -277,6 +277,13 @@ function _M.shopBuyRpc(agent , data) end end + --判断是否是活动商品 + if dataSet.activity_id and dataSet.activity_id ~= 0 then + local actCfg = csvdb["activity_ctrlCsv"][dataSet.activity_id] + if not actCfg then return 2 end + if not role.activity:isOpenById(dataSet.activity_id, "ActShopGoods") then return 3 end + end + local buyRecord = role.storeData:getProperty("buyR") if math.illegalNum(count, 1, (dataSet.limit == 0 and math.huge or dataSet.limit - (buyRecord[id] or 0))) then 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) desc = "pvpShop" end - if not role:checkItemEnough(cost) then return end + if not role:checkItemEnough(cost) then return 4 end if dataSet.limit ~= 0 then buyRecord[id] = (buyRecord[id] or 0) + count role.storeData:updateProperty({field = "buyR", value = buyRecord}) end - role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count}}) + role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, short1 = dataSet.shop}}) local gift = {} for _id, _count in pairs(dataSet.gift:toNumMap()) do gift[_id] = _count * count end - local reward = role:award(gift, {log = {desc = desc, int1 = id, int2 = count}}) + local reward = role:award(gift, {log = {desc = desc, int1 = id, int2 = count, short1=dataSet.shop}}) if dataSet.shop == 1 then role:checkTaskEnter("ShopAll", {count = count}) diff --git a/src/csvdata b/src/csvdata index 423f197..bd13610 160000 --- a/src/csvdata +++ b/src/csvdata @@ -1 +1 @@ -Subproject commit 423f19786662b906ac46231e20c36aa5ae35205b +Subproject commit bd13610bc236a8df4eede66365eb499ecd5b3c45 diff --git a/src/models/RoleBattle.lua b/src/models/RoleBattle.lua index 629fdbe..327e054 100644 --- a/src/models/RoleBattle.lua +++ b/src/models/RoleBattle.lua @@ -99,7 +99,8 @@ function Role:checkBattleCheat(battleType, params) for arr, _ in pairs(checkCheatAttrs) do temp[arr] = hero[arr] end - selfTeamServer[hero.type] = temp + selfTeamServer[hero.type] = temp + self:log_battle_hero(hero.type, "hangTeam") end -- local carbonData = csvdb["idle_battleCsv"][params.id] -- enemyServer = packBattleEnemyCommon(carbonData) @@ -112,6 +113,7 @@ function Role:checkBattleCheat(battleType, params) temp[arr] = hero[arr] end selfTeamServer[hero.type] = temp + self:log_battle_hero(hero.type, "towerTeam") end -- local carbonData = csvdb["tower_battleCsv"][params.id] -- enemyServer = packBattleEnemyCommon(carbonData) @@ -124,6 +126,7 @@ function Role:checkBattleCheat(battleType, params) temp[arr] = hero[arr] end selfTeamServer[hero.type] = temp + self:log_battle_hero(hero.type, "bonusTeam") end -- local carbonData = csvdb["bonus_battleCsv"][params.id] -- enemyServer = packBattleEnemyCommon(carbonData) @@ -136,6 +139,7 @@ function Role:checkBattleCheat(battleType, params) temp[arr] = hero[arr] end selfTeamServer[hero.type] = temp + self:log_battle_hero(hero.type, "workTeam") end -- local carbonData = csvdb["bonus_battleCsv"][params.id] -- enemyServer = packBattleEnemyCommon(carbonData) @@ -149,6 +153,7 @@ function Role:checkBattleCheat(battleType, params) temp[arr] = hero[arr] end selfTeamServer[hero.type] = temp + self:log_battle_hero(hero.type, "pvpcTeam") end end cheat["pvph"] = cheat["pvpc"] @@ -197,7 +202,6 @@ function Role:checkBattle(battleType, params) local fixData = { hang = function() - dump(self:getProperty("hangTS")) for slot, hero in pairs(self:getProperty("hangTS").heros) do selflist[slot] = hero.type end diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 89d22de..f757feb 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -398,10 +398,11 @@ function RolePlugin.bind(Role) return true, less end for itemId, count in pairs(itemCountT) do - if count <= 0 then - -- 判断物品数量值不应该小于等于0 - less[itemId] = 0 - else + --if count <= 0 then + -- -- 判断物品数量值不应该小于等于0 + -- less[itemId] = 0 + --else + if count > 0 then local last = self:getItemCount(itemId) - count if last < 0 then less[itemId] = -last @@ -2799,6 +2800,10 @@ function RolePlugin.bind(Role) return level end + function Role:log_battle_hero(heroType, desc) + self:mylog("hero_action", {desc = desc, int1 = heroType}) + end + end return RolePlugin \ No newline at end of file diff --git a/src/models/Store.lua b/src/models/Store.lua index 2a18ec9..e03743d 100644 --- a/src/models/Store.lua +++ b/src/models/Store.lua @@ -440,19 +440,19 @@ function Store:OnTriggerLimitTimePack(eventType, param) end end if config ~= nil then - local rechargeCfg = csvdb["shop_rechargeCsv"][config.packId] + local rechargeCfg = csvdb["shop_normalCsv"][config.packId] if rechargeCfg then limitPack[rechargeCfg.id] = {timeNow + rechargeCfg.time, config.id} self.owner:log("push_gift", { gift_id = rechargeCfg.id, --礼包ID - gift_name = rechargeCfg.title, --礼包名称 + gift_name = rechargeCfg.descId, --礼包名称 }) -- 每日抽卡限时礼包 触发重置 if eventType == TriggerEventType.DrawHeroCnt then - local payR = self:getProperty("payR") + local payR = self:getProperty("buyR") if payR[rechargeCfg.id] then payR[rechargeCfg.id] = nil - self:updateProperty({field = "payR", value = payR}) + self:updateProperty({field = "buyR", value = payR}) end end self:updateProperty({field = "limitTPack", value = limitPack}) -- libgit2 0.21.2