Commit 12a26adef7d2ac42fd6e4c073de10001f77705ff

Authored by zhouhaihai
2 parents ebc40c72 82520a23

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

* tr/bugfix-qa:
  拾荒随机 错误
  金额使用 乘以 100 的方式
  mycard twd
  反回 的是twd
  战令-一次性领取超出周上限的战令经验应该只领取到达周上限的那一部分
  战令奖励错位
  战令活动购买等级扣除钻石bug
  代理拾荒出勤人数计数错误, 代理拾荒没有统计进拾荒体力消耗
  httpweb
  美食币计算错误
  开启x品质时钟箱任务计数错误bug
  活动任务数据重置
  活动结束回收邮件
src/actions/ActivityAction.lua
... ... @@ -1237,10 +1237,10 @@ function _M.battleCommandRpc(agent, data)
1237 1237 local awd = ""
1238 1238 if pay then
1239 1239 actData["payR"] = record
1240   - awd = bpCfg["rewardNormal"]
  1240 + awd = bpCfg["rewardHigh"]
1241 1241 else
1242 1242 actData["freeR"] = record
1243   - awd = bpCfg["rewardHigh"]
  1243 + awd = bpCfg["rewardNormal"]
1244 1244 end
1245 1245 for k, v in pairs(awd:toNumMap()) do
1246 1246 award[k] = (award[k] or 0) + v
... ... @@ -1279,6 +1279,7 @@ function _M.buyBattleCommandLvlRpc(agent, data)
1279 1279 local cfg = bpCfg[i]
1280 1280 if cfg["type"] > curLvl and cfg["type"] <= nextLvl then
1281 1281 cost = cost + cfg["cost"]
  1282 + elseif cfg["type"] > nextLvl then
1282 1283 break
1283 1284 end
1284 1285 end
... ...
src/actions/AdvAction.lua
... ... @@ -291,6 +291,8 @@ function _M.startHangRpc(agent, data)
291 291  
292 292 if not role:checkAdvCount(adv_idle_energy) then return 7 end -- 是否有体力
293 293  
  294 + role:checkTaskEnter("AdvCostPower", {count = adv_idle_energy})
  295 +
294 296 if not checkFormat(role, format, role:getAdvData():isRunning()) then return 8 end --编队是否正确
295 297  
296 298 local player = {}
... ...
src/actions/HttpAction.lua
... ... @@ -151,7 +151,7 @@ function _M.query_role(query)
151 151 if not query.uid then return "not found" end
152 152 local user = redisproxy:get(string.format("uid:%s", query.uid))
153 153 if not user then return "not found" end
154   - local roleId = redisproxy:get(string_format("user:%s", string.upper(user)))
  154 + local roleId = redisproxy:get(string.format("user:%s", string.upper(user)))
155 155 if not roleId then return "not found" end
156 156 return json.encode({roleId, user})
157 157 end
... ...
1   -Subproject commit 3a1129db7ff72ddc39e74f565bcf3742af5ec87b
  1 +Subproject commit 5c618b16315e74aaa111b3e84dbc4da3f7b3d699
