Commit 3133cb766a39345ff914219e3560d5a4c8df6bf2

Authored by zhouhaihai
1 parent 388036be

日志

src/actions/AdvAction.lua
@@ -163,6 +163,8 @@ function _M.startAdvRpc( agent, data ) @@ -163,6 +163,8 @@ function _M.startAdvRpc( agent, data )
163 role:checkTaskEnter("AdvStart", {id = chapterId}) 163 role:checkTaskEnter("AdvStart", {id = chapterId})
164 role:checkTaskEnter("AdvStartSelf", {id = chapterId}) 164 role:checkTaskEnter("AdvStartSelf", {id = chapterId})
165 role:getAdvData():popBackEvents() -- 清一下事件 165 role:getAdvData():popBackEvents() -- 清一下事件
  166 + role:getAdvData():log({desc = "start", int1 = supportIdx})
  167 +
166 SendPacket(actionCodes.Adv_startAdvRpc, '') 168 SendPacket(actionCodes.Adv_startAdvRpc, '')
167 return true 169 return true
168 end 170 end
@@ -215,6 +217,8 @@ function _M.startHangRpc(agent, data) @@ -215,6 +217,8 @@ function _M.startHangRpc(agent, data)
215 217
216 role.dailyData:updateProperty({field = "advC", delta = 1}) 218 role.dailyData:updateProperty({field = "advC", delta = 1})
217 role:checkTaskEnter("AdvStart", {id = chapterId}) 219 role:checkTaskEnter("AdvStart", {id = chapterId})
  220 + role:log("adv_action", {desc = "startHang", int1 = chapterId})
  221 +
218 SendPacket(actionCodes.Adv_startHangRpc, '') 222 SendPacket(actionCodes.Adv_startHangRpc, '')
219 return true 223 return true
220 end 224 end
@@ -238,10 +242,12 @@ function _M.quickHangRpc(agent, data) @@ -238,10 +242,12 @@ function _M.quickHangRpc(agent, data)
238 local cost = math.ceil((info.time - skynet.timex()) / chapterData.idleTime * chapterData.accelerate) 242 local cost = math.ceil((info.time - skynet.timex()) / chapterData.idleTime * chapterData.accelerate)
239 243
240 if not role:checkItemEnough({[ItemId.Diamond] = cost}) then return end 244 if not role:checkItemEnough({[ItemId.Diamond] = cost}) then return end
241 - role:costItems({[ItemId.Diamond] = cost}) 245 + role:costItems({[ItemId.Diamond] = cost}, {log = {desc = "quickHang", int1 = chapterId}})
242 info.time = 0 246 info.time = 0
243 role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) 247 role:changeUpdates({{type = "advHang", field = chapterId, value = info}})
244 248
  249 + role:log("adv_action", {desc = "quickHang", int1 = chapterId})
  250 +
245 SendPacket(actionCodes.Adv_quickHangRpc, '') 251 SendPacket(actionCodes.Adv_quickHangRpc, '')
246 return true 252 return true
247 end 253 end
@@ -262,7 +268,7 @@ function _M.endHangRpc(agent, data) @@ -262,7 +268,7 @@ function _M.endHangRpc(agent, data)
262 268
263 local reward, isFull 269 local reward, isFull
264 if skynet.timex() >= info.time then 270 if skynet.timex() >= info.time then
265 - reward = role:award(chapterData.idleReward) 271 + reward = role:award(chapterData.idleReward, {log = {desc = "advHang", int1 = chapterId}})
266 else 272 else
267 if cancel then 273 if cancel then
268 if role.dailyData:getProperty("advC") <= 0 then 274 if role.dailyData:getProperty("advC") <= 0 then
@@ -277,6 +283,8 @@ function _M.endHangRpc(agent, data) @@ -277,6 +283,8 @@ function _M.endHangRpc(agent, data)
277 283
278 role:changeUpdates({{type = "advHang", field = chapterId, value = nil}}) 284 role:changeUpdates({{type = "advHang", field = chapterId, value = nil}})
279 285
  286 + role:log("adv_action", {desc = "endHang", int1 = chapterId, short1 = cancel and 1 or 0})
  287 +
280 SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, isFull = isFull})) 288 SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, isFull = isFull}))
281 return true 289 return true
282 end 290 end
@@ -298,7 +306,7 @@ function _M.buyAdvCountRpc(agent , data) @@ -298,7 +306,7 @@ function _M.buyAdvCountRpc(agent , data)
298 306
299 307
300 if not role:checkItemEnough(cost) then return end 308 if not role:checkItemEnough(cost) then return end
301 - role:costItems(cost) 309 + role:costItems(cost, {log = {desc = "buyAdvCount", short1 = isEl and 1 or 0, int1 = count}})
302 if isEl then 310 if isEl then
303 role.dailyData:updateProperty({field = "advElC", delta = -count}) 311 role.dailyData:updateProperty({field = "advElC", delta = -count})
304 role.dailyData:updateProperty({field = "advElBC", delta = count}) 312 role.dailyData:updateProperty({field = "advElBC", delta = count})
@@ -306,6 +314,7 @@ function _M.buyAdvCountRpc(agent , data) @@ -306,6 +314,7 @@ function _M.buyAdvCountRpc(agent , data)
306 role.dailyData:updateProperty({field = "advC", delta = -count}) 314 role.dailyData:updateProperty({field = "advC", delta = -count})
307 role.dailyData:updateProperty({field = "advBC", delta = count}) 315 role.dailyData:updateProperty({field = "advBC", delta = count})
308 end 316 end
  317 + role:log("adv_action", {desc = "buyAdvCount", short1 = isEl and 1 or 0, int1 = count})
309 318
310 SendPacket(actionCodes.Adv_buyAdvCountRpc, '') 319 SendPacket(actionCodes.Adv_buyAdvCountRpc, '')
311 return true 320 return true
@@ -329,6 +338,9 @@ function _M.finishTaskRpc(agent, data) @@ -329,6 +338,9 @@ function _M.finishTaskRpc(agent, data)
329 adv:updateTask() 338 adv:updateTask()
330 if not status then return end 339 if not status then return end
331 role:checkTaskEnter("AdvOverTask", {id = taskId}) 340 role:checkTaskEnter("AdvOverTask", {id = taskId})
  341 +
  342 + adv:log({desc = "finishTask", int1 = taskId})
  343 +
332 SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack({reward = reward})) 344 SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack({reward = reward}))
333 return true 345 return true
334 end 346 end
@@ -342,8 +354,12 @@ function _M.clickBlockRpc(agent, data) @@ -342,8 +354,12 @@ function _M.clickBlockRpc(agent, data)
342 local adv = role:getAdvData() 354 local adv = role:getAdvData()
343 355
344 if adv:isWaitChooseArtifact() then return end 356 if adv:isWaitChooseArtifact() then return end
  357 +
  358 + adv:log({desc = "clickBlock", int1 = msg.roomId, int2 = msg.blockId})
  359 +
345 local status, errorCode = adv:clickBlock(msg.roomId, msg.blockId, msg) 360 local status, errorCode = adv:clickBlock(msg.roomId, msg.blockId, msg)
346 if not status then return errorCode end 361 if not status then return errorCode end
  362 +
347 SendPacket(actionCodes.Adv_clickBlockRpc, MsgPack.pack({events = adv:popBackEvents()})) 363 SendPacket(actionCodes.Adv_clickBlockRpc, MsgPack.pack({events = adv:popBackEvents()}))
348 return true 364 return true
349 end 365 end
@@ -374,6 +390,7 @@ function _M.useItemRpc(agent, data) @@ -374,6 +390,7 @@ function _M.useItemRpc(agent, data)
374 end 390 end
375 391
376 adv:checkAchievement(adv.AchievType.UseItem, count, itemId) 392 adv:checkAchievement(adv.AchievType.UseItem, count, itemId)
  393 + adv:log({desc = "useItem", int1 = itemId, int2 = count})
377 394
378 for i = 1, count do 395 for i = 1, count do
379 adv:doActive(itemData.effect, target) -- target 396 adv:doActive(itemData.effect, target) -- target
@@ -409,6 +426,8 @@ function _M.usePotionRpc(agent, data) @@ -409,6 +426,8 @@ function _M.usePotionRpc(agent, data)
409 local adv = role:getAdvData() 426 local adv = role:getAdvData()
410 if adv:isWaitChooseArtifact() then return end 427 if adv:isWaitChooseArtifact() then return end
411 428
  429 + adv:log({desc = "usePotion", int1 = potionId})
  430 +
412 local status = adv:doActive(potionData.effect, target) -- target 431 local status = adv:doActive(potionData.effect, target) -- target
413 if not status then return end 432 if not status then return end
414 433
@@ -436,7 +455,7 @@ function _M.chooseArtifactRpc(agent, data) @@ -436,7 +455,7 @@ function _M.chooseArtifactRpc(agent, data)
436 local status = adv:chooseArtifact(msg.idx) 455 local status = adv:chooseArtifact(msg.idx)
437 if not status then return end 456 if not status then return end
438 adv:saveDB() 457 adv:saveDB()
439 - 458 +
440 SendPacket(actionCodes.Adv_chooseArtifactRpc, '') 459 SendPacket(actionCodes.Adv_chooseArtifactRpc, '')
441 return true 460 return true
442 end 461 end
@@ -497,6 +516,7 @@ function _M.exitAdvRpc(agent, data) @@ -497,6 +516,7 @@ function _M.exitAdvRpc(agent, data)
497 if not isCanContinue(role) then return end 516 if not isCanContinue(role) then return end
498 517
499 local adv = role:getAdvData() 518 local adv = role:getAdvData()
  519 + adv:log({desc = "exit"})
500 local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标 520 local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标
501 SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()})) 521 SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()}))
502 return true 522 return true
@@ -555,8 +575,9 @@ function _M.endBattleRpc(agent, data) @@ -555,8 +575,9 @@ function _M.endBattleRpc(agent, data)
555 if enemy.monsterId ~= monsterId or enemy.roomId ~= roomId or enemy.blockId ~= blockId then return end 575 if enemy.monsterId ~= monsterId or enemy.roomId ~= roomId or enemy.blockId ~= blockId then return end
556 adv.__battleCache = nil 576 adv.__battleCache = nil
557 577
558 - 578 + adv:log({desc = "endBattle"})
559 local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) 579 local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill})
  580 +
560 if not status then return end 581 if not status then return end
561 SendPacket(actionCodes.Adv_endBattleRpc, MsgPack.pack({events = adv:popBackEvents()})) 582 SendPacket(actionCodes.Adv_endBattleRpc, MsgPack.pack({events = adv:popBackEvents()}))
562 return true 583 return true
@@ -621,7 +642,7 @@ function _M.wheelSurfRpc(agent, data) @@ -621,7 +642,7 @@ function _M.wheelSurfRpc(agent, data)
621 end 642 end
622 643
623 if not role:checkItemEnough(costs) then return 5 end 644 if not role:checkItemEnough(costs) then return 5 end
624 - role:costItems(costs) 645 + role:costItems(costs, {log = {desc = "advWheelSurf", int1 = ptype}})
625 role:addAdvLvExp(costs[ItemId.OldCoin] or 0) 646 role:addAdvLvExp(costs[ItemId.OldCoin] or 0)
626 local advDrawB = role:getProperty("advDrawB") 647 local advDrawB = role:getProperty("advDrawB")
627 advDrawB[ptype] = (advDrawB[ptype] or 0) + count 648 advDrawB[ptype] = (advDrawB[ptype] or 0) + count
@@ -635,8 +656,11 @@ function _M.wheelSurfRpc(agent, data) @@ -635,8 +656,11 @@ function _M.wheelSurfRpc(agent, data)
635 reward[gift[1]] = (reward[gift[1]] or 0) + gift[2] 656 reward[gift[1]] = (reward[gift[1]] or 0) + gift[2]
636 table.insert(backReward, gift) 657 table.insert(backReward, gift)
637 end 658 end
638 - role:award(reward) 659 + role:award(reward, {log = {desc = "advWheelSurf", int1 = ptype}})
  660 +
639 role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype}) 661 role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype})
  662 + role:log("adv_action", {desc = "advWheelSurf", int1 = ptype, int2 = count})
  663 +
640 SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) 664 SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward}))
641 return true 665 return true
642 end 666 end
@@ -663,7 +687,8 @@ function _M.repayWheelSurfRpc(agent, data) @@ -663,7 +687,8 @@ function _M.repayWheelSurfRpc(agent, data)
663 role:updateProperty({field = "advDrawB", value = advDrawB}) 687 role:updateProperty({field = "advDrawB", value = advDrawB})
664 local gift = drawData["pool3"]:randWeight(true) 688 local gift = drawData["pool3"]:randWeight(true)
665 local reward = {[gift[1]] = gift[2]} 689 local reward = {[gift[1]] = gift[2]}
666 - reward = role:award(reward) 690 + reward = role:award(reward, {log = {desc = "advRepayWheelSurf", int1 = ptype}})
  691 + role:log("adv_action", {desc = "advRepayWheelSurf", int1 = ptype})
667 692
668 SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack({reward = reward})) 693 SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack({reward = reward}))
669 return true 694 return true
@@ -686,6 +711,8 @@ function _M.finishAchievRpc(agent, data) @@ -686,6 +711,8 @@ function _M.finishAchievRpc(agent, data)
686 end 711 end
687 if not status then return end 712 if not status then return end
688 adv:updateAchievement() 713 adv:updateAchievement()
  714 + role:log("adv_action", {desc = "finishAchiev", short1 = ctype, int1 = chapterId, int2 = taskId})
  715 +
689 SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack({reward = reward})) 716 SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack({reward = reward}))
690 return true 717 return true
691 end 718 end
@@ -737,10 +764,11 @@ function _M.refreshSupportRpc(agent, data) @@ -737,10 +764,11 @@ function _M.refreshSupportRpc(agent, data)
737 role.dailyData:updateProperty({field = "advSupRe", delta = 1}) 764 role.dailyData:updateProperty({field = "advSupRe", delta = 1})
738 else -- 付费 765 else -- 付费
739 if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}) then return end 766 if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}) then return end
740 - role:costItems({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}) 767 + role:costItems({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}, {log = {desc = "advReSupport"}})
741 end 768 end
742 769
743 role:advRandomSupportEffect() 770 role:advRandomSupportEffect()
  771 + role:log("adv_action", {desc = "advSupRe", short1 = cr < al and 0 or 1})
744 772
745 SendPacket(actionCodes.Adv_refreshSupportRpc, '') 773 SendPacket(actionCodes.Adv_refreshSupportRpc, '')
746 return true 774 return true
src/actions/CarAction.lua
@@ -35,10 +35,12 @@ function _M.makePotionRpc( agent, data ) @@ -35,10 +35,12 @@ function _M.makePotionRpc( agent, data )
35 return 5 35 return 5
36 end 36 end
37 37
38 - role:costItems(cost) 38 + role:costItems(cost, {log = {desc = "makePotion", int1 = potionId, int2 = count}})
39 potionBag[potionId] = own + count 39 potionBag[potionId] = own + count
40 role:updateProperty({field = "potionBag", value = potionBag}) 40 role:updateProperty({field = "potionBag", value = potionBag})
41 role:checkTaskEnter("PotionMake", {count = count, id = potionId}) 41 role:checkTaskEnter("PotionMake", {count = count, id = potionId})
  42 +
  43 + role:log("role_action", {desc = "makePotion", int1 = potionId, int2 = count})
42 SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag})) 44 SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag}))
43 return true 45 return true
44 end 46 end
@@ -84,10 +86,13 @@ function _M.equipUpRpc( agent, data ) @@ -84,10 +86,13 @@ function _M.equipUpRpc( agent, data )
84 return 4 86 return 4
85 end 87 end
86 88
87 - role:costItems(cost)  
88 - role:addEquip(typ, lv, -costCount)  
89 - role:addEquip(typ, nextLv ,count) 89 + role:costItems(cost, {log = {desc = "equipUp", int1 = id, int2 = count}})
  90 + role:addEquip(typ, lv, -costCount, {log = {desc = "equipUp"}})
  91 + role:addEquip(typ, nextLv ,count, {log = {desc = "equipUp"}})
90 role:checkTaskEnter("EquipUp", {count = count}) 92 role:checkTaskEnter("EquipUp", {count = count})
  93 +
  94 + role:log("role_action", {desc = "equipUp", int1 = id, int2 = count})
  95 +
91 SendPacket(actionCodes.Car_equipUpRpc, '') 96 SendPacket(actionCodes.Car_equipUpRpc, '')
92 return true 97 return true
93 end 98 end
@@ -117,9 +122,12 @@ function _M.runeUpRpc( agent, data ) @@ -117,9 +122,12 @@ function _M.runeUpRpc( agent, data )
117 return 7 122 return 7
118 end 123 end
119 124
120 - role:costItems(cost) 125 + role:costItems(cost, {log = {desc = "runeUp", int1 = uid, int2 = level}})
121 ownRune:updateProperty({field = "level",value = level+1}) 126 ownRune:updateProperty({field = "level",value = level+1})
122 role:checkTaskEnter("RuneUp") 127 role:checkTaskEnter("RuneUp")
  128 +
  129 + ownRune:log({desc = "runeUp", int1 = level + 1})
  130 +
