Commit ef0e04ddcb7ba8dccdb46667e3b40d2d2f67f237

Authored by 熊润斐
2 parents 0da2b316 9e91460a

Merge branch 'bugfix' into tr/publish

Showing 2 changed files with 20 additions and 12 deletions   Show diff stats
src/models/RoleLog.lua
@@ -508,9 +508,10 @@ local MethodType = { @@ -508,9 +508,10 @@ local MethodType = {
508 mission_id = true, --关卡ID 508 mission_id = true, --关卡ID
509 mission_herolist = true, -- 英雄ID,排序以玩家出战设置为准,示例:[111, 222, 333, 444, 555] 509 mission_herolist = true, -- 英雄ID,排序以玩家出战设置为准,示例:[111, 222, 333, 444, 555]
510 mission_success_rate = true, -- 大成功几率 510 mission_success_rate = true, -- 大成功几率
511 - mission_reward = true, -- 获得奖励,建议使用json格式记录。示例:{ itemid1: 1, itemid2: 3, itemid3: 5} 511 + mission_reward = "json", -- 获得奖励,建议使用json格式记录。示例:{ itemid1: 1, itemid2: 3, itemid3: 5}
512 mission_result = true, -- 战斗结果(0-无效,1-胜利,2-失败) 512 mission_result = true, -- 战斗结果(0-无效,1-胜利,2-失败)
513 mission_roundtime = true, -- 完成耗时(秒) 513 mission_roundtime = true, -- 完成耗时(秒)
  514 + mission_cleartype = true, -- 1-开始; 2-完成(领取奖励时)
514 }, 515 },
515 hero_talent = { --英雄精进(原英雄天赋升级) TODO 516 hero_talent = { --英雄精进(原英雄天赋升级) TODO
516 hero_id = true, --英雄ID 517 hero_id = true, --英雄ID
@@ -542,20 +543,26 @@ local function isIos(self) @@ -542,20 +543,26 @@ local function isIos(self)
542 return sid == 2 543 return sid == 2
543 end 544 end
544 545
545 -local appid, sdkId 546 +local sdkId
  547 +local AppId = {
  548 + [1] = 4787,
  549 + [2] = 4788,
  550 + [3] = 4789,
  551 +}
546 local function getBaseLog(self) 552 local function getBaseLog(self)
547 local uid = self:getProperty("uid") 553 local uid = self:getProperty("uid")
548 - if not appid then  
549 - appid, sdkId = string.match(uid, "(.*)_(.*)")  
550 - if not appid then 554 + local sid = self:getProperty("sid")
  555 + if not sdkId then
  556 + _, sdkId = string.match(uid, "(.*)_(.*)")
  557 + if not _ then
551 sdkId = uid 558 sdkId = uid
552 - appid = 0  
553 end 559 end
554 end 560 end
  561 +
555 local log = { 562 local log = {
556 server_id = server_id, 563 server_id = server_id,
557 timestamp = skynet.timex(), 564 timestamp = skynet.timex(),
558 - app_id = appid, 565 + app_id = AppId[sid] or 0,
559 plat_id = isIos(self) and 0 or 1, 566 plat_id = isIos(self) and 0 or 1,
560 sdk_uid = sdkId, 567 sdk_uid = sdkId,
561 account_id = uid, 568 account_id = uid,
src/models/RolePlugin.lua
@@ -356,13 +356,14 @@ function RolePlugin.bind(Role) @@ -356,13 +356,14 @@ function RolePlugin.bind(Role)
356 if not self:costDiamond(pms) then 356 if not self:costDiamond(pms) then
357 return 357 return
358 end 358 end
359 - itemCountT[ItemId.Diamond] = nil  
360 end 359 end
361 for itemId, count in pairs(itemCountT) do 360 for itemId, count in pairs(itemCountT) do
362 - pms.itemId = itemId  
363 - pms.count = - count  
364 - self:addItem(pms)  
365 - self:itemDeltaEvent(pms) 361 + if itemId ~= ItemId.Diamond then
  362 + pms.itemId = itemId
  363 + pms.count = - count
  364 + self:addItem(pms)
  365 + self:itemDeltaEvent(pms)
  366 + end
366 end 367 end
367 return true 368 return true
368 end 369 end