... ...
src/models/Activity.lua
... ... @@ -473,6 +473,7 @@ activityFunc[Activity.ActivityType.CalendaTask] = {
473 473 ["init"] = function(self, actType, isCrossDay, notify)
474 474 local calTask = self.owner:getProperty("calTask")
475 475 calTask = {}
  476 + self.owner:updateProperty({field="calTask", value=calTask})
476 477 local role = self.owner
477 478 local buildL = role.dinerData:getProperty("buildL")
478 479 local curLevel = buildL:getv(1, 1)
... ... @@ -540,6 +541,7 @@ activityFunc[Activity.ActivityType.BattleCommandTask] = {
540 541 ["init"] = function(self, actType, isCrossDay, notify)
541 542 local bcTask = self.owner:getProperty("bcTask")
542 543 bcTask = {}
  544 + self.owner:updateProperty({field="bcTask", value=bcTask})
543 545 local role = self.owner
544 546 local buildL = role.dinerData:getProperty("buildL")
545 547 local curLevel = buildL:getv(1, 1)
... ... @@ -715,8 +717,8 @@ function Activity:closeActivity(actId, notify, notUpdateAct)
715 717 local actType = actData.showType
716 718 if activityFunc[actType] and activityFunc[actType]['close'] then
717 719 activityFunc[actType]["close"](self, actType, notify, actId)
718   - self:recycleActItem(actId)
719 720 end
  721 + self:recycleActItem(actId)
720 722 if Activity.schema["act".. actType] then
721 723 if not Activity.schema["act" .. actType][3] then
722 724 self:updateActData(actType, Activity.schema["act" .. actType][2], not notify or notUpdateAct)
... ... @@ -1003,7 +1005,7 @@ activityFunc[Activity.ActivityType.CommonSignIn] = {
1003 1005 ["crossDay"] = function(self, actType, notify, actId)
1004 1006 local actCfg = csvdb["activity_ctrlCsv"][actId]
1005 1007 if not actCfg then return end
1006   - local conArr = actCfg.condition2:toArray("true", "=")
  1008 + local conArr = actCfg.condition2:toArray(true, "=")
1007 1009 -- 0 登录即可, 1 达到指定活跃度
1008 1010 if conArr[1] ~= 0 then
1009 1011 return
... ... @@ -1042,12 +1044,16 @@ activityFunc[Activity.ActivityType.BattleCommand] = {
1042 1044 if not actCfg then return end
1043 1045 if actCfg.condition1 == "" then return end
1044 1046 local arr = actCfg.condition2:toArray(true, "=")
1045   - local itemId, limit = arr[1], arr[2]
1046   - if itemId == id and count > 0 then
1047   - if (actData["week"] or 0) >= limit then
1048   - return
  1047 + local itemIdWeek, itemIdNormal, limit = arr[1], arr[2], arr[3]
  1048 + if (itemIdWeek == id or itemIdNormal == id) and count > 0 then
  1049 + if itemIdWeek == id then
  1050 + if (actData["week"] or 0) >= limit then
  1051 + return
  1052 + end
  1053 + local old = actData["week"] or 0
  1054 + actData["week"] = math.min(old + count, limit)
  1055 + count = actData["week"] - old
1049 1056 end
1050   - actData["week"] = (actData["week"] or 0) + count
1051 1057 local total = actData["sum"] + count
1052 1058 local curLvl = actData["lvl"] or 0
1053 1059 if actCfg.condition == 1 then -- 代表sum需要转换为等级
... ...
src/models/Diner.lua
... ... @@ -201,7 +201,7 @@ function Diner:calSellReward(sell, delta, dishData)
201 201 upValue[ItemId.Gold] = (upValue[ItemId.Gold] or 0) + buildData.gold_up
202 202 end
203 203 if buildData.item_up > 0 then
204   - upValue[ItemId.DinerCoin] = (upValue[ItemId.DinerCoin] or 0) + buildData.gold_up
  204 + upValue[ItemId.DinerCoin] = (upValue[ItemId.DinerCoin] or 0) + buildData.item_up
205 205 end
206 206 if buildData and buildData.famous_up > 0 then
207 207 upValue[-1] = (upValue[-1] or 0) + buildData.famous_up
... ...
src/models/RolePlugin.lua
... ... @@ -1698,7 +1698,7 @@ function RolePlugin.bind(Role)
1698 1698 for k , v in pairs(csvdb["shop_rechargeCsv"]) do
1699 1699 if not v[pidField] then return "no product" end
1700 1700 if v[pidField] == params.product_id then
1701   - if v.rmb ~= params.money then
  1701 + if v.twd * 100 ~= tonumber(params.money) then
1702 1702 return "error money"
1703 1703 end
1704 1704 -- 发现需要的id
... ... @@ -1823,12 +1823,13 @@ function RolePlugin.bind(Role)
1823 1823 -- 充值 --
1824 1824 --[[
1825 1825 request.order = data.out_trade_no
1826   - request.amount = data.money / 100
  1826 + request.amount = data.money
1827 1827 request.game_money = data.game_money
1828 1828 request.product_id = data.product_id
1829 1829 request.pay_time = data.pay_time
1830 1830 request.transactionId = data.order_no
1831 1831 request.extension_info = data.extension_info
  1832 + request.is_mycard = 1
1832 1833 ]]
1833 1834 function Role:handlePurchase(params)
1834 1835 local roleId = self:getProperty("id")
... ... @@ -1844,7 +1845,7 @@ function RolePlugin.bind(Role)
1844 1845 end
1845 1846 local rechargeId = back
1846 1847 local rechargeData = csvdb["shop_rechargeCsv"][rechargeId]
1847   - if rechargeData.rmb ~= tonumber(params.amount) then
  1848 + if (params.is_mycard and rechargeData.twd * 100 ~= tonumber(params.amount)) or (not params.is_mycard and rechargeData.rmb * 100 ~= tonumber(params.amount)) then
1848 1849 skynet.error(string.format("[recharge] fake order: %s, roleId: %d, order: %s, rmb %s, get %s",
1849 1850 params.transactionId, roleId, partnerOrderStr, rechargeData.rmb, params.amount
1850 1851 ))
... ...
src/models/RoleTask.lua
... ... @@ -285,7 +285,7 @@ local CalendaTaskListener = {
285 285 [TaskType.OpenBox]= {{20, 3, f("count"), f("quality")}},
286 286 [TaskType.RadioTaskStart] = {{21, 1}, {22, 3, f("heroCnt")}},
287 287 [TaskType.BonusQuick] = {{23, 1, f("count")}},
288   - [TaskType.AdvHangHeroCnt] = {{24, 3, f("HeroCnt")}},
  288 + [TaskType.AdvHangHeroCnt] = {{24, 3, f("count")}},
289 289 [TaskType.AdvKillBoss] = {{25, 1}},
290 290 [TaskType.AdvMineKill] = {{26, 1}},
291 291 [TaskType.PvpBattle] = {{27, 1}},
... ...
src/services/httpweb.lua
... ... @@ -41,8 +41,10 @@ local port = ...
41 41 port = tonumber(port)
42 42  
43 43 local key = "zhaolu1234dangge"
44   -local function response(id, ...)
45   - local ok, err = httpd.write_response(sockethelper.writefunc(id), ...)
  44 +local function response(id, code, body)
  45 + local ok, err = httpd.write_response(sockethelper.writefunc(id), code, body, {
  46 + ["Connection"] = "Close",
  47 + })
46 48 if not ok then
47 49 -- if err == sockethelper.socket_error , that means socket closed.
48 50 skynet.error(string.format("fd = %d, %s", id, err))
... ...