123 SendPacket(actionCodes.Car_runeUpRpc, '') 131 SendPacket(actionCodes.Car_runeUpRpc, '')
124 return true 132 return true
125 end 133 end
@@ -143,7 +151,7 @@ function _M.saleEquipRpc(agent, data ) @@ -143,7 +151,7 @@ function _M.saleEquipRpc(agent, data )
143 local itemData = csvdb["itemCsv"][id] 151 local itemData = csvdb["itemCsv"][id]
144 local typ = math.floor((id-7000)/100) 152 local typ = math.floor((id-7000)/100)
145 local lv = (id-7000)%100 153 local lv = (id-7000)%100
146 - role:addEquip(typ, lv, -count) -- 删掉装备 154 + role:addEquip(typ, lv, -count, {log = {desc = "saleEquip"}}) -- 删掉装备
147 -- 发奖励 155 -- 发奖励
148 local one = itemData.sell_effect:toNumMap() 156 local one = itemData.sell_effect:toNumMap()
149 for k ,v in pairs(one) do 157 for k ,v in pairs(one) do
@@ -151,7 +159,10 @@ function _M.saleEquipRpc(agent, data ) @@ -151,7 +159,10 @@ function _M.saleEquipRpc(agent, data )
151 end 159 end
152 end 160 end
153 role:checkTaskEnter("SaleEquip", {count = allCount}) 161 role:checkTaskEnter("SaleEquip", {count = allCount})
154 - reward = role:award(reward) 162 + reward = role:award(reward, {log = {desc = "saleEquip"}})
  163 +
  164 + role:log("role_action", {desc = "saleEquip", int1 = allCount})
  165 +
155 SendPacket(actionCodes.Car_saleEquipRpc, MsgPack.pack({reward = reward})) 166 SendPacket(actionCodes.Car_saleEquipRpc, MsgPack.pack({reward = reward}))
156 return true 167 return true
157 end 168 end
@@ -177,10 +188,10 @@ function _M.saleRuneRpc(agent, data ) @@ -177,10 +188,10 @@ function _M.saleRuneRpc(agent, data )
177 end 188 end
178 end 189 end
179 190
180 - role:delRunes(backs) 191 + role:delRunes(backs, {log = {desc = "saleRune"}})
181 role:checkTaskEnter("DecoRune", {count = count}) 192 role:checkTaskEnter("DecoRune", {count = count})
182 - reward = role:award(reward)  
183 - 193 + reward = role:award(reward, {log = {desc = "saleRune"}})
  194 +
184 SendPacket(actionCodes.Car_saleRuneRpc, MsgPack.pack({reward = reward})) 195 SendPacket(actionCodes.Car_saleRuneRpc, MsgPack.pack({reward = reward}))
185 return true 196 return true
186 end 197 end
src/actions/DinerAction.lua
@@ -54,7 +54,7 @@ function _M.addSellRpc( agent, data ) @@ -54,7 +54,7 @@ function _M.addSellRpc( agent, data )
54 return 6 54 return 6
55 end 55 end
56 56
57 - role:costItems(cost) 57 + role:costItems(cost, {log = {desc = "addSell"}})
58 role.dinerData:updateSell(slot) 58 role.dinerData:updateSell(slot)
59 59
60 role:checkTaskEnter("MakeFood", {id = dish, count = count}) 60 role:checkTaskEnter("MakeFood", {id = dish, count = count})
@@ -105,6 +105,8 @@ function _M.addSellRpc( agent, data ) @@ -105,6 +105,8 @@ function _M.addSellRpc( agent, data )
105 role.dinerData:updateProperty({field = "customer", value = customer}) 105 role.dinerData:updateProperty({field = "customer", value = customer})
106 end 106 end
107 107
  108 + role:log("diner_action", {desc = "addSell", int1 = dish, int2 = count})
  109 +
108 role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) 110 role.dinerData:updateProperty({field = "sells", value = json.encode(sells)})
109 SendPacket(actionCodes.Diner_addSellRpc, "") 111 SendPacket(actionCodes.Diner_addSellRpc, "")
110 return true 112 return true
@@ -143,10 +145,13 @@ function _M.removeSellRpc( agent, data ) @@ -143,10 +145,13 @@ function _M.removeSellRpc( agent, data )
143 local cost = dishData.material:toNumMap() 145 local cost = dishData.material:toNumMap()
144 for k, n in pairs(cost) do 146 for k, n in pairs(cost) do
145 local sum = n*sell.count 147 local sum = n*sell.count
146 - role:addItem({itemId = k,count = sum})  
147 reward[k] = sum 148 reward[k] = sum
148 end 149 end
  150 + reward = role:award(reward, {log = {desc = "removeSell"}})
149 sells[slot].count = 0 151 sells[slot].count = 0
  152 +
  153 + role:log("diner_action", {desc = "removeSell", int1 = dish})
  154 +
150 role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) 155 role.dinerData:updateProperty({field = "sells", value = json.encode(sells)})
151 SendPacket(actionCodes.Diner_removeSellRpc, MsgPack.pack({reward = reward})) 156 SendPacket(actionCodes.Diner_removeSellRpc, MsgPack.pack({reward = reward}))
152 return true 157 return true
@@ -184,18 +189,23 @@ function _M.getSellRewardRpc( agent, data ) @@ -184,18 +189,23 @@ function _M.getSellRewardRpc( agent, data )
184 sells[slot].popular = 0 189 sells[slot].popular = 0
185 end 190 end
186 role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) 191 role.dinerData:updateProperty({field = "sells", value = json.encode(sells)})
187 - for k, v in pairs(reward:toNumMap()) do  
188 - role:addItem({itemId = k,count = v}) 192 + local gift = reward:toNumMap()
  193 + for k, v in pairs(gift) do
189 if k == ItemId.Gold then 194 if k == ItemId.Gold then
190 role:checkTaskEnter("FoodSellGold", {count = v}) 195 role:checkTaskEnter("FoodSellGold", {count = v})
191 end 196 end
192 end 197 end
  198 + role:award(gift, {log = {desc = "dinerSell"}})
  199 +
193 200
194 role.dinerData:popularAdd(popular) 201 role.dinerData:popularAdd(popular)
195 202
196 if dirty then 203 if dirty then
197 role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) 204 role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order"))
198 end 205 end
  206 +
  207 + role:log("diner_action", {desc = "sell"})
  208 +
199 SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward})) 209 SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward}))
200 return true 210 return true
201 end 211 end
@@ -213,7 +223,7 @@ function _M.expediteSellRpc( agent, data ) @@ -213,7 +223,7 @@ function _M.expediteSellRpc( agent, data )
213 if not role:checkItemEnough(cost) then 223 if not role:checkItemEnough(cost) then
214 return 2 224 return 2
215 end 225 end
216 - role:costItems(cost) 226 + role:costItems(cost, {log = {desc = "dinerSellQ"}})
217 end 227 end
218 228
219 local dirty = false 229 local dirty = false
@@ -250,12 +260,14 @@ function _M.expediteSellRpc( agent, data ) @@ -250,12 +260,14 @@ function _M.expediteSellRpc( agent, data )
250 role.dinerData:notifyUpdateProperty("sells", role.dinerData:getProperty("sells")) 260 role.dinerData:notifyUpdateProperty("sells", role.dinerData:getProperty("sells"))
251 role.dinerData:setProperty("expedite",count+1) 261 role.dinerData:setProperty("expedite",count+1)
252 role.dinerData:notifyUpdateProperty("expedite", count+1) 262 role.dinerData:notifyUpdateProperty("expedite", count+1)
253 - for k, v in pairs(reward:toNumMap()) do  
254 - role:addItem({itemId = k,count = v}) 263 + local gift = reward:toNumMap()
  264 + for k, v in pairs(gift) do
255 if k == ItemId.Gold then 265 if k == ItemId.Gold then
256 role:checkTaskEnter("FoodSellGold", {count = v}) 266 role:checkTaskEnter("FoodSellGold", {count = v})
257 end 267 end
258 end 268 end
  269 + role:award(gift, {log = {desc = "dinerSell"}})
  270 +
259 271
260 role.dinerData:popularAdd(popular) 272 role.dinerData:popularAdd(popular)
261 273
@@ -263,6 +275,9 @@ function _M.expediteSellRpc( agent, data ) @@ -263,6 +275,9 @@ function _M.expediteSellRpc( agent, data )
263 role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) 275 role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order"))
264 end 276 end
265 role:checkTaskEnter("FoodSellQuick") 277 role:checkTaskEnter("FoodSellQuick")
  278 +
  279 + role:log("diner_action", {desc = "sellQ"})
  280 +
266 SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward,popular = popular})) 281 SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward,popular = popular}))
267 return true 282 return true
268 end 283 end
@@ -298,9 +313,12 @@ function _M.levelUpRpc( agent, data ) @@ -298,9 +313,12 @@ function _M.levelUpRpc( agent, data )
298 return 313 return
299 end 314 end
300 315
301 - role:costItems(cost) 316 + role:costItems(cost, {log = {desc = "dinerBuildUp", int1 = index}})
302 role.dinerData:updateProperty({field = "buildL", value = buildL:setv(index, curLevel + 1)}) 317 role.dinerData:updateProperty({field = "buildL", value = buildL:setv(index, curLevel + 1)})
303 role:checkTaskEnter("DinerLevelUp", {type = index, level = curLevel + 1}) 318 role:checkTaskEnter("DinerLevelUp", {type = index, level = curLevel + 1})
  319 +
  320 + role:log("diner_action", {desc = "buildUp", int1 = index, int2 = curLevel + 1})
  321 +
304 SendPacket(actionCodes.Diner_levelUpRpc, '') 322 SendPacket(actionCodes.Diner_levelUpRpc, '')
305 return true 323 return true
306 end 324 end
@@ -374,7 +392,7 @@ function _M.talentUpRpc( agent, data ) @@ -374,7 +392,7 @@ function _M.talentUpRpc( agent, data )
374 -- if next(role:getProperty("advTeam")) then return 8 end 392 -- if next(role:getProperty("advTeam")) then return 8 end
375 -- end 393 -- end
376 394
377 - role:costItems(cost) 395 + role:costItems(cost, {log = {desc = "talentUp", int1 = dish, int2 = dishLevel + 1}})
378 role.dinerData:updateProperty({field = "dishTree", value = dishTree:setv(dish, dishLevel + 1)}) 396 role.dinerData:updateProperty({field = "dishTree", value = dishTree:setv(dish, dishLevel + 1)})
379 -- local treePoint = talentData.tree_point:toNumMap() 397 -- local treePoint = talentData.tree_point:toNumMap()
380 -- if next(treePoint) then 398 -- if next(treePoint) then
@@ -383,6 +401,8 @@ function _M.talentUpRpc( agent, data ) @@ -383,6 +401,8 @@ function _M.talentUpRpc( agent, data )
383 401
384 role:checkTaskEnter("DinerTalentUp", {type = talentData.effect:toArray(true,"=")[1]}) 402 role:checkTaskEnter("DinerTalentUp", {type = talentData.effect:toArray(true,"=")[1]})
385 403
  404 + role:log("diner_action", {desc = "talentUp", int1 = dish, int2 = dishLevel + 1})
  405 +
386 SendPacket(actionCodes.Diner_talentUpRpc, '') 406 SendPacket(actionCodes.Diner_talentUpRpc, '')
387 return true 407 return true
388 end 408 end
@@ -414,8 +434,9 @@ function _M.skillUpRpc( agent, data ) @@ -414,8 +434,9 @@ function _M.skillUpRpc( agent, data )
414 return 434 return
415 end 435 end
416 436
417 - role:costItems(cost) 437 + role:costItems(cost, {log = {desc = "dinerSkillUp", int1 = skill, int2 = skillLevel + 1}})
418 role.dinerData:updateProperty({field = "skillTree", value = skillTree:setv(skill, skillLevel + 1)}) 438 role.dinerData:updateProperty({field = "skillTree", value = skillTree:setv(skill, skillLevel + 1)})
  439 + role:log("diner_action", {desc = "skillUp", int1 = skill, int2 = skillLevel + 1})
419 440
420 SendPacket(actionCodes.Diner_skillUpRpc, '') 441 SendPacket(actionCodes.Diner_skillUpRpc, '')
421 return true 442 return true
@@ -442,6 +463,9 @@ function _M.lockTaskRpc( agent, data ) @@ -442,6 +463,9 @@ function _M.lockTaskRpc( agent, data )
442 order.lock = 0 463 order.lock = 0
443 end 464 end
444 role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) 465 role.dinerData:updateProperty({field = "order", value = json.encode(orders)})
  466 +
  467 + role:log("diner_action", {desc = "lockTask", int1 = order.id})
  468 +
445 SendPacket(actionCodes.Diner_lockTaskRpc, MsgPack.pack({lock = order.lock})) 469 SendPacket(actionCodes.Diner_lockTaskRpc, MsgPack.pack({lock = order.lock}))
446 return true 470 return true
447 end 471 end
@@ -477,6 +501,9 @@ function _M.updateTaskRpc( agent, data ) @@ -477,6 +501,9 @@ function _M.updateTaskRpc( agent, data )
477 end 501 end
478 orders[index].status = 1 502 orders[index].status = 1
479 orders[index].lock = 1 503 orders[index].lock = 1
  504 +
  505 + role:log("diner_action", {desc = "getTask", int1 = order.id})
  506 +
480 role:checkTaskEnter("GetOderTask", {rarity = taskSet.rarity}) 507 role:checkTaskEnter("GetOderTask", {rarity = taskSet.rarity})
481 elseif cmd == 1 then 508 elseif cmd == 1 then
482 if order.status ~= 1 then 509 if order.status ~= 1 then
@@ -484,6 +511,9 @@ function _M.updateTaskRpc( agent, data ) @@ -484,6 +511,9 @@ function _M.updateTaskRpc( agent, data )
484 end 511 end
485 orders[index].status = 0 512 orders[index].status = 0
486 orders[index].lock = 0 513 orders[index].lock = 0
  514 +
  515 + role:log("diner_action", {desc = "deleteTask", int1 = order.id})
  516 +
487 elseif cmd == 2 then 517 elseif cmd == 2 then
488 if order.status ~= 1 then 518 if order.status ~= 1 then
489 return 32 519 return 32
@@ -491,9 +521,9 @@ function _M.updateTaskRpc( agent, data ) @@ -491,9 +521,9 @@ function _M.updateTaskRpc( agent, data )
491 if order.n < taskData.value then 521 if order.n < taskData.value then
492 return 6 522 return 6
493 end 523 end
494 - for typ, count in pairs(taskData.reward:toNumMap()) do  
495 - role:addItem({itemId = typ, count = count})  
496 - end 524 + role:log("diner_action", {desc = "finishTask", int1 = order.id})
  525 +
  526 + role:award(taskData.reward, {log = {desc = "dinerFinishTask", int1 = order.id}})
497 table.remove(orders,index) 527 table.remove(orders,index)
498 role:checkTaskEnter("OverOderTask", {rarity = taskSet.rarity}) 528 role:checkTaskEnter("OverOderTask", {rarity = taskSet.rarity})
499 else 529 else
@@ -550,7 +580,7 @@ function _M.refreshTaskRpc( agent, data ) @@ -550,7 +580,7 @@ function _M.refreshTaskRpc( agent, data )
550 end 580 end
551 if not role:checkItemEnough(cost) then return end 581 if not role:checkItemEnough(cost) then return end
552 582
553 - role:costItems(cost) 583 + role:costItems(cost, {log = {desc = "dinerReTask"}})
554 584
555 585
556 for idx, order in ipairs(orders) do 586 for idx, order in ipairs(orders) do
@@ -565,6 +595,8 @@ function _M.refreshTaskRpc( agent, data ) @@ -565,6 +595,8 @@ function _M.refreshTaskRpc( agent, data )
565 end 595 end
566 end 596 end
567 597
  598 + role:log("diner_action", {desc = "reTask"})
  599 +
568 role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) 600 role.dinerData:updateProperty({field = "order", value = json.encode(orders)})
569 601
570 SendPacket(actionCodes.Diner_refreshTaskRpc, '') 602 SendPacket(actionCodes.Diner_refreshTaskRpc, '')
@@ -605,6 +637,8 @@ function _M.addWantFoodRpc(agent , data) @@ -605,6 +637,8 @@ function _M.addWantFoodRpc(agent , data)
605 gfood[slot] = {id = itemId, st = skynet.timex()} 637 gfood[slot] = {id = itemId, st = skynet.timex()}
606 end 638 end
607 639
  640 + role:log("diner_action", {desc = "wantFood"})
  641 +
608 role.dinerData:updateProperty({field = "gfood", value = gfood}) 642 role.dinerData:updateProperty({field = "gfood", value = gfood})
609 643
610 SendPacket(actionCodes.Diner_addWantFoodRpc, '') 644 SendPacket(actionCodes.Diner_addWantFoodRpc, '')
@@ -640,8 +674,11 @@ function _M.getGreenhouseRpc( agent, data ) @@ -640,8 +674,11 @@ function _M.getGreenhouseRpc( agent, data )
640 end 674 end
641 end 675 end
642 role.dinerData:updateProperty({field = "gfood", value = gfood}) 676 role.dinerData:updateProperty({field = "gfood", value = gfood})
643 - local reward = role:award(reward) 677 + local reward = role:award(reward, {log = {desc = "greenHourse"}})
644 role:checkTaskEnter("FoodMGet") 678 role:checkTaskEnter("FoodMGet")
  679 +
  680 + role:log("diner_action", {desc = "greenHourse"})
  681 +
645 SendPacket(actionCodes.Diner_getGreenhouseRpc, MsgPack.pack({reward = reward})) 682 SendPacket(actionCodes.Diner_getGreenhouseRpc, MsgPack.pack({reward = reward}))
646 return true 683 return true
647 end 684 end
@@ -751,24 +788,25 @@ function _M.entrustRpc(agent , data) @@ -751,24 +788,25 @@ function _M.entrustRpc(agent , data)
751 local ctype = msg.ctype 788 local ctype = msg.ctype
752 789
753 local entrust = role.dinerData:getProperty("entrust") 790 local entrust = role.dinerData:getProperty("entrust")
754 - if not entrust[1] then return end 791 + local entrustId = entrust[1]
  792 + if not entrustId then return end
