diff --git a/src/actions/CarAction.lua b/src/actions/CarAction.lua index 4b9efc6..25d8c3d 100644 --- a/src/actions/CarAction.lua +++ b/src/actions/CarAction.lua @@ -128,7 +128,7 @@ function _M.saleEquipRpc(agent, data ) local backs = msg.backs if not backs then return end for id, count in pairs(backs) do - if not csvdb["ItemCsv"][id] then return end + if not csvdb["itemCsv"][id] then return end local typ = math.floor((id-7000)/100) local lv = (id-7000)%100 local own = role:getEquipCount(typ,lv) @@ -136,7 +136,7 @@ function _M.saleEquipRpc(agent, data ) end local reward = {} for id, count in pairs(backs) do - local itemData = csvdb["ItemCsv"][id] + local itemData = csvdb["itemCsv"][id] local typ = math.floor((id-7000)/100) local lv = (id-7000)%100 role:addEquip(typ, lv, -count) -- 删掉装备 @@ -158,11 +158,11 @@ function _M.saleRuneRpc(agent, data ) if not backs then return end local reward = {} - for _, id in pairs(backs) do + for _, uid in pairs(backs) do local rune = role.runeBag[uid] if not rune then return end if rune:getProperty("refer") ~= 0 then return end - local itemData = csvdb["ItemCsv"][rune:getProperty("id")] + local itemData = csvdb["itemCsv"][rune:getProperty("id")] if not itemData then return end local one = itemData.sell_effect:toNumMap() for k ,v in pairs(one) do diff --git a/src/actions/DinerAction.lua b/src/actions/DinerAction.lua index 3ac1bb8..ea41398 100644 --- a/src/actions/DinerAction.lua +++ b/src/actions/DinerAction.lua @@ -79,7 +79,6 @@ function _M.addSellRpc( agent, data ) sells[slot].level = dishLevel sells[slot].count = count sells[slot].time = skynet.timex() - calSell.deltaTime - sells[slot].hot = role.dinerData:getProperty("hot"):getv(sells[slot].dish, 0) role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) end SendPacket(actionCodes.Diner_addSellRpc, "") diff --git a/src/models/Diner.lua b/src/models/Diner.lua index 2540714..86aab6b 100644 --- a/src/models/Diner.lua +++ b/src/models/Diner.lua @@ -8,7 +8,6 @@ Diner.schema = { buildL = {"string", ""}, -- 家具等级 1=1 2=1 3=1 order = {"string", "[]"}, -- 特殊订单 sells = {"string", "[]"}, -- 贩卖位置 - hot = {"string", ""}, -- 今日热门 dishTree = {"string", "1=1 101=1 201=1"}, -- 料理天赋 skillTree = {"string", ""}, -- 支援天赋 popular = {"number",0}, -- 累计人气 @@ -17,34 +16,6 @@ Diner.schema = { } function Diner:refreshDailyData(notify) - -- 热门料理 - local hotPool = {} - local dishTree = self:getProperty("dishTree"):toNumMap() - local hangPass = self.owner:getProperty("hangPass") - - for index, dishData in ipairs(csvdb["diner_dishCsv"]) do - local check = true - local dish = dishData[1] - if not dishTree[dish.id] then - check = false - end - if dish.unlock_carbon > 0 and not hangPass[dish.unlock_carbon] then - check = false - end - if check then - table.insert(hotPool, index) - end - end - if #hotPool >= 2 then - local hot = "" - for n = 1, 2 do - local index = math.random(1, #hotPool) - hot = hot:setv(hotPool[index], 1) - table.remove(hotPool, index) - end - self:updateProperty({field = "hot", value = hot, notNotify = not notify}) - self:setProperty("hot", hot) - end -- 每日加速次数 self:updateProperty({field = "expedite", value = 1, notNotify = not notify}) self:setProperty("expedite", 1) @@ -131,12 +102,6 @@ function Diner:calSellReward(sell, delta, dishData) reward = reward:incrv(key, value * delta) end popular = popular + dishData.famous_normal * delta - if sell.hot > 0 then - for key, value in pairs(dishData.item_popular:toNumMap()) do - reward = reward:incrv(key, value * delta) - end - popular = popular + dishData.famous_popular * delta - end for buildType = 1, 6 do local level = self:getProperty("buildL"):getv(buildType, 1) @@ -174,9 +139,6 @@ function Diner:updateSell(slot, calOnly) local deltaCount = 0 local timePass = skynet.timex() - sell.time local sellTime = dishData.sell_time - if slot.hot then - sellTime = sellTime * dishData.popularity - end deltaCount = math.floor(timePass / sellTime) if deltaCount < sell.count then @@ -190,7 +152,6 @@ function Diner:updateSell(slot, calOnly) sells[slot].time = skynet.timex() - deltaTime sells[slot].count = lastCount sells[slot].level = self:getProperty("dishTree"):getv(sell.dish, 1) - sells[slot].hot = self:getProperty("hot"):getv(sell.dish, 0) sells[slot].reward = reward self:setProperty("sells", json.encode(sells)) self:incrProperty("popular",popular) @@ -215,9 +176,6 @@ function Diner:expediteSell(slot) local expediteCount = 0 local expediteTime = 7200 local sellTime = dishData.sell_time - if slot.hot then - sellTime = sellTime * dishData.popularity - end expediteCount = math.floor(expediteTime / sellTime) expediteCount = math.min(expediteCount, sell.count) local lastCount = sell.count - expediteCount @@ -264,7 +222,7 @@ function Diner:getMaxDishs() end function Diner:data() - local properties = {"buildL", "order", "sells", "hot", "dishTree", "skillTree","popular","expedite","gTime"} + local properties = {"buildL", "order", "sells", "dishTree", "skillTree","popular","expedite","gTime"} local data = self:getProperties(properties) return data end diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index a7a2eb5..8b2f124 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -474,7 +474,7 @@ function RolePlugin.bind(Role) function Role:delRunes(runeIds) -- 批量删除 {id, } local roleId = self:getProperty('id') local bDel = {} - for _, runeId in paris(runeIds) do + for _, runeId in pairs(runeIds) do local rune = self.runeBag[runeId] if rune and rune:getProperty("refer") == 0 then self.runeBag[runeId] = nil -- libgit2 0.21.2