755 793
756 local reward 794 local reward
757 if ctype == 1 then -- 完成 795 if ctype == 1 then -- 完成
758 - local curData = csvdb["diner_missionCsv"][entrust[1]] 796 + local curData = csvdb["diner_missionCsv"][entrustId]
759 if not curData then return end 797 if not curData then return end
760 798
761 if curData.type == 1 then 799 if curData.type == 1 then
762 local cost = curData.condition:toNumMap() 800 local cost = curData.condition:toNumMap()
763 if not role:checkItemEnough(cost) then return end 801 if not role:checkItemEnough(cost) then return end
764 - role:costItems(cost) 802 + role:costItems(cost, {log = {desc = "dinerEntrus", int1 = entrustId}})
765 elseif curData.type == 2 then 803 elseif curData.type == 2 then
766 -- todo 数据校验 804 -- todo 数据校验
767 else 805 else
768 return 806 return
769 end 807 end
770 808
771 - reward = role:award(curData.reward) 809 + reward = role:award(curData.reward, {log = {desc = "dinerEntrus", int1 = entrustId}})
772 table.remove(entrust, 1) 810 table.remove(entrust, 1)
773 elseif ctype == 2 then -- 放弃 811 elseif ctype == 2 then -- 放弃
774 table.remove(entrust, 1) 812 table.remove(entrust, 1)
@@ -777,6 +815,8 @@ function _M.entrustRpc(agent , data) @@ -777,6 +815,8 @@ function _M.entrustRpc(agent , data)
777 end 815 end
778 role.dinerData:updateProperty({field = "entrust", value = entrust}) 816 role.dinerData:updateProperty({field = "entrust", value = entrust})
779 817
  818 + role:log("diner_action", {desc = "entrus", short1 = ctype, int1 = entrustId})
  819 +
780 SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward})) 820 SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward}))
781 return true 821 return true
782 end 822 end
@@ -798,9 +838,10 @@ function _M.collectRpc(agent , data) @@ -798,9 +838,10 @@ function _M.collectRpc(agent , data)
798 for slot, _ in pairs(sells) do 838 for slot, _ in pairs(sells) do
799 role.dinerData:updateSell(slot) 839 role.dinerData:updateSell(slot)
800 end 840 end
801 - local reward = role:award(customerData.reward) 841 + local reward = role:award(customerData.reward, {log = {desc = "dinerCollect", int1 = id}})
802 customer[id] = 1 842 customer[id] = 1
803 role.dinerData:updateProperty({field = "customer", value = customer}) -- 解锁了 843 role.dinerData:updateProperty({field = "customer", value = customer}) -- 解锁了
  844 + role:log("diner_action", {desc = "collect", int1 = id})
804 845
805 SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward})) 846 SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward}))
806 return true 847 return true
@@ -826,10 +867,12 @@ function _M.comboRewardRpc(agent , data) @@ -826,10 +867,12 @@ function _M.comboRewardRpc(agent , data)
826 end 867 end
827 868
828 comboStatus[id] = 1 869 comboStatus[id] = 1
829 - local reward = role:award(comboData.reward) 870 + local reward = role:award(comboData.reward, {log = {desc = "dinerCombo", int1 = id}})
830 871
831 role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 872 role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了
832 873
  874 + role:log("diner_action", {desc = "combo", int1 = id})
  875 +
833 SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward})) 876 SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward}))
834 return true 877 return true
835 end 878 end
src/actions/EmailAction.lua
@@ -53,7 +53,7 @@ function _M.listRpc(agent, data) @@ -53,7 +53,7 @@ function _M.listRpc(agent, data)
53 content = email.content, 53 content = email.content,
54 attachments = email.attachments 54 attachments = email.attachments
55 }) 55 })
56 - role:log("mail_actions", {desc = "get_global", key1 = email.title, key2 = email.attachments}) 56 + role:log("mail_action", {desc = "get_global", key1 = email.title, key2 = email.attachments})
57 end 57 end
58 end 58 end
59 end 59 end
@@ -95,10 +95,10 @@ function _M.drawAllAttachRpc(agent, data) @@ -95,10 +95,10 @@ function _M.drawAllAttachRpc(agent, data)
95 local attachments = getEmailAttachments(email) 95 local attachments = getEmailAttachments(email)
96 if attachments ~= "" then 96 if attachments ~= "" then
97 local emailId = email:getProperty("id") 97 local emailId = email:getProperty("id")
98 - local items = role:award(attachments) 98 + local items = role:award(attachments, {log = {desc = "draw_attach", int1 = emailId, key1 = email:getProperty("title")}})
99 ids[emailId] = 1 99 ids[emailId] = 1
100 red:hset(string.format(R_EMAIL_ITEM, roleId, emailId), "status", 2) 100 red:hset(string.format(R_EMAIL_ITEM, roleId, emailId), "status", 2)
101 - role:log("mail_actions", {desc = "draw_attach", int1 = emailId, key1 = email:getProperty("title"), key2 = attachments}) 101 + role:log("mail_action", {desc = "draw_attach", int1 = emailId, key1 = email:getProperty("title"), key2 = attachments})
102 102
103 for key, v in pairs(items) do 103 for key, v in pairs(items) do
104 reward[key] = (reward[key] or 0) + v 104 reward[key] = (reward[key] or 0) + v
@@ -125,11 +125,11 @@ function _M.drawAttachRpc(agent, data) @@ -125,11 +125,11 @@ function _M.drawAttachRpc(agent, data)
125 local attachments = getEmailAttachments(email) 125 local attachments = getEmailAttachments(email)
126 if attachments == "" then return end 126 if attachments == "" then return end
127 127
128 - local reward = role:award(attachments) 128 + local reward = role:award(attachments, {log = {desc = "draw_attach", int1 = emailId, key1 = email:getProperty("title")}})
129 redisproxy:hset(rds, "status", 2) -- 领取标记 129 redisproxy:hset(rds, "status", 2) -- 领取标记
130 SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward})) 130 SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward}))
131 131
132 - role:log("mail_actions", {desc = "draw_attach", int1 = id, key1 = email:getProperty("title"), key2 = attachments}) 132 + role:log("mail_action", {desc = "draw_attach", int1 = id, key1 = email:getProperty("title"), key2 = attachments})
133 return true 133 return true
134 end 134 end
135 135
@@ -144,7 +144,7 @@ function _M.checkRpc(agent, data) @@ -144,7 +144,7 @@ function _M.checkRpc(agent, data)
144 if not redisproxy:exists(rds) then return end 144 if not redisproxy:exists(rds) then return end
145 145
146 redisproxy:hset(rds, "status", 1) 146 redisproxy:hset(rds, "status", 1)
147 - role:log("mail_actions", {desc = "check_mail", int1 = id}) 147 + role:log("mail_action", {desc = "check_mail", int1 = id})
148 148
149 SendPacket(actionCodes.Email_checkRpc, '') 149 SendPacket(actionCodes.Email_checkRpc, '')
150 return true 150 return true
@@ -180,7 +180,7 @@ function _M.delRpc(agent, data) @@ -180,7 +180,7 @@ function _M.delRpc(agent, data)
180 end 180 end
181 end) 181 end)
182 for delId, _ in ipairs(result) do 182 for delId, _ in ipairs(result) do
183 - role:log("mail_actions", {desc = "del_mail", int1 = delId}) 183 + role:log("mail_action", {desc = "del_mail", int1 = delId})
184 end 184 end
185 SendPacket(actionCodes.Email_delRpc, MsgPack.pack({result = result})) 185 SendPacket(actionCodes.Email_delRpc, MsgPack.pack({result = result}))
186 return true 186 return true
src/actions/FriendAction.lua
@@ -110,6 +110,8 @@ function _M.searchRpc(agent, data) @@ -110,6 +110,8 @@ function _M.searchRpc(agent, data)
110 110
111 })) 111 }))
112 end 112 end
  113 +
  114 + role:log("role_action", {desc = "searchFriend"})
113 SendPacket(actionCodes.Friend_searchRpc, MsgPack.pack({searchList = searchList})) 115 SendPacket(actionCodes.Friend_searchRpc, MsgPack.pack({searchList = searchList}))
114 return true 116 return true
115 end 117 end
@@ -175,8 +177,14 @@ function _M.applyRpc(agent, data) @@ -175,8 +177,14 @@ function _M.applyRpc(agent, data)
175 myInfo.roleId = roleId 177 myInfo.roleId = roleId
176 myInfo.online = true 178 myInfo.online = true
177 myInfo.hadApply = true 179 myInfo.hadApply = true
  180 +
  181 + role:log("role_action", {desc = "addFriend", int1 = 1})
  182 +
178 rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方 183 rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方
179 end 184 end
  185 +
  186 +
  187 +
180 SendPacket(actionCodes.Friend_applyRpc, MsgPack.pack({result = result})) 188 SendPacket(actionCodes.Friend_applyRpc, MsgPack.pack({result = result}))
181 return true 189 return true
182 end 190 end
@@ -268,6 +276,9 @@ function _M.handleApplyRpc(agent, data) @@ -268,6 +276,9 @@ function _M.handleApplyRpc(agent, data)
268 otherInfo.isFriend = true 276 otherInfo.isFriend = true
269 otherInfo.pGet = redret[2] == 1 and 1 or nil 277 otherInfo.pGet = redret[2] == 1 and 1 or nil
270 SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {otherInfo}})) 278 SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {otherInfo}}))
  279 +
  280 + role:log("role_action", {desc = "addFriend", int1 = 1})
  281 +
271 end 282 end
272 283
273 elseif cmd == 0 then -- 不同意 284 elseif cmd == 0 then -- 不同意
@@ -322,6 +333,8 @@ function _M.handleApplyRpc(agent, data) @@ -322,6 +333,8 @@ function _M.handleApplyRpc(agent, data)
322 rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {myInfo}})) -- 通知对方 333 rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {myInfo}})) -- 通知对方
323 end 334 end
324 if next(needAdd) then 335 if next(needAdd) then
  336 + role:log("role_action", {desc = "addFriend", int1 = #needAdd})
  337 +
325 SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = needAddInfo})) 338 SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = needAddInfo}))
326 else 339 else
327 result = 1 340 result = 1
@@ -520,6 +533,8 @@ function _M.pointRpc(agent, data) @@ -520,6 +533,8 @@ function _M.pointRpc(agent, data)
520 role.dailyData:updateProperty({field = "giveFP", value = giveP}) 533 role.dailyData:updateProperty({field = "giveFP", value = giveP})
521 role:checkTaskEnter("GiveFriendP", {count = 1}) 534 role:checkTaskEnter("GiveFriendP", {count = 1})
522 rpcRole(objId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newPoint = 1, roleId = roleId})) 535 rpcRole(objId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newPoint = 1, roleId = roleId}))
  536 +
  537 + role:log("role_action", {desc = "giveFPoint", int1 = 1})
523 end 538 end
524 elseif cmd == 2 then -- 领取 539 elseif cmd == 2 then -- 领取
525 local objId = msg.roleId 540 local objId = msg.roleId
@@ -535,9 +550,11 @@ function _M.pointRpc(agent, data) @@ -535,9 +550,11 @@ function _M.pointRpc(agent, data)
535 end 550 end
536 if not result then 551 if not result then
537 getP[objId] = 1 552 getP[objId] = 1
538 - reward = role:award({[ItemId.FriendPoint] = 1}) 553 + reward = role:award({[ItemId.FriendPoint] = 1}, {log = {desc = "friendPoint"}})
539 role.dailyData:updateProperty({field = "getFP", value = getP}) 554 role.dailyData:updateProperty({field = "getFP", value = getP})
540 role:checkTaskEnter("GetFriendP", {count = 1}) 555 role:checkTaskEnter("GetFriendP", {count = 1})
  556 +
  557 + role:log("role_action", {desc = "getFPoint", int1 = 1})
541 end 558 end
542 elseif cmd == 3 then -- 一键赠送领取 559 elseif cmd == 3 then -- 一键赠送领取
543 -- 赠送 560 -- 赠送
@@ -558,6 +575,9 @@ function _M.pointRpc(agent, data) @@ -558,6 +575,9 @@ function _M.pointRpc(agent, data)
558 if change > 0 then 575 if change > 0 then
559 role.dailyData:updateProperty({field = "giveFP", value = giveP}) 576 role.dailyData:updateProperty({field = "giveFP", value = giveP})
560 role:checkTaskEnter("GiveFriendP", {count = change}) 577 role:checkTaskEnter("GiveFriendP", {count = change})
  578 +
  579 + role:log("role_action", {desc = "giveFPoint", int1 = change})
  580 +
561 else 581 else
562 result = 1 582 result = 1
563 end 583 end
@@ -579,9 +599,10 @@ function _M.pointRpc(agent, data) @@ -579,9 +599,10 @@ function _M.pointRpc(agent, data)
579 end 599 end
580 end 600 end
581 if getCount > 0 then 601 if getCount > 0 then
582 - reward = role:award({[ItemId.FriendPoint] = getCount}) 602 + reward = role:award({[ItemId.FriendPoint] = getCount}, {log = {desc = "friendPoint"}})
583 role.dailyData:updateProperty({field = "getFP", value = getP}) 603 role.dailyData:updateProperty({field = "getFP", value = getP})
584 role:checkTaskEnter("GetFriendP", {count = getCount}) 604 role:checkTaskEnter("GetFriendP", {count = getCount})
  605 + role:log("role_action", {desc = "getFPoint", int1 = getCount})
585 else 606 else
586 result = (result or 0) + 2 607 result = (result or 0) + 2
587 end 608 end
src/actions/GmAction.lua
@@ -19,14 +19,15 @@ function _M.testhotfix(role, pms) @@ -19,14 +19,15 @@ function _M.testhotfix(role, pms)
19 return csvdb["itemCsv"][1]["name"] .. " -=- " .. csvdb["itemCsv"][2]["name"] .. " -=- " .. role:getItemCount(123) .. " -=- " .. table.pack(next(role.heros))[2]:getBattleValue() 19 return csvdb["itemCsv"][1]["name"] .. " -=- " .. csvdb["itemCsv"][2]["name"] .. " -=- " .. role:getItemCount(123) .. " -=- " .. table.pack(next(role.heros))[2]:getBattleValue()
20 end 20 end
21 21
22 -function _M.ignoreout(role, params)  
23 - params = params or {}  
24 - local status = tonum(params.pm1, 1) 22 +function _M.ignoreout(role, pms)
  23 + pms = pms or {}
  24 + local status = tonum(pms.pm1, 1)
25 if status == 1 then -- 忽视 25 if status == 1 then -- 忽视
26 role:updateProperty({field = "ignoreMt", value = 1}) 26 role:updateProperty({field = "ignoreMt", value = 1})
27 else -- 解除 27 else -- 解除
28 role:updateProperty({field = "ignoreMt", value = 0}) 28 role:updateProperty({field = "ignoreMt", value = 0})
29 end 29 end
  30 + role:log("gm_action", {desc = "ignoreout", key1 = pms.sender})
30 return "指令生效" 31 return "指令生效"
31 end 32 end
32 33
@@ -46,11 +47,17 @@ function _M.ban(role, pms) @@ -46,11 +47,17 @@ function _M.ban(role, pms)
46 end) 47 end)
47 end 48 end
48 end 49 end
  50 +
  51 + role:log("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender})
  52 +
49 return isBan and "解封杀成功" or "封杀成功" 53 return isBan and "解封杀成功" or "封杀成功"
50 end 54 end
51 55
52 function _M.unban(role, pms) 56 function _M.unban(role, pms)
53 role:setBan(0, 0) 57 role:setBan(0, 0)
  58 +
  59 + role:log("gm_action", {desc = "unban", key1 = pms.sender})
  60 +
54 return "解封杀成功" 61 return "解封杀成功"
55 end 62 end
56 63
@@ -63,6 +70,7 @@ function _M.gmmsg(role, pms) @@ -63,6 +70,7 @@ function _M.gmmsg(role, pms)
63 skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd) 70 skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd)
64 end) 71 end)
65 end 72 end
  73 + role:log("gm_action", {desc = "gmmsg", text1 = pms.pm1, key1 = pms.sender})
66 74
67 return "指令成功" 75 return "指令成功"
68 end 76 end
@@ -74,6 +82,8 @@ function _M.silent(role, pms) @@ -74,6 +82,8 @@ function _M.silent(role, pms)
74 return "解禁言成功" 82 return "解禁言成功"
75 end 83 end
76 role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400}) 84 role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400})
  85 +
  86 + role:log("gm_action", {desc = "silent", int1 = pms.pm1, key1 = pms.sender})
77 return "禁言成功" 87 return "禁言成功"
78 end 88 end
79 89
@@ -83,9 +93,11 @@ local helpDes = {{&quot;描述&quot;, &quot;指令&quot;, &quot;参数1&quot;, &quot;参数2&quot; ,&quot;参数3&quot;}} @@ -83,9 +93,11 @@ local helpDes = {{&quot;描述&quot;, &quot;指令&quot;, &quot;参数1&quot;, &quot;参数2&quot; ,&quot;参数3&quot;}}
83 table.insert(helpDes, {"获得角色" , "hero", "角色类型"}) 93 table.insert(helpDes, {"获得角色" , "hero", "角色类型"})
84 function _M.hero(role, pms) 94 function _M.hero(role, pms)
85 local heroType = tonum(pms.pm1) 95 local heroType = tonum(pms.pm1)
86 - if not role:addHero({type = heroType}) then 96 + if not role:addHero({type = heroType, log = {desc = "gm"}}) then
87 return "失败" 97 return "失败"
88 end 98 end
  99 +
  100 + role:log("gm_action", {desc = "hero", int1 = heroType, key1 = pms.sender})
89 return "成功" 101 return "成功"
90 end 102 end
91 103
@@ -117,6 +129,9 @@ function _M.herol(role, pms) @@ -117,6 +129,9 @@ function _M.herol(role, pms)
117 addLevel = math.min(hero:getMaxLevel() - hero:getProperty("level"), addLevel) 129 addLevel = math.min(hero:getMaxLevel() - hero:getProperty("level"), addLevel)
118 hero:updateProperty({field = "level", delta = addLevel}) 130 hero:updateProperty({field = "level", delta = addLevel})
119 role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) 131 role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")})
  132 +
  133 + role:log("gm_action", {desc = "herol", int1 = heroType, int2 = addLevel, key1 = pms.sender})
  134 +
120 return "成功" 135 return "成功"
121 end 136 end
122 137
@@ -127,6 +142,9 @@ function _M.herola(role, pms) @@ -127,6 +142,9 @@ function _M.herola(role, pms)
127 for _, hero in pairs(role.heros) do 142 for _, hero in pairs(role.heros) do
128 _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel}) 143 _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel})
129 end 144 end
  145 +
  146 + role:log("gm_action", {desc = "herola", int1 = addLevel, key1 = pms.sender})
  147 +
130 return "成功" 148 return "成功"
131 end 149 end
132 150
@@ -136,7 +154,8 @@ function _M.equip(role, pms) @@ -136,7 +154,8 @@ function _M.equip(role, pms)
136 local typ = tonum(pms.pm1) 154 local typ = tonum(pms.pm1)
137 local level = tonum(pms.pm2) 155 local level = tonum(pms.pm2)
138 local count = tonum(pms.pm3) 156 local count = tonum(pms.pm3)
139 - role:addEquip({type = typ,level = level,count = count}) 157 + role:addEquip(typ, level, count, {log = {desc = "gm"}})
  158 + role:log("gm_action", {desc = "equip", int1 = typ, int2 = level, long1 = count, key1 = pms.sender})
140 return "成功" 159 return "成功"
141 end 160 end
142 161
@@ -144,7 +163,9 @@ table.insert(helpDes, {&quot;获得零件&quot; , &quot;rune&quot;, &quot;零件类型&quot;, &quot;零件id&quot;}) @@ -144,7 +163,9 @@ table.insert(helpDes, {&quot;获得零件&quot; , &quot;rune&quot;, &quot;零件类型&quot;, &quot;零件id&quot;})
144 function _M.rune(role, pms) 163 function _M.rune(role, pms)
145 local typ = tonum(pms.pm1) 164 local typ = tonum(pms.pm1)
146 local id = tonum(pms.pm2) 165 local id = tonum(pms.pm2)
147 - local result = role:addRune({type = typ,id = id}) 166 + local result = role:addRune({type = typ,id = id, log = {desc = "gm"}})
  167 + role:log("gm_action", {desc = "rune", int1 = typ, int2 = id, key1 = pms.sender})
  168 +
148 return result 169 return result
149 end 170 end
150 171
@@ -165,6 +186,9 @@ function _M.fb(role, pms) -- 直接通关 @@ -165,6 +186,9 @@ function _M.fb(role, pms) -- 直接通关
165 passCarbon[carbonId] = 1 186 passCarbon[carbonId] = 1
166 addPre(carbonId) 187 addPre(carbonId)
167 role:updateProperty({field = "hangPass", value = passCarbon}) 188 role:updateProperty({field = "hangPass", value = passCarbon})
  189 +
  190 + role:log("gm_action", {desc = "fb", int1 = carbonId, key1 = pms.sender})
  191 +
168 role:checkTaskEnter("HangPass", {id = carbonId}) 192 role:checkTaskEnter("HangPass", {id = carbonId})
169 return "成功" 193 return "成功"
170 end 194 end
@@ -187,6 +211,9 @@ function _M.fbc(role, pms) -- 直接通关 @@ -187,6 +211,9 @@ function _M.fbc(role, pms) -- 直接通关
187 role:updateProperty({field = "hangInfo", value = {}}) 211 role:updateProperty({field = "hangInfo", value = {}})
188 role:updateProperty({field = "hangPass", value = passCarbon}) 212 role:updateProperty({field = "hangPass", value = passCarbon})
189 role:checkTaskEnter("HangPass", {id = carbonId}) 213 role:checkTaskEnter("HangPass", {id = carbonId})
  214 +
  215 + role:log("gm_action", {desc = "fbc", int1 = carbonId, key1 = pms.sender})
  216 +
190 return "成功" 217 return "成功"
191 end 218 end
192 219
@@ -217,7 +244,10 @@ table.insert(helpDes, {&quot;玩家经验&quot;, &quot;exp&quot;, &quot;经验&quot;}) @@ -217,7 +244,10 @@ table.insert(helpDes, {&quot;玩家经验&quot;, &quot;exp&quot;, &quot;经验&quot;})
217 function _M.exp(role, pms) 244 function _M.exp(role, pms)
218 local exp = tonum(pms.pm1) 245 local exp = tonum(pms.pm1)
219 exp = math.floor(math.max(exp, 0)) 246 exp = math.floor(math.max(exp, 0))
220 - role:addPlayExp(exp) 247 + role:addPlayExp(exp, {log = {desc = "gm"}})
  248 +
  249 + role:log("gm_action", {desc = "exp", int1 = exp, key1 = pms.sender})
  250 +
221 return "成功" 251 return "成功"
222 end 252 end
223 253
@@ -236,35 +266,35 @@ function _M.get(role, pms) @@ -236,35 +266,35 @@ function _M.get(role, pms)
236 reward[id] = data.number 266 reward[id] = data.number
237 end 267 end
238 end 268 end
239 - role:award(reward) 269 + role:award(reward, {log = {desc = "gm"}})
240 elseif pms.pm1 == "EQUIP" then 270 elseif pms.pm1 == "EQUIP" then
241 for itemId = 7000 , 8000 do 271 for itemId = 7000 , 8000 do
242 if csvdb["itemCsv"][itemId] then 272 if csvdb["itemCsv"][itemId] then
243 - role:award({[itemId] = 100}) 273 + role:award({[itemId] = 100}, {log = {desc = "gm"}})
244 end 274 end
245 end 275 end
246 elseif pms.pm1 == "RUNE" then 276 elseif pms.pm1 == "RUNE" then
247 for itemId = 2000 , 3000 do 277 for itemId = 2000 , 3000 do
248 if csvdb["itemCsv"][itemId] then 278 if csvdb["itemCsv"][itemId] then
249 - role:award({[itemId] = 1}) 279 + role:award({[itemId] = 1}, {log = {desc = "gm"}})
250 end 280 end
251 end 281 end
252 elseif pms.pm1 == "FRAG" then 282 elseif pms.pm1 == "FRAG" then
253 for itemId = 100 , 400 do 283 for itemId = 100 , 400 do
254 if csvdb["itemCsv"][itemId] then 284 if csvdb["itemCsv"][itemId] then
255 - role:award({[itemId] = 100}) 285 + role:award({[itemId] = 100}, {log = {desc = "gm"}})
256 end 286 end
257 end 287 end
258 elseif pms.pm1 == "FOOD" then 288 elseif pms.pm1 == "FOOD" then
259 for itemId = 4000 , 5000 do 289 for itemId = 4000 , 5000 do
260 if csvdb["itemCsv"][itemId] then 290 if csvdb["itemCsv"][itemId] then
261 - role:award({[itemId] = 100}) 291 + role:award({[itemId] = 100}, {log = {desc = "gm"}})
262 end 292 end
263 end 293 end
264 elseif pms.pm1 == "HERO" then 294 elseif pms.pm1 == "HERO" then
265 for itemId = 400 , 700 do 295 for itemId = 400 , 700 do
266 if csvdb["itemCsv"][itemId] then 296 if csvdb["itemCsv"][itemId] then
267 - role:award({[itemId] = 1}) 297 + role:award({[itemId] = 1}, {log = {desc = "gm"}})
268 end 298 end
269 end 299 end
270 else 300 else
@@ -273,7 +303,8 @@ function _M.get(role, pms) @@ -273,7 +303,8 @@ function _M.get(role, pms)
273 return "物品不存在" 303 return "物品不存在"
274 end 304 end
275 local count = tonum(pms.pm2, 1) 305 local count = tonum(pms.pm2, 1)
276 - role:award({[itemId] = count}) 306 + role:award({[itemId] = count}, {log = {desc = "gm"}})
  307 + role:log("gm_action", {desc = "get", int1 = itemId, int2 = count, key1 = pms.sender})
277 end 308 end
278 return "成功" 309 return "成功"
279 end 310 end
@@ -287,7 +318,7 @@ function _M.advc(role, pms) @@ -287,7 +318,7 @@ function _M.advc(role, pms)
287 for itemId, count in pairs(reward) do 318 for itemId, count in pairs(reward) do
288 reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 319 reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败
289 end 320 end
290 - role:award(reward) 321 + role:award(reward, {log = {desc = "gm"}})
291 322
292 role:updateProperties({ 323 role:updateProperties({
293 advInfo = {}, 324 advInfo = {},
@@ -297,6 +328,9 @@ function _M.advc(role, pms) @@ -297,6 +328,9 @@ function _M.advc(role, pms)
297 advAFWear = {}, 328 advAFWear = {},
298 }, notNotify) 329 }, notNotify)
299 role.advData = nil 330 role.advData = nil
  331 +
  332 + role:log("gm_action", {desc = "advc", key1 = pms.sender})
  333 +
300 return "成功" 334 return "成功"
301 end 335 end
302 336
@@ -304,6 +338,9 @@ table.insert(helpDes, {&quot;冒险次数恢复&quot;, &quot;advf&quot;}) @@ -304,6 +338,9 @@ table.insert(helpDes, {&quot;冒险次数恢复&quot;, &quot;advf&quot;})
304 function _M.advf(role, pms) 338 function _M.advf(role, pms)
305 role.dailyData:updateProperty({field = "advC", value = 0}) 339 role.dailyData:updateProperty({field = "advC", value = 0})
306 role.dailyData:updateProperty({field = "advElC", value = 0}) 340 role.dailyData:updateProperty({field = "advElC", value = 0})
  341 +
  342 + role:log("gm_action", {desc = "advf", key1 = pms.sender})
  343 +
307 return "成功" 344 return "成功"
308 end 345 end
309 346
@@ -331,6 +368,7 @@ function _M.adv(role, pms) @@ -331,6 +368,7 @@ function _M.adv(role, pms)
331 addPre(chapterId) 368 addPre(chapterId)
332 role:updateProperty({field = "advPass", value = advPass}) 369 role:updateProperty({field = "advPass", value = advPass})
333 end 370 end
  371 + role:log("gm_action", {desc = "advf", int1 = chapterId, int2 = layer, key1 = pms.sender})
334 372
335 return "成功" 373 return "成功"
336 end 374 end
@@ -355,6 +393,7 @@ function _M.advt(role, pms) @@ -355,6 +393,7 @@ function _M.advt(role, pms)
355 advData.level = layer 393 advData.level = layer
356 394
357 advData:saveDB() 395 advData:saveDB()
  396 + role:log("gm_action", {desc = "advt", int1 = chapterId, int2 = layer, key1 = pms.sender})
358 397
359 return "成功" 398 return "成功"
360 end 399 end
@@ -363,6 +402,9 @@ table.insert(helpDes, {&quot;冒险队等级增加&quot;, &quot;advl&quot;, &quot;经验&quot;}) @@ -363,6 +402,9 @@ table.insert(helpDes, {&quot;冒险队等级增加&quot;, &quot;advl&quot;, &quot;经验&quot;})
363 function _M.advl(role, pms) 402 function _M.advl(role, pms)
364 local exp = tonum(pms.pm1) 403 local exp = tonum(pms.pm1)
365 role:addAdvLvExp(math.max(0, exp)) 404 role:addAdvLvExp(math.max(0, exp))
  405 +
  406 + role:log("gm_action", {desc = "advl", int1 = exp, key1 = pms.sender})
  407 +
366 return "成功" 408 return "成功"
367 end 409 end
368 410
@@ -376,7 +418,8 @@ function _M.advcl(role, pms) @@ -376,7 +418,8 @@ function _M.advcl(role, pms)
376 end 418 end
377 advData.battle.player:addExp(exp) 419 advData.battle.player:addExp(exp)
378 advData:saveDB() 420 advData:saveDB()
379 - 421 + role:log("gm_action", {desc = "advcl", int1 = exp, key1 = pms.sender})
  422 +
380 return "成功" 423 return "成功"
381 end 424 end
382 425
@@ -385,6 +428,8 @@ function _M.idlec(role, pms) @@ -385,6 +428,8 @@ function _M.idlec(role, pms)
385 role:updateProperty({field = "hangTeam", value = {}}) 428 role:updateProperty({field = "hangTeam", value = {}})
386 role:updateProperty({field = "hangInfo", value = {}}) 429 role:updateProperty({field = "hangInfo", value = {}})
387 role:updateProperty({field = "hangBag", value = {}}) 430 role:updateProperty({field = "hangBag", value = {}})
  431 + role:log("gm_action", {desc = "idlec", key1 = pms.sender})
  432 +
388 role.advData = nil 433 role.advData = nil
389 return "成功" 434 return "成功"
390 end 435 end
@@ -408,11 +453,13 @@ function _M.advit(role, pms) @@ -408,11 +453,13 @@ function _M.advit(role, pms)
408 local itemId = tonum(pms.pm1) 453 local itemId = tonum(pms.pm1)
409 local count = tonum(pms.pm2) 454 local count = tonum(pms.pm2)
410 reward[itemId] = count 455 reward[itemId] = count
  456 +
  457 + role:log("gm_action", {desc = "advit", int1 = itemId, int2 = count, key1 = pms.sender})
411 end 458 end
412 459
413 460
414 local adv = role:getAdvData() 461 local adv = role:getAdvData()
415 - adv:award(reward) 462 + adv:award(reward, {log = {desc = "gm"}})
416 return "成功" 463 return "成功"
417 end 464 end
418 465
@@ -422,6 +469,9 @@ function _M.tower(role, pms) @@ -422,6 +469,9 @@ function _M.tower(role, pms)
422 local level = tonum(pms.pm1, 1) 469 local level = tonum(pms.pm1, 1)
423 if not csvdb["tower_battleCsv"][level] then return "不存在" end 470 if not csvdb["tower_battleCsv"][level] then return "不存在" end
424 role:updateProperty({field = "towerInfo", value = {c = globalCsv.tower_count_limit, l = level}}) 471 role:updateProperty({field = "towerInfo", value = {c = globalCsv.tower_count_limit, l = level}})
  472 +
  473 + role:log("gm_action", {desc = "tower", int1 = level, key1 = pms.sender})
  474 +
425 return "成功" 475 return "成功"
426 end 476 end
427 477
@@ -439,6 +489,9 @@ function _M.email(role, pms) @@ -439,6 +489,9 @@ function _M.email(role, pms)
439 attachments = id == 0 and reward or nil, 489 attachments = id == 0 and reward or nil,
440 rewardPms = id ~= 0 and reward or nil, 490 rewardPms = id ~= 0 and reward or nil,
441 }) 491 })
  492 +
  493 + role:log("gm_action", {desc = "email", int1 = id, key1 = pms.sender})
  494 +
442 return "成功" 495 return "成功"
443 end 496 end
444 497
@@ -455,6 +508,8 @@ function _M.cguide(role, pms) @@ -455,6 +508,8 @@ function _M.cguide(role, pms)
455 elseif id == 2 then 508 elseif id == 2 then
456 role:updateProperty({field = "funcGuide", value = ""}) 509 role:updateProperty({field = "funcGuide", value = ""})
457 end 510 end
  511 +
  512 + role:log("gm_action", {desc = "cguide", int1 = id, key1 = pms.sender})
458 return "成功" 513 return "成功"
459 end 514 end
460 515
src/actions/HangAction.lua
@@ -102,6 +102,8 @@ function _M.startRpc( agent, data ) @@ -102,6 +102,8 @@ function _M.startRpc( agent, data )
102 end 102 end
103 role:updateProperty({field = "hangInfo", value = hangInfo}) 103 role:updateProperty({field = "hangInfo", value = hangInfo})
104 104
  105 + role:log("hang_action", {desc = "startHang", int1 = carbonId})
  106 +
105 SendPacket(actionCodes.Hang_startRpc, '') 107 SendPacket(actionCodes.Hang_startRpc, '')
106 return true 108 return true
107 end 109 end
@@ -184,12 +186,15 @@ function _M.endBattleRpc(agent, data) @@ -184,12 +186,15 @@ function _M.endBattleRpc(agent, data)
184 for itemId, count in pairs(carbonData.item_clear:toNumMap()) do 186 for itemId, count in pairs(carbonData.item_clear:toNumMap()) do
185 reward[itemId] = count 187 reward[itemId] = count
186 end 188 end
187 - reward = role:award(reward) 189 + reward = role:award(reward, {log = {desc = "hangBattle", int1 = carbonId}})
188 190
189 role:checkTaskEnter("HangPass", {id = carbonId}) 191 role:checkTaskEnter("HangPass", {id = carbonId})
190 end 192 end
191 hangInfo.key = nil 193 hangInfo.key = nil
192 role:updateProperty({field = "hangInfo", value = hangInfo}) 194 role:updateProperty({field = "hangInfo", value = hangInfo})
  195 +
  196 + role:log("hang_action", {desc = "hangBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = carbonId})
  197 +
193 SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ 198 SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({
194 starNum = msg.starNum, 199 starNum = msg.starNum,
195 reward = reward, 200 reward = reward,
@@ -232,7 +237,7 @@ function _M.getRewardRpc(agent , data) @@ -232,7 +237,7 @@ function _M.getRewardRpc(agent , data)
232 checkReward(role) 237 checkReward(role)
233 local items = role:getProperty("hangBag") 238 local items = role:getProperty("hangBag")
234 if not next(items) then return end 239 if not next(items) then return end
235 - local reward = role:award(items) 240 + local reward = role:award(items, {log = {desc = "hangReward"}})
236 table.clear(items) 241 table.clear(items)
237 local hangInfo = role:getProperty("hangInfo") 242 local hangInfo = role:getProperty("hangInfo")
238 local nowTime = skynet.timex() 243 local nowTime = skynet.timex()
@@ -323,7 +328,7 @@ function _M.quickRpc(agent , data) @@ -323,7 +328,7 @@ function _M.quickRpc(agent , data)
323 if not costs[curCount] then return end 328 if not costs[curCount] then return end
324 if costs[curCount] > 0 then 329 if costs[curCount] > 0 then
325 if not role:checkItemEnough({[ItemId.Diamond] = costs[curCount]}) then return end 330 if not role:checkItemEnough({[ItemId.Diamond] = costs[curCount]}) then return end
326 - role:costItems({[ItemId.Diamond] = costs[curCount]}) 331 + role:costItems({[ItemId.Diamond] = costs[curCount]}, {log = {desc = "quickHang", int1 = hangInfo.carbonId}})
327 end 332 end
328 333
329 role.dailyData:updateProperty({field = "hangQC", value = curCount}) 334 role.dailyData:updateProperty({field = "hangQC", value = curCount})
@@ -345,7 +350,7 @@ function _M.quickRpc(agent , data) @@ -345,7 +350,7 @@ function _M.quickRpc(agent , data)
345 reward[cur[1]] = (reward[cur[1]] or 0) + cur[2] 350 reward[cur[1]] = (reward[cur[1]] or 0) + cur[2]
346 end 351 end
347 352
348 - reward = role:award(reward) 353 + reward = role:award(reward, {log = {desc = "quickHang", int1 = hangInfo.carbonId}})
349 if reward[ItemId.Gold] then 354 if reward[ItemId.Gold] then
350 role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) 355 role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]})
351 end 356 end
@@ -393,16 +398,16 @@ function _M.buyBonusCountRpc(agent, data) @@ -393,16 +398,16 @@ function _M.buyBonusCountRpc(agent, data)
393 local count = msg.count 398 local count = msg.count
394 local btype = msg.type 399 local btype = msg.type
395 400
396 - if math.illegalNum(btype, 1, 2) then return 0 end 401 + if not TimeReset["DailyBattle" .. btype] then return end
397 402
398 local bonusC = role.dailyData:getProperty("bonusC") 403 local bonusC = role.dailyData:getProperty("bonusC")
399 bonusC[btype] = bonusC[btype] or {c = 0, b = 0} 404 bonusC[btype] = bonusC[btype] or {c = 0, b = 0}
400 local lastCount = globalCsv.bonus_daily_buy_count - bonusC[btype]["b"] 405 local lastCount = globalCsv.bonus_daily_buy_count - bonusC[btype]["b"]
401 if math.illegalNum(count, 1, lastCount) then return 1 end 406 if math.illegalNum(count, 1, lastCount) then return 1 end
402 407
403 - if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return end 408 + if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return 2 end
404 409
405 - role:costItems({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) 410 + role:costItems({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}, {log = {desc = "buyBonusCount", short1 = btype, int1 = count}})
406 bonusC[btype]["b"] = bonusC[btype]["b"] + count 411 bonusC[btype]["b"] = bonusC[btype]["b"] + count
407 bonusC[btype]["c"] = bonusC[btype]["c"] - count 412 bonusC[btype]["c"] = bonusC[btype]["c"] - count
408 413
@@ -457,10 +462,12 @@ function _M.endBonusBattleRpc(agent, data) @@ -457,10 +462,12 @@ function _M.endBonusBattleRpc(agent, data)
457 462
458 local reward 463 local reward
459 if starNum and starNum > 0 then 464 if starNum and starNum > 0 then
460 - reward = role:award(bonusData.reward) 465 + reward = role:award(bonusData.reward, {log = {desc = "bonusBattle", int1 = id}})
461 role:checkTaskEnter("BonusPass", {id = id}) 466 role:checkTaskEnter("BonusPass", {id = id})
462 end 467 end
463 468
  469 + role:log("hang_action", {desc = "bonusBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id})
  470 +
464 SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ 471 SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({
465 starNum = starNum, 472 starNum = starNum,
466 reward = reward})) 473 reward = reward}))
src/actions/HeroAction.lua
@@ -27,9 +27,11 @@ function _M.levelUpRpc( agent, data ) @@ -27,9 +27,11 @@ function _M.levelUpRpc( agent, data )
27 local curData = csvdb["unit_expCsv"][hero:getProperty("level")] 27 local curData = csvdb["unit_expCsv"][hero:getProperty("level")]
28 local cost = {[ItemId.Exp] = curData.exp, [ItemId.Gold] = curData.gold} 28 local cost = {[ItemId.Exp] = curData.exp, [ItemId.Gold] = curData.gold}
29 if not role:checkItemEnough(cost) then return 3 end 29 if not role:checkItemEnough(cost) then return 3 end
30 - role:costItems(cost) 30 + role:costItems(cost, {log = {desc = "heroLevelUp", int1 = msg.id, int2 = hero:getProperty("type")}})
31 hero:updateProperty({field = "level", delta = 1}) 31 hero:updateProperty({field = "level", delta = 1})
32 32
  33 + hero:log({desc = "levelUp", int1 = hero:getProperty("level")})
  34 +
33 role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) 35 role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")})
34 SendPacket(actionCodes.Hero_levelUpRpc, '') 36 SendPacket(actionCodes.Hero_levelUpRpc, '')
35 return true 37 return true
@@ -46,9 +48,11 @@ function _M.breakRpc( agent, data ) @@ -46,9 +48,11 @@ function _M.breakRpc( agent, data )
46 local curData = csvdb["unit_breakCsv"][hero:getProperty("breakL")] 48 local curData = csvdb["unit_breakCsv"][hero:getProperty("breakL")]
47 local cost = {[ItemId.BreakCost] = curData.cost, [ItemId.Gold] = curData.gold} 49 local cost = {[ItemId.BreakCost] = curData.cost, [ItemId.Gold] = curData.gold}
48 if not role:checkItemEnough(cost) then return 4 end 50 if not role:checkItemEnough(cost) then return 4 end
49 - role:costItems(cost) 51 + role:costItems(cost, {log = {desc = "heroBreak", int1 = msg.id, int2 = hero:getProperty("type")}})
50 hero:updateProperty({field = "breakL", delta = 1}) 52 hero:updateProperty({field = "breakL", delta = 1})
51 53
  54 + hero:log({desc = "break", int1 = hero:getProperty("breakL")})
  55 +
52 SendPacket(actionCodes.Hero_breakRpc, '') 56 SendPacket(actionCodes.Hero_breakRpc, '')
53 return true 57 return true
54 end 58 end
@@ -82,7 +86,7 @@ function _M.wakeRpc(agent, data) @@ -82,7 +86,7 @@ function _M.wakeRpc(agent, data)
82 end 86 end
83 end 87 end
84 88
85 - role:costItems(cost) 89 + role:costItems(cost, {log = {desc = "heroWake", int1 = msg.id, int2 = hero:getProperty("type")}})
86 for k,v in pairs(skills) do 90 for k,v in pairs(skills) do
87 hero:updateProperty({field = "skillL", value = hero:getProperty("skillL"):setv(k, v)}) 91 hero:updateProperty({field = "skillL", value = hero:getProperty("skillL"):setv(k, v)})
88 end 92 end
@@ -93,6 +97,8 @@ function _M.wakeRpc(agent, data) @@ -93,6 +97,8 @@ function _M.wakeRpc(agent, data)
93 if curLevel == 4 then -- 解锁cg 97 if curLevel == 4 then -- 解锁cg
94 role:checkTaskEnter("WakeCG", {heroType = typ}) 98 role:checkTaskEnter("WakeCG", {heroType = typ})
95 end 99 end
  100 + hero:log({desc = "wake", int1 = hero:getProperty("wakeL")})
  101 +
96 102
97 SendPacket(actionCodes.Hero_wakeRpc, '') 103 SendPacket(actionCodes.Hero_wakeRpc, '')
98 return true 104 return true
@@ -109,6 +115,8 @@ function _M.skillUpRpc(agent, data) @@ -109,6 +115,8 @@ function _M.skillUpRpc(agent, data)
109 if hero:getLSPoint() <= 0 or curLevel >= #hero:getSkillData(index) then return end 115 if hero:getLSPoint() <= 0 or curLevel >= #hero:getSkillData(index) then return end
110 hero:updateProperty({field = "skillL", value = hero:getProperty("skillL"):setv(index, curLevel + 1)}) 116 hero:updateProperty({field = "skillL", value = hero:getProperty("skillL"):setv(index, curLevel + 1)})
111 117
  118 + hero:log({desc = "skillUp", int1 = index, int2 = curLevel + 1})
  119 +
112 SendPacket(actionCodes.Hero_skillUpRpc, '') 120 SendPacket(actionCodes.Hero_skillUpRpc, '')
113 return true 121 return true
114 end 122 end
@@ -141,7 +149,7 @@ function _M.talentRpc(agent, data) @@ -141,7 +149,7 @@ function _M.talentRpc(agent, data)
141 cost[globalCsv.unit_talent_cost[csvdb["unitCsv"][hero:getProperty("type")].camp][k]] = v 149 cost[globalCsv.unit_talent_cost[csvdb["unitCsv"][hero:getProperty("type")].camp][k]] = v
142 end 150 end
143 if not role:checkItemEnough(cost) then return 6 end 151 if not role:checkItemEnough(cost) then return 6 end
144 - role:costItems(cost) 152 + role:costItems(cost, {log = {desc = "heroTalent", int1 = msg.id, int2 = hero:getProperty("type")}})
145 talent = talent:incrv(index, 1) 153 talent = talent:incrv(index, 1)
146 154
147 --是否进阶 155 --是否进阶
@@ -167,6 +175,8 @@ function _M.talentRpc(agent, data) @@ -167,6 +175,8 @@ function _M.talentRpc(agent, data)
167 175
168 role:checkTaskEnter("HeroTalent", {heroType = hero:getProperty("type"), alv = aheadLevel}) 176 role:checkTaskEnter("HeroTalent", {heroType = hero:getProperty("type"), alv = aheadLevel})
169 177
  178 + hero:log({desc = "talent", int1 = index, int2 = talent:getv(index, 0)})
  179 +
170 SendPacket(actionCodes.Hero_talentRpc, '') 180 SendPacket(actionCodes.Hero_talentRpc, '')
171 return true 181 return true
172 end 182 end
@@ -491,8 +501,8 @@ function _M.createHeroRpc(agent, data) @@ -491,8 +501,8 @@ function _M.createHeroRpc(agent, data)
491 if hero:getProperty("type") == heroType then return end 501 if hero:getProperty("type") == heroType then return end
492 end 502 end
493 503
494 - role:costItems({[heroType] = cost})  
495 - role:award({[heroType + ItemStartId.Hero] = 1}) 504 + role:costItems({[heroType] = cost}, {log = {desc = "createHero"}})
  505 + role:award({[heroType + ItemStartId.Hero] = 1}, {log = {desc = "createHero"}})
496 506
497 SendPacket(actionCodes.Hero_createHeroRpc, "") 507 SendPacket(actionCodes.Hero_createHeroRpc, "")
498 return true 508 return true
@@ -522,12 +532,12 @@ function _M.referEquipsRpc(agent, data) @@ -522,12 +532,12 @@ function _M.referEquipsRpc(agent, data)
522 if equips[typ] == 0 then 532 if equips[typ] == 0 then
523 curEquip = curEquip:delk(typ) 533 curEquip = curEquip:delk(typ)
524 else 534 else
525 - role:addEquip(typ, equips[typ], -1) -- 穿上 535 + role:addEquip(typ, equips[typ], -1, {log = {desc = "refer"}}) -- 穿上
526 curEquip = curEquip:setv(typ, equips[typ]) 536 curEquip = curEquip:setv(typ, equips[typ])
527 end 537 end
528 538
529 if cur ~= 0 then 539 if cur ~= 0 then
530 - role:addEquip(typ, cur, 1) -- 脱掉 540 + role:addEquip(typ, cur, 1, {log = {desc = "refer"}}) -- 脱掉
531 end 541 end
532 end 542 end
533 end 543 end
@@ -602,8 +612,8 @@ function _M.createHeroRandomRpc(agent, data) @@ -602,8 +612,8 @@ function _M.createHeroRandomRpc(agent, data)
602 else 612 else
603 reward = {[temp[1] + ItemStartId.Hero] = 1} 613 reward = {[temp[1] + ItemStartId.Hero] = 1}
604 end 614 end
605 - role:costItems({[itemId] = cost})  
606 - reward = role:award(reward) 615 + role:costItems({[itemId] = cost}, {log = {desc = "createHeroRandom"}})
  616 + reward = role:award(reward, {log = {desc = "createHeroRandom"}})
607 SendPacket(actionCodes.Hero_createHeroRandomRpc, MsgPack.pack({reward = reward})) 617 SendPacket(actionCodes.Hero_createHeroRandomRpc, MsgPack.pack({reward = reward}))
608 return true 618 return true
609 end 619 end
@@ -668,11 +678,12 @@ function _M.getResetRewardRpc(agent, data) @@ -668,11 +678,12 @@ function _M.getResetRewardRpc(agent, data)
668 hero:updateProperty({field = "level", value = level}) 678 hero:updateProperty({field = "level", value = level})
669 hero:updateProperty({field = "breakL", value = breakL}) 679 hero:updateProperty({field = "breakL", value = breakL})
670 hero:updateProperty({field = "talent", value = ""}) 680 hero:updateProperty({field = "talent", value = ""})
  681 + hero:log({desc = "resetHero"})
671 682
672 for itemId, count in pairs(reward) do 683 for itemId, count in pairs(reward) do
673 reward[itemId] = math.floor(count * globalCsv.unit_back_discount) 684 reward[itemId] = math.floor(count * globalCsv.unit_back_discount)
674 end 685 end
675 - reward = role:award(reward) 686 + reward = role:award(reward, {log = {desc = "resetHero", int1 = msg.id, int2 = hero:getProperty("type")}})
676 687
677 SendPacket(actionCodes.Hero_getResetRewardRpc, MsgPack.pack({reward = reward})) 688 SendPacket(actionCodes.Hero_getResetRewardRpc, MsgPack.pack({reward = reward}))
678 return true 689 return true
@@ -784,7 +795,7 @@ function _M.drawHeroRpc(agent, data) @@ -784,7 +795,7 @@ function _M.drawHeroRpc(agent, data)
784 end, 795 end,
785 } 796 }
786 797
787 - role:costItems(cost) 798 + role:costItems(cost, {log = {desc = "drawHero", short1 = pool}})
788 local floorHeroCount = role:getProperty("floorHero")[pool] or 0 799 local floorHeroCount = role:getProperty("floorHero")[pool] or 0
789 800
790 local ssrCount = 0 801 local ssrCount = 0
@@ -823,10 +834,10 @@ function _M.drawHeroRpc(agent, data) @@ -823,10 +834,10 @@ function _M.drawHeroRpc(agent, data)
823 local fragId = itemData.id - ItemStartId.Hero 834 local fragId = itemData.id - ItemStartId.Hero
824 local heroData = csvdb["unitCsv"][fragId] 835 local heroData = csvdb["unitCsv"][fragId]
825 local count = globalCsv.draw_unit_tofragment[heroData.rare] * temp[2] 836 local count = globalCsv.draw_unit_tofragment[heroData.rare] * temp[2]
826 - role:award({[fragId] = count}) 837 + role:award({[fragId] = count}, {log = {desc = "drawHero", short1 = pool}})
827 table.insert(reward, {id = fragId, count = count, from = temp[1], fcount = temp[2]}) 838 table.insert(reward, {id = fragId, count = count, from = temp[1], fcount = temp[2]})
828 else 839 else
829 - role:award({[temp[1]] = temp[2]}) 840 + role:award({[temp[1]] = temp[2]}, {log = {desc = "drawHero", short1 = pool}})
830 table.insert(reward, {id = temp[1], count = temp[2]}) 841 table.insert(reward, {id = temp[1], count = temp[2]})
831 end 842 end
832 end 843 end
@@ -847,7 +858,7 @@ function _M.drawHeroRpc(agent, data) @@ -847,7 +858,7 @@ function _M.drawHeroRpc(agent, data)
847 if ssrCount > 0 then 858 if ssrCount > 0 then
848 role:checkTaskEnter("DrawSSR", {count = ssrCount}) 859 role:checkTaskEnter("DrawSSR", {count = ssrCount})
849 end 860 end
850 - 861 + role:log("hero_action", {desc = "drawHero", short1 = pool, int1 = drawCount[drawType]})
851 SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 862 SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组
852 return true 863 return true
853 end 864 end
@@ -869,13 +880,13 @@ function _M.repayHeroRpc(agent, data) @@ -869,13 +880,13 @@ function _M.repayHeroRpc(agent, data)
869 local fragId = itemData.id - ItemStartId.Hero 880 local fragId = itemData.id - ItemStartId.Hero
870 local heroData = csvdb["unitCsv"][fragId] 881 local heroData = csvdb["unitCsv"][fragId]
871 local count = globalCsv.draw_unit_tofragment[heroData.rare] 882 local count = globalCsv.draw_unit_tofragment[heroData.rare]
872 - role:award({[fragId] = count}) 883 + role:award({[fragId] = count}, {log = {desc = "heroRepay"}})
873 reward = {id = fragId, count = count, from = id, fcount = 1} 884 reward = {id = fragId, count = count, from = id, fcount = 1}
874 else 885 else
875 - role:award({[id] = 1}) 886 + role:award({[id] = 1}, {log = {desc = "heroRepay"}})
876 reward = {id = id, count = 1} 887 reward = {id = id, count = 1}
877 end 888 end
878 - 889 + role:log("hero_action", {desc = "heroRepay"})
879 SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward})) 890 SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward}))
880 return true 891 return true
881 end 892 end
src/actions/HttpAction.lua
@@ -179,7 +179,11 @@ function _M.gm_action(query) @@ -179,7 +179,11 @@ function _M.gm_action(query)
179 return "角色不存在" 179 return "角色不存在"
180 end 180 end
181 role:loadAll() 181 role:loadAll()
182 - return gmFuncs[query.cmd](role, query) 182 + role:startActionUcode()
  183 + local status = gmFuncs[query.cmd](role, query)
  184 + role:endActionUcode()
  185 +
  186 + return status
183 end 187 end
184 188
185 function _M.broadcast(query) 189 function _M.broadcast(query)
src/actions/PvpAction.lua
@@ -235,8 +235,8 @@ function _M.buyCountRpc(agent, data) @@ -235,8 +235,8 @@ function _M.buyCountRpc(agent, data)
235 235
236 local cost = {[ItemId.Diamond] = globalCsv.pvp_buy_cost * count} 236 local cost = {[ItemId.Diamond] = globalCsv.pvp_buy_cost * count}
237 if not role:checkItemEnough(cost) then return 2 end 237 if not role:checkItemEnough(cost) then return 2 end
238 - role:costItems(cost)  
239 - role:award({[ItemId.PvpKey] = count}) 238 + role:costItems(cost, {log = {desc = "buyPvpKey"}})
  239 + role:award({[ItemId.PvpKey] = count}, {log = {desc = "buyPvpKey"}})
240 240
241 SendPacket(actionCodes.Pvp_buyCountRpc, '') 241 SendPacket(actionCodes.Pvp_buyCountRpc, '')
242 return true 242 return true
@@ -287,7 +287,7 @@ function _M.startBattleRpc(agent, data) @@ -287,7 +287,7 @@ function _M.startBattleRpc(agent, data)
287 if pvpFree >= globalCsv.pvp_battle_free_count then 287 if pvpFree >= globalCsv.pvp_battle_free_count then
288 local cost = {[ItemId.PvpKey] = 1} 288 local cost = {[ItemId.PvpKey] = 1}
289 if not role:checkItemEnough(cost) then return 5 end 289 if not role:checkItemEnough(cost) then return 5 end
290 - role:costItems(cost) 290 + role:costItems(cost, {log = {desc = "startPvp", short1 = 1}})
291 else 291 else
292 role.dailyData:updateProperty({field = "pvpFree", delta = 1}) 292 role.dailyData:updateProperty({field = "pvpFree", delta = 1})
293 end 293 end
@@ -296,6 +296,9 @@ function _M.startBattleRpc(agent, data) @@ -296,6 +296,9 @@ function _M.startBattleRpc(agent, data)
296 _pvpStartBattleCacheC = {idx = idx, key = key, revenge = revenge} 296 _pvpStartBattleCacheC = {idx = idx, key = key, revenge = revenge}
297 297
298 role:checkTaskEnter("PvpBattle") 298 role:checkTaskEnter("PvpBattle")
  299 +
  300 +
  301 + role:log("pvp_action", {desc = "startBattle", short1 = 1, int1 = revenge and 1 or 0})
299 end 302 end
300 303
301 SendPacket(actionCodes.Pvp_startBattleRpc, MsgPack.pack({matchInfo = matchInfo, key = key, result = result, wait = wait})) 304 SendPacket(actionCodes.Pvp_startBattleRpc, MsgPack.pack({matchInfo = matchInfo, key = key, result = result, wait = wait}))
@@ -331,7 +334,7 @@ function _M.endBattleRpc(agent, data) @@ -331,7 +334,7 @@ function _M.endBattleRpc(agent, data)
331 if not match then return end 334 if not match then return end
332 335
333 local temp = string.randWeight(csvdb["player_expCsv"][role:getProperty("level")].pvpBonus, true) 336 local temp = string.randWeight(csvdb["player_expCsv"][role:getProperty("level")].pvpBonus, true)
334 - local reward = role:award({[temp[1]] = temp[2]}) 337 + local reward = role:award({[temp[1]] = temp[2]}, {log = {desc = "pvpBattleC"}})
335 local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreCommon(match.t == 1 and match.id or -1, isWin) 338 local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreCommon(match.t == 1 and match.id or -1, isWin)
336 339
337 _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 340 _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病
@@ -384,6 +387,8 @@ function _M.endBattleRpc(agent, data) @@ -384,6 +387,8 @@ function _M.endBattleRpc(agent, data)
384 if isWin then 387 if isWin then
385 role:checkTaskEnter("PvpWin", {score = myScore}) 388 role:checkTaskEnter("PvpWin", {score = myScore})
386 end 389 end
  390 +
  391 + role:log("pvp_action", {desc = "battleEnd", short1 = 1, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0})
387 392
388 SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({ 393 SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({
389 reward = reward, 394 reward = reward,
@@ -483,7 +488,7 @@ function _M.startBattleHRpc(agent, data) @@ -483,7 +488,7 @@ function _M.startBattleHRpc(agent, data)
483 if pvpFreeH >= globalCsv.pvp_battle_free_count_high then 488 if pvpFreeH >= globalCsv.pvp_battle_free_count_high then
484 local cost = {[ItemId.PvpKey] = globalCsv.pvp_battle_high_cost} 489 local cost = {[ItemId.PvpKey] = globalCsv.pvp_battle_high_cost}
485 if not role:checkItemEnough(cost) then return 5 end 490 if not role:checkItemEnough(cost) then return 5 end
486 - role:costItems(cost) 491 + role:costItems(cost, {log = {desc = "startPvp", short1 = 2}})
487 else 492 else
488 role.dailyData:updateProperty({field = "pvpFreeH", delta = 1}) 493 role.dailyData:updateProperty({field = "pvpFreeH", delta = 1})
489 end 494 end
@@ -508,6 +513,9 @@ function _M.startBattleHRpc(agent, data) @@ -508,6 +513,9 @@ function _M.startBattleHRpc(agent, data)
508 } 513 }
509 514
510 role:checkTaskEnter("PvpBattle") 515 role:checkTaskEnter("PvpBattle")
  516 +
  517 + role:log("pvp_action", {desc = "startBattle", short1 = 2, int1 = revenge and 1 or 0})
  518 +
511 end 519 end
512 520
513 SendPacket(actionCodes.Pvp_startBattleHRpc, MsgPack.pack({ 521 SendPacket(actionCodes.Pvp_startBattleHRpc, MsgPack.pack({
@@ -607,7 +615,7 @@ function _M.endBattleHRpc(agent, data) @@ -607,7 +615,7 @@ function _M.endBattleHRpc(agent, data)
607 615
608 -- 战斗结束了发奖 616 -- 战斗结束了发奖
609 local temp = string.randWeight(csvdb["player_expCsv"][role:getProperty("level")].pvpgroupBonus, true) 617 local temp = string.randWeight(csvdb["player_expCsv"][role:getProperty("level")].pvpgroupBonus, true)
610 - local reward = role:award({[temp[1]] = temp[2]}) 618 + local reward = role:award({[temp[1]] = temp[2]}, {log = {desc = "pvpBattleH"}})
611 local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = 0, 0, 0, 0, 0, 0 619 local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = 0, 0, 0, 0, 0, 0
612 if role:isTimeResetOpen(TimeReset.PvpHight) then 620 if role:isTimeResetOpen(TimeReset.PvpHight) then
613 myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreHigh(match.t == 1 and match.id or -1, isWin) 621 myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreHigh(match.t == 1 and match.id or -1, isWin)
@@ -675,6 +683,7 @@ function _M.endBattleHRpc(agent, data) @@ -675,6 +683,7 @@ function _M.endBattleHRpc(agent, data)
675 if isWin then 683 if isWin then
676 role:checkTaskEnter("PvpWin", {score = myScore}) 684 role:checkTaskEnter("PvpWin", {score = myScore})
677 end 685 end
  686 + role:log("pvp_action", {desc = "battleEnd", short1 = 2, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0})
678 687
679 SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ 688 SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({
680 reward = reward, 689 reward = reward,
@@ -829,7 +838,8 @@ function _M.highDivisionGiftRpc(agent, data) @@ -829,7 +838,8 @@ function _M.highDivisionGiftRpc(agent, data)
829 pvpHGift = {}, 838 pvpHGift = {},
830 }) 839 })
831 840
832 - local reward = role:award(newReward) 841 + local reward = role:award(newReward, {log = {desc = "pvpDivisionH"}})
  842 + role:log("pvp_action", {desc = "pvpDivisionH"})
833 843
834 SendPacket(actionCodes.Pvp_highDivisionGiftRpc, MsgPack.pack({reward = reward})) 844 SendPacket(actionCodes.Pvp_highDivisionGiftRpc, MsgPack.pack({reward = reward}))
835 return true 845 return true
@@ -853,7 +863,7 @@ function _M.shopBuyRpc(agent, data) @@ -853,7 +863,7 @@ function _M.shopBuyRpc(agent, data)
853 863
854 if not role:checkItemEnough({[ItemId.PvpCoin] = csvData.cost * count}) then return end 864 if not role:checkItemEnough({[ItemId.PvpCoin] = csvData.cost * count}) then return end
855 865
856 - role:costItems({[ItemId.PvpCoin] = csvData.cost * count}) 866 + role:costItems({[ItemId.PvpCoin] = csvData.cost * count}, {log = {desc = "pvpShop", int1 = id, int2 = count}})
857 if csvData.limit > 0 then 867 if csvData.limit > 0 then
858 role:changeUpdates({{type = "pvpShop", field = id, value = (pvpShop[id] or 0) + count}}) 868 role:changeUpdates({{type = "pvpShop", field = id, value = (pvpShop[id] or 0) + count}})
859 end 869 end
@@ -862,8 +872,9 @@ function _M.shopBuyRpc(agent, data) @@ -862,8 +872,9 @@ function _M.shopBuyRpc(agent, data)
862 for id, c in pairs(gift) do 872 for id, c in pairs(gift) do
863 gift[id] = c * count 873 gift[id] = c * count
864 end 874 end
865 - local reward = role:award(gift) 875 + local reward = role:award(gift, {log = {desc = "pvpShop", int1 = id, int2 = count}})
866 876
  877 + role:log("pvp_action", {desc = "pvpShop", int1 = id, int2 = count})
867 878
868 SendPacket(actionCodes.Pvp_shopBuyRpc, MsgPack.pack({reward = reward})) 879 SendPacket(actionCodes.Pvp_shopBuyRpc, MsgPack.pack({reward = reward}))
869 return true 880 return true
@@ -953,9 +964,10 @@ function _M.crossBetRpc(agent, data) @@ -953,9 +964,10 @@ function _M.crossBetRpc(agent, data)
953 if not role:isTimeResetOpen(TimeReset.PvpCross) then return end 964 if not role:isTimeResetOpen(TimeReset.PvpCross) then return end
954 if msg.idx ~= 1 and msg.idx ~= 2 then return end 965 if msg.idx ~= 1 and msg.idx ~= 2 then return end
955 966
956 - local result = role:getCrossServerPvpBet(msg.idx) 967 + local result = role:setCrossServerPvpBet(msg.idx)
957 if not result then return end 968 if not result then return end
958 - 969 +
  970 + role:log("pvp_action", {desc = "crossBet"})
959 SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result)) 971 SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result))
960 return true 972 return true
961 end 973 end
src/actions/RoleAction.lua
@@ -293,7 +293,7 @@ function _M.createRpc(agent, data) @@ -293,7 +293,7 @@ function _M.createRpc(agent, data)
293 return true 293 return true
294 end 294 end
295 newRole:startActionUcode() 295 newRole:startActionUcode()
296 - newRole:award(globalCsv.birthItem) 296 + newRole:award(globalCsv.birthItem, {log = {desc = "birth"}})
297 -- 欢迎邮件 297 -- 欢迎邮件
298 redisproxy:insertEmail({roleId = roleId, emailId = 1}) 298 redisproxy:insertEmail({roleId = roleId, emailId = 1})
299 299
@@ -900,7 +900,7 @@ function _M.drawCodeRpc(agent, data) @@ -900,7 +900,7 @@ function _M.drawCodeRpc(agent, data)
900 if ret == 0 then 900 if ret == 0 then
901 local giftId = tonumber(result.giftId) 901 local giftId = tonumber(result.giftId)
902 role:setProperty("codeStr", codestr:setv(giftId, 1)) 902 role:setProperty("codeStr", codestr:setv(giftId, 1))
903 - local reward = role:award(result.gift, {desc = "drawCode", key1 = code, int1 = giftId}) 903 + local reward = role:award(result.gift, {log = {desc = "drawCode", key1 = code, int1 = giftId}})
904 904
905 SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ 905 SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({
906 result = ret, 906 result = ret,
@@ -965,7 +965,7 @@ function _M.guideRpc(agent, data) @@ -965,7 +965,7 @@ function _M.guideRpc(agent, data)
965 if master < 0 or slave < 0 then return end 965 if master < 0 or slave < 0 then return end
966 newerGuide = string.format("%d=%d",master,slave) 966 newerGuide = string.format("%d=%d",master,slave)
967 role:updateProperty({field = "newerGuide", value = newerGuide}) 967 role:updateProperty({field = "newerGuide", value = newerGuide})
968 - role:log("guide", {int1 = master*1000+slave}) 968 + role:log("guide", {desc = "guide_new",int1 = master*1000+slave})
969 elseif cmdType == 2 then 969 elseif cmdType == 2 then
970 -- 系统引导 970 -- 系统引导
971 if not msg.skip then return end 971 if not msg.skip then return end
@@ -978,7 +978,7 @@ function _M.guideRpc(agent, data) @@ -978,7 +978,7 @@ function _M.guideRpc(agent, data)
978 978
979 if msg.funcType then 979 if msg.funcType then
980 funcGuide = funcGuide:setv(msg.funcType, 1) 980 funcGuide = funcGuide:setv(msg.funcType, 1)
981 - role:log("guide_sys", {int1 = msg.funcType}) 981 + role:log("guide", {desc = "guide_sys", int1 = msg.funcType})
982 end 982 end
983 role:updateProperty({field = "funcGuide", value = funcGuide}) 983 role:updateProperty({field = "funcGuide", value = funcGuide})
984 elseif cmdType == 3 then 984 elseif cmdType == 3 then
@@ -986,7 +986,7 @@ function _M.guideRpc(agent, data) @@ -986,7 +986,7 @@ function _M.guideRpc(agent, data)
986 if msg.funcType then 986 if msg.funcType then
987 local value = msg.value or 1 987 local value = msg.value or 1
988 for _, funcIdx in pairs(msg.funcType:toArray(true,"=")) do 988 for _, funcIdx in pairs(msg.funcType:toArray(true,"=")) do
989 - role:log("guide_weak", {int1 = funcIdx}) 989 + role:log("guide", {desc = "guide_weak", int1 = funcIdx})
990 funcGuide = funcGuide:setv(funcIdx, value) 990 funcGuide = funcGuide:setv(funcIdx, value)
991 end 991 end
992 role:updateProperty({field = "funcGuide", value = funcGuide}) 992 role:updateProperty({field = "funcGuide", value = funcGuide})
src/actions/StoreAction.lua
@@ -15,7 +15,7 @@ function _M.rechargeRpc(agent , data) @@ -15,7 +15,7 @@ function _M.rechargeRpc(agent , data)
15 rechargeF[id] = 1 15 rechargeF[id] = 1
16 role:updateProperty({field = "rechargeF", value = rechargeF}) 16 role:updateProperty({field = "rechargeF", value = rechargeF})
17 end 17 end
18 - role:gainDiamond({count = diamondCount, isRecharge = true}) 18 + role:gainDiamond({count = diamondCount, isRecharge = true, log = {desc = "recharge", int1 = id}})
19 elseif dataSet.type == 1 then --月卡 19 elseif dataSet.type == 1 then --月卡
20 return 20 return
21 elseif dataSet.type == 2 then -- 赛季通行证 21 elseif dataSet.type == 2 then -- 赛季通行证
@@ -28,6 +28,8 @@ function _M.rechargeRpc(agent , data) @@ -28,6 +28,8 @@ function _M.rechargeRpc(agent , data)
28 local rmb = dataSet.rmb 28 local rmb = dataSet.rmb
29 role:updateProperty({field = "rmbC", delta = rmb}) 29 role:updateProperty({field = "rmbC", delta = rmb})
30 30
  31 + role:log("role_action", {desc = "recharge", int1 = id})
  32 +
31 SendPacket(actionCodes.Store_rechargeRpc, MsgPack.pack({diamond = diamondCount})) 33 SendPacket(actionCodes.Store_rechargeRpc, MsgPack.pack({diamond = diamondCount}))
32 return true 34 return true
33 end 35 end
@@ -57,7 +59,7 @@ function _M.dailyBuyRpc(agent , data) @@ -57,7 +59,7 @@ function _M.dailyBuyRpc(agent , data)
57 return 3 59 return 3
58 end 60 end
59 61
60 - if not role:costDiamond({count = cost * count}) then 62 + if not role:costDiamond({count = cost * count}, {log = {desc = "dailyShop", int1 = id, int2 = count}}) then
61 return 4 63 return 4
62 end 64 end
63 65
@@ -65,7 +67,9 @@ function _M.dailyBuyRpc(agent , data) @@ -65,7 +67,9 @@ function _M.dailyBuyRpc(agent , data)
65 dailySDC[id] = (dailySDC[id] or 0) + count 67 dailySDC[id] = (dailySDC[id] or 0) + count
66 role.dailyData:updateProperty({field = "dailySDC", value = dailySDC}) 68 role.dailyData:updateProperty({field = "dailySDC", value = dailySDC})
67 end 69 end
68 - local reward = role:award(dataSet.gift) 70 + local reward = role:award(dataSet.gift, {log = {desc = "dailyShop", int1 = id, int2 = count}})
  71 +
  72 + role:log("role_action", {desc = "dailyShop", int1 = id, int2 = count})
69 73
70 SendPacket(actionCodes.Store_dailyBuyRpc, MsgPack.pack({reward = reward})) 74 SendPacket(actionCodes.Store_dailyBuyRpc, MsgPack.pack({reward = reward}))
71 return true 75 return true
@@ -92,13 +96,15 @@ function _M.dinerBuyRpc(agent , data) @@ -92,13 +96,15 @@ function _M.dinerBuyRpc(agent , data)
92 role:updateProperty({field = "dinerS", value = dinerS}) 96 role:updateProperty({field = "dinerS", value = dinerS})
93 end 97 end
94 98
95 - role:costItems(cost) 99 + role:costItems(cost, {log = {desc = "dinerShop", int1 = id, int2 = count}})
96 100
97 local gift = {} 101 local gift = {}
98 for _id, _count in pairs(dataSet.gift:toNumMap()) do 102 for _id, _count in pairs(dataSet.gift:toNumMap()) do
99 gift[_id] = _count * count 103 gift[_id] = _count * count
100 end 104 end
101 - local reward = role:award(gift) 105 + local reward = role:award(gift, {log = {desc = "dinerShop", int1 = id, int2 = count}})
  106 +
  107 + role:log("role_action", {desc = "dinerShop", int1 = id, int2 = count})
102 108
103 SendPacket(actionCodes.Store_dinerBuyRpc, MsgPack.pack({reward = reward})) 109 SendPacket(actionCodes.Store_dinerBuyRpc, MsgPack.pack({reward = reward}))
104 return true 110 return true
src/actions/TowerAction.lua
@@ -32,6 +32,7 @@ function _M.roleFormatRpc(agent , data) @@ -32,6 +32,7 @@ function _M.roleFormatRpc(agent , data)
32 towerTeam.leader = msg.leader 32 towerTeam.leader = msg.leader
33 towerTeam.supports = supports 33 towerTeam.supports = supports
34 34
  35 +
35 role:updateProperty({field = "towerF", value = towerTeam}) 36 role:updateProperty({field = "towerF", value = towerTeam})
36 SendPacket(actionCodes.Tower_roleFormatRpc, '') 37 SendPacket(actionCodes.Tower_roleFormatRpc, '')
37 return true 38 return true
@@ -74,6 +75,9 @@ function _M.startBattleRpc(agent, data) @@ -74,6 +75,9 @@ function _M.startBattleRpc(agent, data)
74 75
75 role:updateProperty({field = "towerInfo", value = towerInfo}) 76 role:updateProperty({field = "towerInfo", value = towerInfo})
76 role:checkTaskEnter("TowerBattle", {level = towerInfo.l}) 77 role:checkTaskEnter("TowerBattle", {level = towerInfo.l})
  78 +
  79 + role:log("tower_action", {desc = "startBattle", int1 = id})
  80 +
77 SendPacket(actionCodes.Tower_startBattleRpc, '') 81 SendPacket(actionCodes.Tower_startBattleRpc, '')
78 return true 82 return true
79 end 83 end
@@ -100,7 +104,7 @@ function _M.endBattleRpc(agent, data) @@ -100,7 +104,7 @@ function _M.endBattleRpc(agent, data)
100 role:setTowerRank(towerInfo.l) 104 role:setTowerRank(towerInfo.l)
101 105
102 towerInfo.l = towerInfo.l + 1 106 towerInfo.l = towerInfo.l + 1
103 - reward = role:award(curTower.reward) 107 + reward = role:award(curTower.reward, {log = {desc = "towerBattle", int1 = id}})
104 role:checkTaskEnter("TowerPass", {level = towerInfo.l - 1}) 108 role:checkTaskEnter("TowerPass", {level = towerInfo.l - 1})
105 end 109 end
106 110
@@ -108,6 +112,9 @@ function _M.endBattleRpc(agent, data) @@ -108,6 +112,9 @@ function _M.endBattleRpc(agent, data)
108 towerInfo.t = nextTime 112 towerInfo.t = nextTime
109 towerInfo.k = nil 113 towerInfo.k = nil
110 role:updateProperty({field = "towerInfo", value = towerInfo}) 114 role:updateProperty({field = "towerInfo", value = towerInfo})
  115 +
  116 + role:log("tower_action", {desc = "startBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id})
  117 +
111 SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward})) 118 SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward}))
112 return true 119 return true
113 end 120 end
@@ -124,12 +131,14 @@ function _M.bugCountRpc(agent, data) @@ -124,12 +131,14 @@ function _M.bugCountRpc(agent, data)
124 cost[k] = v * needCount 131 cost[k] = v * needCount
125 end 132 end
126 if not role:checkItemEnough(cost) then return end 133 if not role:checkItemEnough(cost) then return end
127 - role:costItems(cost) 134 + role:costItems(cost, {log = {desc = "towerCount"}})
128 curCount = globalCsv.tower_count_limit 135 curCount = globalCsv.tower_count_limit
129 end 136 end
130 towerInfo.c = curCount 137 towerInfo.c = curCount
131 towerInfo.t = nextTime 138 towerInfo.t = nextTime
132 role:updateProperty({field = "towerInfo", value = towerInfo}) 139 role:updateProperty({field = "towerInfo", value = towerInfo})
  140 + role:log("tower_action", {desc = "bugCount"})
  141 +
133 SendPacket(actionCodes.Tower_bugCountRpc, '') 142 SendPacket(actionCodes.Tower_bugCountRpc, '')
134 return true 143 return true
135 end 144 end
@@ -23,6 +23,17 @@ function Adv:ctor(owner) @@ -23,6 +23,17 @@ function Adv:ctor(owner)
23 self:initByInfo(self.owner:getProperty("advInfo")) 23 self:initByInfo(self.owner:getProperty("advInfo"))
24 end 24 end
25 25
  26 +function Adv:log(contents)
  27 + contents = contents or {}
  28 + if contents["cint1"] or contents["cint2"] or contents["cint3"] then
  29 + print("advLog error log have cint1 or cint2 or cint3 ", debug.traceback())
  30 + end
  31 + contents["cint1"] = self.chapterId
  32 + contents["cint2"] = self.level
  33 +
  34 + self.owner:log("adv_action", contents)
  35 +end
  36 +
26 --初始化adv 信息 37 --初始化adv 信息
27 function Adv:initByInfo(advInfo) 38 function Adv:initByInfo(advInfo)
28 if not next(advInfo) then return end --还没有 开始新地图 39 if not next(advInfo) then return end --还没有 开始新地图
@@ -244,7 +255,7 @@ end @@ -244,7 +255,7 @@ end
244 function Adv:activeSomeSupport() 255 function Adv:activeSomeSupport()
245 -- 奖励物品 256 -- 奖励物品
246 if self.support[1] then 257 if self.support[1] then
247 - self:award(self.support[1]) 258 + self:award(self.support[1], {log = {desc = "support"}})
248 self.support[1] = nil 259 self.support[1] = nil
249 end 260 end
250 261
@@ -274,7 +285,7 @@ function Adv:activeSomeSupport() @@ -274,7 +285,7 @@ function Adv:activeSomeSupport()
274 end 285 end
275 for i = 1, math.min(self.support[6], #pool) do 286 for i = 1, math.min(self.support[6], #pool) do
276 local idx = math.randomInt(1, #pool) 287 local idx = math.randomInt(1, #pool)
277 - self:award({[pool[idx]] = 1}) 288 + self:award({[pool[idx]] = 1}, {log = {desc = "support"}})
278 table.remove(pool, idx) 289 table.remove(pool, idx)
279 end 290 end
280 self.support[6] = nil 291 self.support[6] = nil
@@ -317,7 +328,7 @@ end @@ -317,7 +328,7 @@ end
317 -- 强制结束 328 -- 强制结束
318 function Adv:forceOver(notNotify) 329 function Adv:forceOver(notNotify)
319 if self:isRunning() then 330 if self:isRunning() then
320 - self:clear() 331 +
321 local advTeam = self.owner:getProperty("advTeam") 332 local advTeam = self.owner:getProperty("advTeam")
322 advTeam.player = nil 333 advTeam.player = nil
323 334
@@ -325,8 +336,9 @@ function Adv:forceOver(notNotify) @@ -325,8 +336,9 @@ function Adv:forceOver(notNotify)
325 for itemId, count in pairs(reward) do 336 for itemId, count in pairs(reward) do
326 reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 337 reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败
327 end 338 end
328 - self.owner:award(reward) 339 + self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}})
329 340
  341 + self:clear()
330 self.owner:updateProperties({ 342 self.owner:updateProperties({
331 advInfo = {}, 343 advInfo = {},
332 advTeam = advTeam, 344 advTeam = advTeam,
@@ -355,7 +367,7 @@ function Adv:checkAdvUnlock(utype, value) @@ -355,7 +367,7 @@ function Adv:checkAdvUnlock(utype, value)
355 end 367 end
356 end 368 end
357 if next(reward) then 369 if next(reward) then
358 - self.owner:award(reward) 370 + self.owner:award(reward, {log = {desc = "advUnlock", int1 = self.chapterId}})
359 end 371 end
360 end 372 end
361 373
@@ -365,7 +377,7 @@ function Adv:clearAdvUnlockCache() @@ -365,7 +377,7 @@ function Adv:clearAdvUnlockCache()
365 reward[itemId] = 1 377 reward[itemId] = 1
366 end 378 end
367 if next(reward) then 379 if next(reward) then
368 - self.owner:award(reward) 380 + self.owner:award(reward, {log = {desc = "advUnlock", int1 = self.chapterId}})
369 end 381 end
370 self.cacheUnlock = {} 382 self.cacheUnlock = {}
371 end 383 end
@@ -427,6 +439,21 @@ function Adv:awardArtifact(id, params) @@ -427,6 +439,21 @@ function Adv:awardArtifact(id, params)
427 if self:isHaveArtifact(id) then return end 439 if self:isHaveArtifact(id) then return end
428 self.owner:changeUpdates({{type = "advAFGet", field = id, value = 1}}, params.notNotify) 440 self.owner:changeUpdates({{type = "advAFGet", field = id, value = 1}}, params.notNotify)
429 self:checkAchievement(Adv.AchievType.GetMWeapon, 1, id) 441 self:checkAchievement(Adv.AchievType.GetMWeapon, 1, id)
  442 +
  443 +
  444 + if params.log then
  445 + local log = clone(params.log)
  446 + if log["cint1"] or log["cint2"] or log["cint3"] then
  447 + print("awardArtifact error log have cint1 or cint2 or cint3 ", debug.traceback())
  448 + end
  449 + log["cint1"] = self.chapterId
  450 + log["cint2"] = self.level
  451 + log["cint3"] = id
  452 + self.owner:log("in_artifact", log)
  453 + else
  454 + print("awardArtifact no log ", debug.traceback())
  455 + end
  456 +
430 self:pushBackEvent(AdvBackEventType.Artifact, {id = id}) 457 self:pushBackEvent(AdvBackEventType.Artifact, {id = id})
431 end 458 end
432 459
@@ -513,6 +540,7 @@ function Adv:wearArtifact(slot, id) @@ -513,6 +540,7 @@ function Adv:wearArtifact(slot, id)
513 else 540 else
514 id = nil 541 id = nil
515 end 542 end
  543 + self:log({desc = "wearArtifact", int1 = id})
516 544
517 self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) 545 self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}})
518 return true 546 return true
@@ -571,6 +599,9 @@ function Adv:artifactLevelUp(id, level) @@ -571,6 +599,9 @@ function Adv:artifactLevelUp(id, level)
571 end 599 end
572 if newLv == advAFGet[id] then return end 600 if newLv == advAFGet[id] then return end
573 601
  602 + self:log({desc = "artifactLevelUp", int1 = id, int2 = level})
  603 +
  604 +
574 local status = 0 605 local status = 0
575 if curWear[id] then -- 穿着呢 606 if curWear[id] then -- 穿着呢
576 local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] 607 local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]]
@@ -595,7 +626,7 @@ function Adv:waitChooseArtifact() @@ -595,7 +626,7 @@ function Adv:waitChooseArtifact()
595 end 626 end
596 end 627 end
597 if #pool == 0 then 628 if #pool == 0 then
598 - self:award({[ItemId.AdvPoint] = 48}) 629 + self:award({[ItemId.AdvPoint] = 48}, {log = {desc = "chooseArtifact"}})
599 else 630 else
600 for i = 1, math.min(count, #pool) do 631 for i = 1, math.min(count, #pool) do
601 local idx = math.randomInt(1, #pool) 632 local idx = math.randomInt(1, #pool)
@@ -613,7 +644,10 @@ end @@ -613,7 +644,10 @@ end
613 644
614 function Adv:chooseArtifact(index) 645 function Adv:chooseArtifact(index)
615 if not self.waitArtifact or not self.waitArtifact[index] then return end 646 if not self.waitArtifact or not self.waitArtifact[index] then return end
616 - self:award({[self.waitArtifact[index]] = 1}) 647 + self:award({[self.waitArtifact[index]] = 1}, {log = {desc = "chooseArtifact"}})
  648 +
  649 + self:log({desc = "chooseArtifact", int1 = self.waitArtifact[index]})
  650 +
617 self.waitArtifact = nil 651 self.waitArtifact = nil
618 652
619 -- 支援效果继续选择 653 -- 支援效果继续选择
@@ -657,7 +691,7 @@ function Adv:over(success, rewardRatio, overType) @@ -657,7 +691,7 @@ function Adv:over(success, rewardRatio, overType)
657 local scoreInfo = self.score 691 local scoreInfo = self.score
658 692
659 local scoreReward = math.floor(score / chapterData.scoreAward) 693 local scoreReward = math.floor(score / chapterData.scoreAward)
660 - self.owner:award({[ItemId.OldCoin] = scoreReward}) 694 + self.owner:award({[ItemId.OldCoin] = scoreReward}, {log = {desc = "advOver", int1 = self.chapterId}})
661 695
662 -- 被动技会影响奖励 696 -- 被动技会影响奖励
663 self.battle.player:triggerPassive(Passive.ADV_OVER, {score = score, level = self.level}) 697 self.battle.player:triggerPassive(Passive.ADV_OVER, {score = score, level = self.level})
@@ -671,7 +705,7 @@ function Adv:over(success, rewardRatio, overType) @@ -671,7 +705,7 @@ function Adv:over(success, rewardRatio, overType)
671 reward[itemId] = math.ceil(count * rewardRatio / 100) 705 reward[itemId] = math.ceil(count * rewardRatio / 100)
672 end 706 end
673 end 707 end
674 - reward = self.owner:award(reward) 708 + reward = self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}})
675 709
676 if success then 710 if success then
677 self.owner:checkTaskEnter("AdvPass", {id = self.chapterId, level = self.level, score = score}) 711 self.owner:checkTaskEnter("AdvPass", {id = self.chapterId, level = self.level, score = score})
@@ -699,6 +733,9 @@ function Adv:over(success, rewardRatio, overType) @@ -699,6 +733,9 @@ function Adv:over(success, rewardRatio, overType)
699 end 733 end
700 end 734 end
701 self:clearAdvUnlockCache() 735 self:clearAdvUnlockCache()
  736 +
  737 + self:log({desc = "over", short1 = success and 1 or 0, int1 = overType})
  738 +
702 self:clear() 739 self:clear()
703 self.owner:checkTaskEnter("AdvScore", {score = score}) 740 self.owner:checkTaskEnter("AdvScore", {score = score})
704 741
@@ -788,6 +825,22 @@ function Adv:award(gift, params) @@ -788,6 +825,22 @@ function Adv:award(gift, params)
788 else 825 else
789 items = items:setv(itemId, nums) 826 items = items:setv(itemId, nums)
790 end 827 end
  828 +
  829 + if params.log then
  830 + local log = clone(params.log)
  831 + if log["cint1"] or log["cint2"] or log["cint3"] then
  832 + print("addAdvItem error log have cint1 or cint2 or cint3 ", debug.traceback())
  833 + end
  834 + log["cint1"] = origin
  835 + log["cint2"] = math.abs(count)
  836 + if count >= 0 then
  837 + self.owner:log("in_adv", log)
  838 + else
  839 + self.owner:log("out_adv", log)
  840 + end
  841 + else
  842 + print("addAdvItem no log ", debug.traceback())
  843 + end
791 end 844 end
792 end 845 end
793 if items ~= oldItems then 846 if items ~= oldItems then
@@ -862,7 +915,7 @@ local function clickOut(self, room, block, params) @@ -862,7 +915,7 @@ local function clickOut(self, room, block, params)
862 self.battle.player:triggerPassive(Passive.DOWN_LAYER) 915 self.battle.player:triggerPassive(Passive.DOWN_LAYER)
863 916
864 if curFloorData then 917 if curFloorData then
865 - self:backReward(self:award({[ItemId.AdvPoint] = curFloorData.exp})) 918 + self:backReward(self:award({[ItemId.AdvPoint] = curFloorData.exp}, {log = {desc = "passReward", int1 = self.chapterId, int2 = self.level}}))
866 end 919 end
867 local isHaveRelay = self:isHaveRelay(self.level) 920 local isHaveRelay = self:isHaveRelay(self.level)
868 921
@@ -870,6 +923,7 @@ local function clickOut(self, room, block, params) @@ -870,6 +923,7 @@ local function clickOut(self, room, block, params)
870 if isHaveRelay and not self.isRelay then 923 if isHaveRelay and not self.isRelay then
871 self:initByChapter(self.chapterId, self.level, true, true, true, false) 924 self:initByChapter(self.chapterId, self.level, true, true, true, false)
872 else 925 else
  926 + self:log({desc = "pass"})
873 self:initByChapter(self.chapterId, self.level + 1, true, true, false, false) 927 self:initByChapter(self.chapterId, self.level + 1, true, true, false, false)
874 end 928 end
875 self:backNext() --下一关 929 self:backNext() --下一关
@@ -985,7 +1039,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) @@ -985,7 +1039,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag)
985 local item = csvdb["event_dropCsv"][effect[2]]["range"]:randWeight(true) 1039 local item = csvdb["event_dropCsv"][effect[2]]["range"]:randWeight(true)
986 reward[item[1]] = (reward[item[1]] or 0) + item[2] 1040 reward[item[1]] = (reward[item[1]] or 0) + item[2]
987 end 1041 end
988 - self:backReward(self:award(reward, {}), {roomId = room.roomId, blockId = block.blockId}) 1042 + self:backReward(self:award(reward, {log = {desc = "chooseEvent", key1 = tag, int1 = chooseData.id}}), {roomId = room.roomId, blockId = block.blockId})
989 end, 1043 end,
990 [2] = function() --获得冒险buff 1044 [2] = function() --获得冒险buff
991 local layer = effect[3] or 1 1045 local layer = effect[3] or 1
@@ -1137,7 +1191,7 @@ local function clickDrop(self, room, block, params) @@ -1137,7 +1191,7 @@ local function clickDrop(self, room, block, params)
1137 local reward = {} 1191 local reward = {}
1138 if not block.event.item then return end 1192 if not block.event.item then return end
1139 self.battle.player:triggerPassive(Passive.CLICK_DROP) 1193 self.battle.player:triggerPassive(Passive.CLICK_DROP)
1140 - local reward = self:award({[block.event.item[1]] = block.event.item[2]}) 1194 + local reward = self:award({[block.event.item[1]] = block.event.item[2]}, {log = {desc = "clickDrop"}})
1141 -- local reward = self:award({[5801] = 1}) 1195 -- local reward = self:award({[5801] = 1})
1142 block:clear() 1196 block:clear()
1143 self:backReward(reward, {roomId = room.roomId, blockId = block.blockId}) 1197 self:backReward(reward, {roomId = room.roomId, blockId = block.blockId})
@@ -1161,7 +1215,7 @@ local function clickTrader(self, room, block, params) @@ -1161,7 +1215,7 @@ local function clickTrader(self, room, block, params)
1161 local costCount = math.ceil(goodsData.price * (block.event.shop[buyId][2] or 100) / 100) 1215 local costCount = math.ceil(goodsData.price * (block.event.shop[buyId][2] or 100) / 100)
1162 if not self:cost({[goodsData.currency] = costCount}, {}) then return false, 6 end --不够 1216 if not self:cost({[goodsData.currency] = costCount}, {}) then return false, 6 end --不够
1163 self:backCost({[goodsData.currency] = costCount}) 1217 self:backCost({[goodsData.currency] = costCount})
1164 - local reward = self:award({[goodsData.item] = goodsData.num}) 1218 + local reward = self:award({[goodsData.item] = goodsData.num}, {log = {desc = "clickTrader", int1 = block.event.id}})
1165 if goodsData.restrict == 1 then 1219 if goodsData.restrict == 1 then
1166 self.shopStatus[goodsData.goods] = (self.shopStatus[goodsData.goods] or 0) + 1 1220 self.shopStatus[goodsData.goods] = (self.shopStatus[goodsData.goods] or 0) + 1
1167 elseif goodsData.restrict == 2 then 1221 elseif goodsData.restrict == 2 then
@@ -1214,7 +1268,7 @@ local function clickClick(self, room, block, params) @@ -1214,7 +1268,7 @@ local function clickClick(self, room, block, params)
1214 local item = csvdb["event_dropCsv"][dropId]["range"]:randWeight(true) 1268 local item = csvdb["event_dropCsv"][dropId]["range"]:randWeight(true)
1215 reward[item[1]] = (reward[item[1]] or 0) + item[2] 1269 reward[item[1]] = (reward[item[1]] or 0) + item[2]
1216 end 1270 end
1217 - self:backReward(self:award(reward, {}), {roomId = room.roomId, blockId = block.blockId}) 1271 + self:backReward(self:award(reward, {log = {desc = "clickClick", int1 = block.event.id}}), {roomId = room.roomId, blockId = block.blockId})
1218 end, 1272 end,
1219 [3] = function() 1273 [3] = function()
1220 for _, buffId in ipairs(clickData.effect:toArray(true, "=")) do 1274 for _, buffId in ipairs(clickData.effect:toArray(true, "=")) do
src/adv/AdvPassive.lua
@@ -447,7 +447,7 @@ function Passive:effect8(dropId) @@ -447,7 +447,7 @@ function Passive:effect8(dropId)
447 skynet.error(string.format("CSVDATA Error adv_map_passive %s effect 8 not id %s in event_drop", self.id, dropId)) 447 skynet.error(string.format("CSVDATA Error adv_map_passive %s effect 8 not id %s in event_drop", self.id, dropId))
448 end 448 end
449 local item = dropData["range"]:randWeight(true) 449 local item = dropData["range"]:randWeight(true)
450 - self.owner.battle.adv:award({[item[1]] = item[2]}) 450 + self.owner.battle.adv:award({[item[1]] = item[2]}, {log = {desc = "passive", int1 = self.id}})
451 end 451 end
452 452
453 --9=直接获得item(可在结算触发时使用) 453 --9=直接获得item(可在结算触发时使用)
@@ -461,13 +461,13 @@ function Passive:effect9(itemId, triggerPms, ratio, max) @@ -461,13 +461,13 @@ function Passive:effect9(itemId, triggerPms, ratio, max)
461 return 461 return
462 end 462 end
463 if not cond then return end 463 if not cond then return end
464 - self.owner.battle.adv:award({[itemId] = math.floor(math.max(0, math.min(max, cond / ratio)))}) 464 + self.owner.battle.adv:award({[itemId] = math.floor(math.max(0, math.min(max, cond / ratio)))}, {log = {desc = "passive", int1 = self.id}})
465 end 465 end
466 466
467 --10=战斗额外掉落次数 467 --10=战斗额外掉落次数
468 function Passive:effect10(count, triggerPms) 468 function Passive:effect10(count, triggerPms)
469 if triggerPms.count then 469 if triggerPms.count then
470 - self.owner.battle.adv:award({[triggerPms.itemId] = triggerPms.count * count}) 470 + self.owner.battle.adv:award({[triggerPms.itemId] = triggerPms.count * count}, {log = {desc = "passive", int1 = self.id}})
471 end 471 end
472 end 472 end
473 473
src/adv/AdvTask.lua
@@ -137,7 +137,7 @@ function AdvTask.bind(Adv) @@ -137,7 +137,7 @@ function AdvTask.bind(Adv)
137 137
138 local item = csvdb["event_dropCsv"][taskData.drop]["range"]:randWeight(true) 138 local item = csvdb["event_dropCsv"][taskData.drop]["range"]:randWeight(true)
139 reward[item[1]] = (reward[item[1]] or 0) + item[2] 139 reward[item[1]] = (reward[item[1]] or 0) + item[2]
140 - reward = self:award(reward) 140 + reward = self:award(reward, {log = {desc = "finishTask", int1 = taskId}})
141 141
142 self:scoreChange(AdvScoreType.Task, taskData.advScore) --增加加分 142 self:scoreChange(AdvScoreType.Task, taskData.advScore) --增加加分
143 143
@@ -155,7 +155,7 @@ function AdvTask.bind(Adv) @@ -155,7 +155,7 @@ function AdvTask.bind(Adv)
155 local mainTaskData = csvdb["adv_questCsv"][self.advMTask.id] 155 local mainTaskData = csvdb["adv_questCsv"][self.advMTask.id]
156 if not mainTaskData then return end 156 if not mainTaskData then return end
157 if mainTaskData.reward == 1 then 157 if mainTaskData.reward == 1 then
158 - reward = self.owner:award(mainTaskData.rewardValue) 158 + reward = self.owner:award(mainTaskData.rewardValue, {log = {desc = "advMainTask", int1 = self.advMTask.id}})
159 end 159 end
160 self.advMTask.id = self.advMTask.id + 1 160 self.advMTask.id = self.advMTask.id + 1
161 self.advMTask.status = 0 161 self.advMTask.status = 0
@@ -347,7 +347,7 @@ function AdvTask.bind(Adv) @@ -347,7 +347,7 @@ function AdvTask.bind(Adv)
347 insertChange(chapterId, -1, count) 347 insertChange(chapterId, -1, count)
348 348
349 -- 发放奖励 349 -- 发放奖励
350 - reward = self.owner:award(achievData.reward) 350 + reward = self.owner:award(achievData.reward, {log = {desc = "advAchiev", int1 = chapterId, int2 = taskId}})
351 return true, reward 351 return true, reward
352 end 352 end
353 end 353 end
@@ -359,7 +359,7 @@ function AdvTask.bind(Adv) @@ -359,7 +359,7 @@ function AdvTask.bind(Adv)
359 local status = ((self.owner:getProperty(achievField)[chapterId] or {})["pts"] or {})[taskId] or 0 359 local status = ((self.owner:getProperty(achievField)[chapterId] or {})["pts"] or {})[taskId] or 0
360 if status == -1 or count < achievData.pt then return end 360 if status == -1 or count < achievData.pt then return end
361 361
362 - local reward = self.owner:award(achievData.reward) 362 + local reward = self.owner:award(achievData.reward, {log = {desc = "advAchievReward", int1 = chapterId, int2 = taskId}})
363 insertChange(chapterId, taskId, -1, true) 363 insertChange(chapterId, taskId, -1, true)
364 return true, reward 364 return true, reward
365 end 365 end
@@ -287,7 +287,12 @@ local function routeGM(cmd, params) @@ -287,7 +287,12 @@ local function routeGM(cmd, params)
287 return "指令失败" 287 return "指令失败"
288 end 288 end
289 local _M = require "actions.GmAction" 289 local _M = require "actions.GmAction"
290 - return _M[cmd](agentInfo.role, params) 290 +
  291 + agentInfo.role:startActionUcode()
  292 + local status = _M[cmd](agentInfo.role, params)
  293 + agentInfo.role:endActionUcode()
  294 +
  295 + return status
291 end 296 end
292 297
293 skynet.start(function() 298 skynet.start(function()
src/models/HeroPlugin.lua
@@ -3,6 +3,17 @@ local HeroPlugin = {} @@ -3,6 +3,17 @@ local HeroPlugin = {}
3 3
4 function HeroPlugin.bind(Hero) 4 function HeroPlugin.bind(Hero)
5 5
  6 + function Hero:log(contents)
  7 + contents = contents or {}
  8 + if contents["cint1"] or contents["cint2"] or contents["cint3"] then
  9 + print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback())
  10 + end
  11 + contents["cint1"] = self:getProperty("id")
  12 + contents["cint2"] = self:getProperty("type")
  13 +
  14 + self.owner:log("hero_action", contents)
  15 + end
  16 +
6 function Hero:getMaxLevel() 17 function Hero:getMaxLevel()
7 return math.min(#csvdb["unit_expCsv"], csvdb["unit_breakCsv"][self:getProperty("breakL")].levelLimit) 18 return math.min(#csvdb["unit_expCsv"], csvdb["unit_breakCsv"][self:getProperty("breakL")].levelLimit)
8 end 19 end
src/models/RoleCross.lua
@@ -73,7 +73,7 @@ RoleCross.bind = function (Role) @@ -73,7 +73,7 @@ RoleCross.bind = function (Role)
73 for k , v in pairs(initData.items or {}) do 73 for k , v in pairs(initData.items or {}) do
74 reward[tonumber(k)] = v 74 reward[tonumber(k)] = v
75 end 75 end
76 - self:award(reward) 76 + self:award(reward, {log = {desc = "gm"}})
77 77
78 -- 英雄 78 -- 英雄
79 local breakL = 0 79 local breakL = 0
@@ -95,7 +95,7 @@ RoleCross.bind = function (Role) @@ -95,7 +95,7 @@ RoleCross.bind = function (Role)
95 local hero = self:isHaveHero(heroId) 95 local hero = self:isHaveHero(heroId)
96 local status 96 local status
97 if not hero then 97 if not hero then
98 - status, hero = self:addHero({type = heroId}) 98 + status, hero = self:addHero({type = heroId, log = {desc = "gm"}})
99 else 99 else
100 status = true 100 status = true
101 end 101 end
@@ -103,7 +103,7 @@ RoleCross.bind = function (Role) @@ -103,7 +103,7 @@ RoleCross.bind = function (Role)
103 local rune = "" 103 local rune = ""
104 for slot , runeId in pairs(initData.heros.rune) do 104 for slot , runeId in pairs(initData.heros.rune) do
105 slot = tonumber(slot) 105 slot = tonumber(slot)
106 - local status, rune_ = self:addRune({type = slot, id = runeId}) 106 + local status, rune_ = self:addRune({type = slot, id = runeId, log = {desc = "gm"}})
107 if status == 0 then 107 if status == 0 then
108 rune = rune:setv(slot, rune_:getProperty("uid")) 108 rune = rune:setv(slot, rune_:getProperty("uid"))
109 if initData.heros.runeL and initData.heros.runeL > 0 then 109 if initData.heros.runeL and initData.heros.runeL > 0 then
src/models/RoleLog.lua
@@ -4,8 +4,8 @@ local LogType = { @@ -4,8 +4,8 @@ local LogType = {
4 create = "common", 4 create = "common",
5 login = "common", 5 login = "common",
6 logout = "common", 6 logout = "common",
7 - gm = "common",  
8 - mail_actions = "common", 7 + guide = "common",
  8 +
9 in_item = "common", 9 in_item = "common",
10 out_item = "common", 10 out_item = "common",
11 in_diamond = "common", 11 in_diamond = "common",
@@ -18,10 +18,20 @@ local LogType = { @@ -18,10 +18,20 @@ local LogType = {
18 out_rune = "common", 18 out_rune = "common",
19 player_exp = "common", 19 player_exp = "common",
20 func_open = "common", 20 func_open = "common",
  21 + in_adv = "common",
  22 + out_adv = "common",
  23 + in_artifact = "common",
  24 +
  25 + mail_action = "common",
21 role_action = "common", 26 role_action = "common",
22 - guide = "common",  
23 - guide_sys = "common",  
24 - guide_weak = "common", 27 + hang_action = "common",
  28 + hero_action = "common",
  29 + adv_action = "common",
  30 + rune_action = "common",
  31 + pvp_action = "common",
  32 + diner_action = "common",
  33 + tower_action = "common",
  34 + gm_action = "common",
25 } 35 }
26 36
27 -- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* 37 -- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-*
src/models/RolePlugin.lua
@@ -669,7 +669,7 @@ function RolePlugin.bind(Role) @@ -669,7 +669,7 @@ function RolePlugin.bind(Role)
669 end 669 end
670 if heartWarning < 50 and heartWarning % 5 == 0 then 670 if heartWarning < 50 and heartWarning % 5 == 0 then
671 self:sendGmMsg("server_accountBanned_warning") 671 self:sendGmMsg("server_accountBanned_warning")
672 - self:log("gm",{desc = "heartWarning", int1 = heartWarning}) 672 + self:log("role_action",{desc = "heartWarning", int1 = heartWarning})
673 end 673 end
674 end 674 end
675 675
@@ -682,11 +682,11 @@ function RolePlugin.bind(Role) @@ -682,11 +682,11 @@ function RolePlugin.bind(Role)
682 self:setProperty("banType", 0) 682 self:setProperty("banType", 0)
683 self:setProperty("heartWarning", 0) 683 self:setProperty("heartWarning", 0)
684 684
685 - self:log("gm", {desc = "ban_rm"}) 685 + self:log("role_action", {desc = "ban_rm"})
686 else 686 else
687 self:setProperty("banTime", now + 86400 * time) 687 self:setProperty("banTime", now + 86400 * time)
688 self:setProperty("banType", banType) 688 self:setProperty("banType", banType)
689 - self:log("gm",{desc = "ban", int1 = time, int2 = banType}) 689 + self:log("role_action", {desc = "ban", int1 = time, int2 = banType})
690 end 690 end
691 end 691 end
692 692
src/models/RolePvp.lua
@@ -467,7 +467,7 @@ function Role:getCrossServerPvpBetInfo() @@ -467,7 +467,7 @@ function Role:getCrossServerPvpBetInfo()
467 end 467 end
468 end 468 end
469 469
470 -function Role:getCrossServerPvpBet(idx) 470 +function Role:setCrossServerPvpBet(idx)
471 if not self:isTimeResetOpen(TimeReset.PvpCross) then return end 471 if not self:isTimeResetOpen(TimeReset.PvpCross) then return end
472 local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) 472 local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross)
473 local aday = 3600 * 24 473 local aday = 3600 * 24
@@ -486,7 +486,7 @@ function Role:getCrossServerPvpBet(idx) @@ -486,7 +486,7 @@ function Role:getCrossServerPvpBet(idx)
486 local ok, result = pcall(skynet.call, pvpd, "lua", "setBet", idx) 486 local ok, result = pcall(skynet.call, pvpd, "lua", "setBet", idx)
487 if ok then 487 if ok then
488 if result then 488 if result then
489 - self:costItems(cost) 489 + self:costItems(cost, {log = {desc = "crossPvpBet", short1 = day}})
490 pvpBet[day] = {idx, cost[ItemId.Gold]} 490 pvpBet[day] = {idx, cost[ItemId.Gold]}
491 self:setProperty("pvpBet", pvpBet) 491 self:setProperty("pvpBet", pvpBet)
492 end 492 end
src/models/Rune.lua
@@ -26,6 +26,18 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) @@ -26,6 +26,18 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue)
26 self:notifyUpdateProperties(datas) 26 self:notifyUpdateProperties(datas)
27 end 27 end
28 28
  29 +function Rune:log(contents)
  30 + contents = contents or {}
  31 + if contents["cint1"] or contents["cint2"] or contents["cint3"] then
  32 + print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback())
  33 + end
  34 + contents["cint1"] = self:getProperty("uid")
  35 + contents["cint2"] = self:getProperty("type")
  36 + contents["cint3"] = self:getProperty("id")
  37 +
  38 + self.owner:log("rune_action", contents)
  39 +end
  40 +
29 function Rune:notifyUpdateProperties(params) 41 function Rune:notifyUpdateProperties(params)
30 local updateData = { 42 local updateData = {
31 uid = self:getProperty("uid"), 43 uid = self:getProperty("uid"),