Commit 887c1843acebc1d342c93f68d5589343da0636b9

Authored by zhouhaihai
1 parent c59e058b

日志新一批

src/actions/ActivityAction.lua
... ... @@ -68,7 +68,7 @@ function _M.sudokuRpc(agent, data)
68 68 role:log("activity", {
69 69 activity_id = id, -- 活动ID(或活动指定任务的ID)
70 70 activity_type = 0, -- 活动类型,见活动类型枚举表
71   - activity_reward = json.encode(reward), -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
  71 + activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
72 72 })
73 73  
74 74 SendPacket(actionCodes.Activity_sudokuRpc, MsgPack.pack({task = role:packReward(task, tchange), reward = role:packReward(reward, rchange), rId = rId}))
... ... @@ -107,7 +107,7 @@ function _M.sudokuRewardRpc(agent, data)
107 107 role:log("activity", {
108 108 activity_id = 10000 + phase, -- 活动ID(或活动指定任务的ID)
109 109 activity_type = 0, -- 活动类型,见活动类型枚举表
110   - activity_reward = json.encode(reward), -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
  110 + activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
111 111 })
112 112  
113 113 SendPacket(actionCodes.Activity_sudokuRewardRpc, MsgPack.pack(role:packReward(reward, change)))
... ... @@ -170,7 +170,7 @@ function _M.actSignRpc(agent, data)
170 170 role:log("activity", {
171 171 activity_id = curData[0], -- 活动ID(或活动指定任务的ID)
172 172 activity_type = role.activity.ActivityType.Sign, -- 活动类型,见活动类型枚举表
173   - activity_reward = json.encode(reward), -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
  173 + activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
174 174 })
175 175  
176 176 SendPacket(actionCodes.Activity_actSignRpc, MsgPack.pack(role:packReward(reward, change)))
... ...
src/actions/AdvAction.lua
... ... @@ -254,7 +254,6 @@ function _M.startHangRpc(agent, data)
254 254  
255 255 role:changeAdvCount(adv_idle_energy)
256 256 role:checkTaskEnter("AdvStart", {id = chapterId})
257   - role:log("adv_action", {desc = "startHang", int1 = chapterId})
258 257  
259 258 SendPacket(actionCodes.Adv_startHangRpc, '')
260 259 return true
... ... @@ -294,8 +293,6 @@ function _M.quickHangRpc(agent, data)
294 293 info.time = 0
295 294 role:changeUpdates({{type = "advHang", field = chapterId, value = info}})
296 295  
297   - role:log("adv_action", {desc = "advQuickHang", int1 = chapterId})
298   -
299 296 SendPacket(actionCodes.Adv_quickHangRpc, '')
300 297 return true
301 298 end
... ... @@ -376,8 +373,6 @@ function _M.endHangRpc(agent, data)
376 373  
377 374 role:changeUpdates({{type = "advHang", field = chapterId, value = nil}})
378 375  
379   - role:log("adv_action", {desc = "endHang", int1 = chapterId, short1 = cancel and 1 or 0})
380   -
381 376 SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, change = change, isFull = isFull}))
382 377 return true
383 378 end
... ... @@ -399,7 +394,7 @@ function _M.buyAdvCountRpc(agent , data)
399 394  
400 395  
401 396 if not role:checkItemEnough(cost) then return end
402   - role:costItems(cost, {log = {desc = "buyAdvCount", short1 = isEl and 1 or 0, int1 = count}})
  397 + role:costItems(cost, {log = {desc = "buyAdvCount", int1 = isEl and 1 or 0, int2 = count}})
403 398 if isEl then
404 399 role.dailyData:updateProperty({field = "advElC", delta = -count})
405 400 role.dailyData:updateProperty({field = "advElBC", delta = count})
... ... @@ -407,7 +402,6 @@ function _M.buyAdvCountRpc(agent , data)
407 402 role:changeAdvCount(-count * globalCsv.adv_daily_buy_num)
408 403 role.dailyData:updateProperty({field = "advBC", delta = count})
409 404 end
410   - role:log("adv_action", {desc = "buyAdvCount", short1 = isEl and 1 or 0, int1 = count})
411 405  
412 406 SendPacket(actionCodes.Adv_buyAdvCountRpc, '')
413 407 return true
... ... @@ -432,8 +426,6 @@ function _M.finishTaskRpc(agent, data)
432 426 if not status then return end
433 427 role:checkTaskEnter("AdvOverTask", {id = taskId})
434 428  
435   - adv:log({desc = "finishTask", int1 = taskId})
436   -
437 429 SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack(role:packReward(reward, change)))
438 430 return true
439 431 end
... ... @@ -455,8 +447,6 @@ function _M.clickBlockRpc(agent, data)
455 447  
456 448 if adv:isWaitChooseArtifact() then return returnFail() end
457 449  
458   - adv:log({desc = "clickBlock", int1 = msg.roomId, int2 = msg.blockId})
459   -
460 450 local status, errorCode = adv:clickBlock(msg.roomId, msg.blockId, msg)
461 451 if not status then return returnFail(errorCode) end
462 452  
... ... @@ -494,7 +484,6 @@ function _M.useItemRpc(agent, data)
494 484 end
495 485  
496 486 adv:checkAchievement(adv.AchievType.UseItem, count, itemId)
497   - adv:log({desc = "useItem", int1 = itemId, int2 = count})
498 487  
499 488 for i = 1, count do
500 489 adv:doActive(itemData.effect, target) -- target
... ... @@ -530,7 +519,6 @@ function _M.usePotionRpc(agent, data)
530 519 local adv = role:getAdvData()
531 520 if adv:isWaitChooseArtifact() then return end
532 521  
533   - adv:log({desc = "usePotion", int1 = potionId})
534 522  
535 523 local status = adv:doActive(potionData.effect, target) -- target
536 524 if not status then return end
... ... @@ -631,7 +619,6 @@ function _M.exitAdvRpc(agent, data)
631 619 role:saveGuide(57,1,true)
632 620 end
633 621 local adv = role:getAdvData()
634   - adv:log({desc = "exit"})
635 622 local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标
636 623 SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()}))
637 624 return true
... ... @@ -703,7 +690,6 @@ function _M.endBattleRpc(agent, data)
703 690 end
704 691 end
705 692  
706   - adv:log({desc = "endBattle"})
707 693 local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill})
708 694  
709 695 if not status then return end
... ... @@ -787,7 +773,6 @@ function _M.wheelSurfRpc(agent, data)
787 773 role:award(reward, {log = {desc = "advWheelSurf", int1 = ptype}})
788 774 role:finishGuide(58)
789 775 role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype})
790   - role:log("adv_action", {desc = "advWheelSurf", int1 = ptype, int2 = count})
791 776  
792 777 SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward}))
793 778 return true
... ... @@ -816,7 +801,6 @@ function _M.repayWheelSurfRpc(agent, data)
816 801 local gift = drawData["pool3"]:randWeight(true)
817 802 local reward, change = {[gift[1]] = gift[2]}
818 803 reward, change = role:award(reward, {log = {desc = "advRepayWheelSurf", int1 = ptype}})
819   - role:log("adv_action", {desc = "advRepayWheelSurf", int1 = ptype})
820 804  
821 805 SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack(role:packReward(reward, change)))
822 806 return true
... ... @@ -839,7 +823,6 @@ function _M.finishAchievRpc(agent, data)
839 823 end
840 824 if not status then return end
841 825 adv:updateAchievement()
842   - role:log("adv_action", {desc = "finishAchiev", short1 = ctype, int1 = chapterId, int2 = taskId})
843 826 role:finishGuide(57)
844 827 SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack(role:packReward(reward, change)))
845 828 return true
... ... @@ -896,7 +879,6 @@ function _M.refreshSupportRpc(agent, data)
896 879 end
897 880  
898 881 role:advRandomSupportEffect()
899   - role:log("adv_action", {desc = "advSupRe", short1 = cr < al and 0 or 1})
900 882  
901 883 SendPacket(actionCodes.Adv_refreshSupportRpc, '')
902 884 return true
... ...
src/actions/CarAction.lua
... ... @@ -40,13 +40,12 @@ function _M.makePotionRpc( agent, data )
40 40 role:updateProperty({field = "potionBag", value = potionBag})
41 41 role:checkTaskEnter("PotionMake", {count = count, id = potionId})
42 42  
43   - role:log("role_action", {desc = "makePotion", int1 = potionId, int2 = count})
44 43 role:log("carriage_cook", {
45 44 item_id = potionId, -- 道具id
46 45 item_level = potionLv, -- 道具等级
47 46 item_type = 0, -- 道具类型,具体见枚举表中道具类型枚举表
48 47 carriage_cook_amount = count, -- 制作总量
49   - carriage_cook_cost = json.encode(cost), -- 制作消耗道具,json格式记录,{'itemid1':10,'itemid2':5,…………..}
  48 + carriage_cook_cost = cost, -- 制作消耗道具,json格式记录,{'itemid1':10,'itemid2':5,…………..}
50 49 })
51 50 SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag}))
52 51 return true
... ... @@ -104,7 +103,7 @@ function _M.equipUpRpc( agent, data )
104 103 equip_upgrade_amount = count, -- 升级获取的装备数量
105 104 equip_upgrade_usedid = lv, -- 升级消耗的装备ID
106 105 equip_upgrade_cost = costCount, -- 升级操作消耗装备数量
107   - equip_upgrade_current = json.encode(cost), -- 升级消耗的货币类型
  106 + equip_upgrade_current = cost, -- 升级消耗的货币类型
108 107 })
109 108  
110 109 SendPacket(actionCodes.Car_equipUpRpc, '')
... ... @@ -181,8 +180,6 @@ function _M.saleEquipRpc(agent, data )
181 180 role:checkTaskEnter("SaleEquip", {count = allCount})
182 181 reward, change = role:award(reward, {log = {desc = "saleEquip"}})
183 182  
184   - role:log("role_action", {desc = "saleEquip", int1 = allCount})
185   -
186 183 SendPacket(actionCodes.Car_saleEquipRpc, MsgPack.pack(role:packReward(reward, change)))
187 184 return true
188 185 end
... ...
src/actions/DinerAction.lua
... ... @@ -105,7 +105,6 @@ function _M.addSellRpc( agent, data )
105 105 role.dinerData:updateProperty({field = "customer", value = customer})
106 106 end
107 107 role:finishGuide(28)
108   - role:log("diner_action", {desc = "addSell", int1 = dish, int2 = count})
109 108  
110 109 role.dinerData:updateProperty({field = "sells", value = json.encode(sells)})
111 110 SendPacket(actionCodes.Diner_addSellRpc, "")
... ... @@ -312,8 +311,6 @@ function _M.expediteSellRpc( agent, data )
312 311 end
313 312 role:checkTaskEnter("FoodSellQuick")
314 313  
315   - role:log("diner_action", {desc = "sellQ"})
316   -
317 314 SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward, change = change, popular = popular}))
318 315 return true
319 316 end
... ... @@ -442,7 +439,6 @@ function _M.talentUpRpc( agent, data )
442 439  
443 440 role:checkTaskEnter("DinerTalentUp", {type = talentData.effect:toArray(true,"=")[1], level = dishLevel + 1})
444 441 role:finishGuide(27)
445   - role:log("diner_action", {desc = "talentUp", int1 = dish, int2 = dishLevel + 1})
446 442 role:log("carriage_logistics", {
447 443 carriage_logistics_type = typ, -- 后勤室制作类型ID,变异:0,通常:1,魔法:2
448 444 carriage_logistics_itemid = dish, -- 后勤室升级物品或技能ID
... ... @@ -483,7 +479,6 @@ function _M.skillUpRpc( agent, data )
483 479  
484 480 role:costItems(cost, {log = {desc = "dinerSkillUp", int1 = skill, int2 = skillLevel + 1}})
485 481 role.dinerData:updateProperty({field = "skillTree", value = skillTree:setv(skill, skillLevel + 1)})
486   - role:log("diner_action", {desc = "skillUp", int1 = skill, int2 = skillLevel + 1})
487 482  
488 483 SendPacket(actionCodes.Diner_skillUpRpc, '')
489 484 return true
... ... @@ -511,8 +506,6 @@ function _M.lockTaskRpc( agent, data )
511 506 end
512 507 role.dinerData:updateProperty({field = "order", value = json.encode(orders)})
513 508  
514   - role:log("diner_action", {desc = "lockTask", int1 = order.id})
515   -
516 509 SendPacket(actionCodes.Diner_lockTaskRpc, MsgPack.pack({lock = order.lock}))
517 510 return true
518 511 end
... ... @@ -576,7 +569,7 @@ function _M.updateTaskRpc( agent, data )
576 569 role:log("restaurant_order", {
577 570 restaurant_order_id = order.id, -- 订单任务ID
578 571 restaurant_order_status = cmd, -- 订单任务状态,接受:0, 拒绝:1, 完成:2
579   - restaurant_order_rwd = json.encode(reward), -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
  572 + restaurant_order_rwd = reward, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
580 573 restaurant_order_lv = taskSet.rarity, -- 订单品质等级,普通:0, 稀有:1, 顶级:2, 豪华:3
581 574 })
582 575  
... ... @@ -654,7 +647,6 @@ function _M.refreshTaskRpc( agent, data )
654 647 end
655 648 end
656 649  
657   - role:log("diner_action", {desc = "reTask"})
658 650 role:finishGuide(41)
659 651 role.dinerData:updateProperty({field = "order", value = json.encode(orders)})
660 652  
... ... @@ -695,7 +687,6 @@ function _M.addWantFoodRpc(agent , data)
695 687 gfood[slot] = {id = itemId, st = skynet.timex()}
696 688 end
697 689  
698   - role:log("diner_action", {desc = "wantFood"})
699 690 role:finishGuide(36)
700 691 role.dinerData:updateProperty({field = "gfood", value = gfood})
701 692  
... ... @@ -880,8 +871,6 @@ function _M.entrustRpc(agent , data)
880 871 end
881 872 role.dinerData:updateProperty({field = "entrust", value = entrust})
882 873  
883   - role:log("diner_action", {desc = "entrus", short1 = ctype, int1 = entrustId})
884   -
885 874 role:finishGuide(26)
886 875  
887 876 SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward, change = change}))
... ... @@ -916,7 +905,7 @@ function _M.collectRpc(agent , data)
916 905  
917 906 role:log("restaurant_collect", {
918 907 restaurant_collect_id = id, -- 图谱收集ID
919   - restaurant_collect_rwd = json.encode(reward), -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
  908 + restaurant_collect_rwd = reward, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
920 909 restaurant_collect_plan = count, -- 收集进度,即解锁顾客,数字表示
921 910 })
922 911  
... ... @@ -948,8 +937,6 @@ function _M.comboRewardRpc(agent , data)
948 937  
949 938 role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了
950 939  
951   - role:log("diner_action", {desc = "combo", int1 = id})
952   -
953 940 SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward, change = change}))
954 941 return true
955 942 end
... ...
src/actions/FriendAction.lua
... ... @@ -111,7 +111,6 @@ function _M.searchRpc(agent, data)
111 111 }))
112 112 end
113 113  
114   - role:log("role_action", {desc = "searchFriend"})
115 114 SendPacket(actionCodes.Friend_searchRpc, MsgPack.pack({searchList = searchList}))
116 115 return true
117 116 end
... ... @@ -178,8 +177,6 @@ function _M.applyRpc(agent, data)
178 177 myInfo.online = true
179 178 myInfo.hadApply = true
180 179  
181   - role:log("role_action", {desc = "addFriend", int1 = 1})
182   -
183 180 rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方
184 181 end
185 182  
... ... @@ -350,8 +347,6 @@ function _M.handleApplyRpc(agent, data)
350 347 rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {myInfo}})) -- 通知对方
351 348 end
352 349 if next(needAdd) then
353   - role:log("role_action", {desc = "addFriend", int1 = #needAdd})
354   -
355 350 SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = needAddInfo}))
356 351 else
357 352 result = 1
... ... @@ -558,8 +553,6 @@ function _M.pointRpc(agent, data)
558 553 role.dailyData:updateProperty({field = "giveFP", value = giveP})
559 554 role:checkTaskEnter("GiveFriendP", {count = 1})
560 555 rpcRole(objId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newPoint = 1, roleId = roleId}))
561   -
562   - role:log("role_action", {desc = "giveFPoint", int1 = 1})
563 556 end
564 557 elseif cmd == 2 then -- 领取
565 558 local objId = msg.roleId
... ... @@ -579,7 +572,6 @@ function _M.pointRpc(agent, data)
579 572 role.dailyData:updateProperty({field = "getFP", value = getP})
580 573 role:checkTaskEnter("GetFriendP", {count = 1})
581 574  
582   - role:log("role_action", {desc = "getFPoint", int1 = 1})
583 575 end
584 576 elseif cmd == 3 then -- 一键赠送领取
585 577 -- 赠送
... ... @@ -601,8 +593,6 @@ function _M.pointRpc(agent, data)
601 593 role.dailyData:updateProperty({field = "giveFP", value = giveP})
602 594 role:checkTaskEnter("GiveFriendP", {count = change})
603 595  
604   - role:log("role_action", {desc = "giveFPoint", int1 = change})
605   -
606 596 else
607 597 result = 1
608 598 end
... ... @@ -627,7 +617,6 @@ function _M.pointRpc(agent, data)
627 617 reward = role:award({[ItemId.FriendPoint] = getCount}, {log = {desc = "friendPoint"}})
628 618 role.dailyData:updateProperty({field = "getFP", value = getP})
629 619 role:checkTaskEnter("GetFriendP", {count = getCount})
630   - role:log("role_action", {desc = "getFPoint", int1 = getCount})
631 620 else
632 621 result = (result or 0) + 2
633 622 end
... ...
src/actions/GmAction.lua
... ... @@ -27,7 +27,6 @@ function _M.ignoreout(role, pms)
27 27 else -- 解除
28 28 role:updateProperty({field = "ignoreMt", value = 0})
29 29 end
30   - role:log("gm_action", {desc = "ignoreout", key1 = pms.sender})
31 30 return "指令生效"
32 31 end
33 32  
... ... @@ -47,17 +46,11 @@ function _M.ban(role, pms)
47 46 end)
48 47 end
49 48 end
50   -
51   - role:log("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender})
52   -
53 49 return isBan and "解封杀成功" or "封杀成功"
54 50 end
55 51  
56 52 function _M.unban(role, pms)
57 53 role:setBan(0, 0)
58   -
59   - role:log("gm_action", {desc = "unban", key1 = pms.sender})
60   -
61 54 return "解封杀成功"
62 55 end
63 56  
... ... @@ -70,8 +63,6 @@ function _M.gmmsg(role, pms)
70 63 skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd)
71 64 end)
72 65 end
73   - role:log("gm_action", {desc = "gmmsg", text1 = pms.pm1, key1 = pms.sender})
74   -
75 66 return "指令成功"
76 67 end
77 68  
... ... @@ -82,8 +73,6 @@ function _M.silent(role, pms)
82 73 return "解禁言成功"
83 74 end
84 75 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})
87 76 return "禁言成功"
88 77 end
89 78  
... ... @@ -101,8 +90,6 @@ function _M.hero(role, pms)
101 90 if not role:addHero({type = heroType, log = {desc = "gm"}}) then
102 91 return "失败"
103 92 end
104   -
105   - role:log("gm_action", {desc = "hero", int1 = heroType, key1 = pms.sender})
106 93 return "成功"
107 94 end
108 95  
... ... @@ -135,8 +122,6 @@ function _M.herol(role, pms)
135 122 hero:updateProperty({field = "level", delta = addLevel})
136 123 role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")})
137 124  
138   - role:log("gm_action", {desc = "herol", int1 = heroType, int2 = addLevel, key1 = pms.sender})
139   -
140 125 return "成功"
141 126 end
142 127  
... ... @@ -148,8 +133,6 @@ function _M.herola(role, pms)
148 133 _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel})
149 134 end
150 135  
151   - role:log("gm_action", {desc = "herola", int1 = addLevel, key1 = pms.sender})
152   -
153 136 return "成功"
154 137 end
155 138  
... ... @@ -160,7 +143,6 @@ function _M.equip(role, pms)
160 143 local level = tonum(pms.pm2)
161 144 local count = tonum(pms.pm3)
162 145 role:addEquip(typ, level, count, {log = {desc = "gm"}})
163   - role:log("gm_action", {desc = "equip", int1 = typ, int2 = level, long1 = count, key1 = pms.sender})
164 146 return "成功"
165 147 end
166 148  
... ... @@ -169,7 +151,6 @@ function _M.rune(role, pms)
169 151 local typ = tonum(pms.pm1)
170 152 local id = tonum(pms.pm2)
171 153 local result = role:addRune({type = typ,id = id, log = {desc = "gm"}})
172   - role:log("gm_action", {desc = "rune", int1 = typ, int2 = id, key1 = pms.sender})
173 154  
174 155 return result
175 156 end
... ... @@ -190,8 +171,6 @@ function _M.fb(role, pms) -- 直接通关
190 171 role:hangFinish(carbonId)
191 172 addPre(carbonId)
192 173  
193   - role:log("gm_action", {desc = "fb", int1 = carbonId, key1 = pms.sender})
194   -
195 174 role:checkTaskEnter("HangPass", {id = carbonId})
196 175 return "成功"
197 176 end
... ... @@ -212,8 +191,6 @@ function _M.fbc(role, pms) -- 直接通关
212 191 end
213 192 role:updateProperty({field = "hangPass", value = {}})
214 193 addPre(carbonId)
215   -
216   - role:log("gm_action", {desc = "fbc", int1 = carbonId, key1 = pms.sender})
217 194  
218 195 return "成功"
219 196 end
... ... @@ -247,8 +224,6 @@ function _M.exp(role, pms)
247 224 exp = math.floor(math.max(exp, 0))
248 225 role:addPlayExp(exp, {log = {desc = "gm"}})
249 226  
250   - role:log("gm_action", {desc = "exp", int1 = exp, key1 = pms.sender})
251   -
252 227 return "成功"
253 228 end
254 229  
... ... @@ -305,7 +280,6 @@ function _M.get(role, pms)
305 280 end
306 281 local count = tonum(pms.pm2, 1)
307 282 role:award({[itemId] = count}, {log = {desc = "gm"}})
308   - role:log("gm_action", {desc = "get", int1 = itemId, int2 = count, key1 = pms.sender})
309 283 end
310 284 return "成功"
311 285 end
... ... @@ -329,9 +303,6 @@ function _M.advc(role, pms)
329 303 advAFWear = {},
330 304 }, notNotify)
331 305 role.advData = nil
332   -
333   - role:log("gm_action", {desc = "advc", key1 = pms.sender})
334   -
335 306 return "成功"
336 307 end
337 308  
... ... @@ -340,8 +311,6 @@ function _M.advf(role, pms)
340 311 role:updateProperty({field = "advC", value = 0})
341 312 role.dailyData:updateProperty({field = "advElC", value = 0})
342 313  
343   - role:log("gm_action", {desc = "advf", key1 = pms.sender})
344   -
345 314 return "成功"
346 315 end
347 316  
... ... @@ -361,7 +330,6 @@ function _M.adv(role, pms)
361 330 advPass[chapterId] = layer
362 331 role:updateProperty({field = "advPass", value = advPass})
363 332 end
364   - role:log("gm_action", {desc = "adv", int1 = chapterId, int2 = layer, key1 = pms.sender})
365 333  
366 334 return "成功"
367 335 end
... ... @@ -388,7 +356,6 @@ function _M.advt(role, pms)
388 356 isEnter = true,
389 357 debugMapId = mapId,
390 358 })
391   - role:log("gm_action", {desc = "advt", int1 = chapterId, int2 = layer, key1 = pms.sender})
392 359 return "成功"
393 360 end
394 361  
... ... @@ -397,8 +364,6 @@ function _M.advl(role, pms)
397 364 local exp = tonum(pms.pm1)
398 365 role:addAdvLvExp(math.max(0, exp))
399 366  
400   - role:log("gm_action", {desc = "advl", int1 = exp, key1 = pms.sender})
401   -
402 367 return "成功"
403 368 end
404 369  
... ... @@ -412,7 +377,6 @@ function _M.advcl(role, pms)
412 377 end
413 378 advData.battle.player:addExp(exp)
414 379 advData:saveDB()
415   - role:log("gm_action", {desc = "advcl", int1 = exp, key1 = pms.sender})
416 380  
417 381 return "成功"
418 382 end
... ... @@ -422,7 +386,6 @@ function _M.idlec(role, pms)
422 386 role:updateProperty({field = "hangTeam", value = {}})
423 387 role:updateProperty({field = "hangInfo", value = {}})
424 388 role:updateProperty({field = "hangBag", value = {}})
425   - role:log("gm_action", {desc = "idlec", key1 = pms.sender})
426 389  
427 390 role.advData = nil
428 391 return "成功"
... ... @@ -447,8 +410,6 @@ function _M.advit(role, pms)
447 410 local itemId = tonum(pms.pm1)
448 411 local count = tonum(pms.pm2)
449 412 reward[itemId] = count
450   -
451   - role:log("gm_action", {desc = "advit", int1 = itemId, int2 = count, key1 = pms.sender})
452 413 end
453 414  
454 415  
... ... @@ -464,8 +425,6 @@ function _M.tower(role, pms)
464 425 if not csvdb["tower_battleCsv"][level] then return "不存在" end
465 426 role:updateProperty({field = "towerInfo", value = {c = globalCsv.tower_count_limit, l = level}})
466 427  
467   - role:log("gm_action", {desc = "tower", int1 = level, key1 = pms.sender})
468   -
469 428 return "成功"
470 429 end
471 430  
... ... @@ -484,8 +443,6 @@ function _M.email(role, pms)
484 443 rewardPms = id ~= 0 and reward or nil,
485 444 })
486 445  
487   - role:log("gm_action", {desc = "email", int1 = id, key1 = pms.sender})
488   -
489 446 return "成功"
490 447 end
491 448  
... ... @@ -503,7 +460,6 @@ function _M.cguide(role, pms)
503 460 role:updateProperty({field = "funcGuide", value = ""})
504 461 end
505 462  
506   - role:log("gm_action", {desc = "cguide", int1 = id, key1 = pms.sender})
507 463 return "成功"
508 464 end
509 465  
... ...
src/actions/HangAction.lua
... ... @@ -156,8 +156,6 @@ function _M.startRpc( agent, data )
156 156 end
157 157 role:updateProperty({field = "hangInfo", value = hangInfo})
158 158  
159   - role:log("hang_action", {desc = "startHang", int1 = carbonId})
160   -
161 159 SendPacket(actionCodes.Hang_startRpc, '')
162 160 return true
163 161 end
... ... @@ -248,7 +246,6 @@ function _M.endBattleRpc(agent, data)
248 246 role:updateProperty({field = "hangInfo", value = hangInfo})
249 247  
250 248 local team = role:getProperty("pvpTC")
251   - role:log("hang_action", {desc = "hangBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = carbonId, int2 = role:getProperty("hangTBV"), cint1 = role:getHerosCamp(team.heros)})
252 249  
253 250 -- 引导
254 251 if carbonId == 10101 then
... ... @@ -500,7 +497,7 @@ function _M.buyBonusCountRpc(agent, data)
500 497  
501 498 if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return 2 end
502 499  
503   - role:costItems({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}, {log = {desc = "buyBonusCount", short1 = btype, int1 = count}})
  500 + role:costItems({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}, {log = {desc = "buyBonusCount", int1 = btype, int2 = count}})
504 501 bonusC[btype]["b"] = bonusC[btype]["b"] + count
505 502 bonusC[btype]["c"] = bonusC[btype]["c"] - count
506 503  
... ... @@ -571,8 +568,6 @@ function _M.endBonusBattleRpc(agent, data)
571 568 role:checkTaskEnter("BonusPass", {id = id})
572 569 end
573 570  
574   - role:log("hang_action", {desc = "bonusBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id})
575   -
576 571 SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({
577 572 starNum = starNum,
578 573 reward = reward,
... ... @@ -593,7 +588,6 @@ function _M.hangGiftRpc(agent, data)
593 588 if hangGift[id] then return 2 end
594 589  
595 590 local reward, change = role:award(carbonData.item_clear_special, {log = {desc = "hangGift", int1 = id}})
596   - role:log("hang_action", {desc = "hangGift", int1 = id})
597 591  
598 592 role:changeUpdates({{type = "hangGift", field = id, value = 1}})
599 593  
... ...
src/actions/HeroAction.lua
... ... @@ -25,7 +25,7 @@ local function getChangeAttrJson(oldAttr, newAttr)
25 25 change[k] = nil
26 26 end
27 27 end
28   - return json.encode(change)
  28 + return change
29 29 end
30 30  
31 31 function _M.levelUpRpc( agent, data )
... ... @@ -47,7 +47,7 @@ function _M.levelUpRpc( agent, data )
47 47  
48 48 role:log("hero_upgrade", {
49 49 hero_id = hero:getProperty("type"), --英雄ID
50   - hero_upgrade_cost = json.encode(cost), -- 英雄升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  50 + hero_upgrade_cost = cost, -- 英雄升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
51 51 hero_upgrade_result = getChangeAttrJson(oldAttr, hero:getTotalAttrs()), -- 英雄升级效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
52 52 hero_upgrade_type = 0, -- 英雄升级方式,连续升级:1,单击升级:0
53 53 hero_upgrade_score = hero:getProperty("battleV"), -- 英雄升级后评分
... ... @@ -80,7 +80,7 @@ function _M.breakRpc( agent, data )
80 80  
81 81 role:log("hero_break", {
82 82 hero_id = hero:getProperty("type"), --英雄ID
83   - hero_break_cost = json.encode(cost), -- 英雄突破消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  83 + hero_break_cost = cost, -- 英雄突破消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
84 84 hero_break_result = getChangeAttrJson(oldAttr, hero:getTotalAttrs()), -- 英雄突破效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
85 85 hero_break_level = hero:getMaxLevel(), -- 英雄突破后等级上限
86 86 })
... ... @@ -117,7 +117,7 @@ function _M.wakeRpc(agent, data)
117 117  
118 118 role:log("hero_rise", {
119 119 hero_id = typ, --英雄ID
120   - hero_rise_cost = json.encode(cost), --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  120 + hero_rise_cost = cost, --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
121 121 hero_rise_score = hero:getProperty("battleV"), --英雄觉醒后评分提升
122 122 hero_rise_result = getChangeAttrJson(oldAttr, hero:getTotalAttrs()), --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
123 123 })
... ... @@ -195,7 +195,7 @@ function _M.talentRpc(agent, data)
195 195  
196 196 role:log("hero_talent", {
197 197 hero_id = hero:getProperty("type"), --英雄ID
198   - hero_talent_cost = json.encode(cost), -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  198 + hero_talent_cost = cost, -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
199 199 hero_talent_levelbef = oldSkillLv, -- 英雄技能升级前等级
200 200 hero_talent_level = hero:getSkillLevel(1), -- 英雄技能升级后等级
201 201 })
... ... @@ -683,7 +683,7 @@ function _M.getResetRewardRpc(agent, data)
683 683  
684 684 role:log("hero_recycle", {
685 685 hero_recycle_list = hero:getProperty("type"), -- 回收的英雄id列表,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
686   - hero_recycle_reward = json.encode(reward), -- 回收后获得的奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  686 + hero_recycle_reward = reward, -- 回收后获得的奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
687 687 hero_recycle_cnt = 1, -- 总回收英雄量
688 688 })
689 689 SendPacket(actionCodes.Hero_getResetRewardRpc, MsgPack.pack(role:packReward(reward, change)))
... ... @@ -862,8 +862,8 @@ function _M.drawHeroRpc(agent, data)
862 862 gacha_type = btype, -- 卡池类型
863 863 gacha_up = 0, -- 卡池UP角色
864 864 gacha_times = drawCount[drawType], -- 抽卡次数
865   - gacha_reward = json.encode(reward), -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
866   - currency = json.encode(cost), -- 购买道具消耗的货币
  865 + gacha_reward = reward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  866 + currency = cost, -- 购买道具消耗的货币
867 867 })
868 868 SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组
869 869 return true
... ...
src/actions/PvpAction.lua
... ... @@ -287,7 +287,7 @@ function _M.startBattleRpc(agent, data)
287 287 if pvpFree >= globalCsv.pvp_battle_free_count then
288 288 local cost = {[ItemId.PvpKey] = 1}
289 289 if not role:checkItemEnough(cost) then return 5 end
290   - role:costItems(cost, {log = {desc = "startPvp", short1 = 1}})
  290 + role:costItems(cost, {log = {desc = "startPvp", int1 = 1}})
291 291 else
292 292 role.dailyData:updateProperty({field = "pvpFree", delta = 1})
293 293 end
... ... @@ -296,9 +296,6 @@ function _M.startBattleRpc(agent, data)
296 296 _pvpStartBattleCacheC = {idx = idx, key = key, revenge = revenge}
297 297  
298 298 role:checkTaskEnter("PvpBattle")
299   -
300   -
301   - role:log("pvp_action", {desc = "startBattle", short1 = 1, int1 = revenge and 1 or 0})
302 299 end
303 300  
304 301 SendPacket(actionCodes.Pvp_startBattleRpc, MsgPack.pack({matchInfo = matchInfo, key = key, result = result, wait = wait}))
... ... @@ -391,8 +388,6 @@ function _M.endBattleRpc(agent, data)
391 388 if isWin then
392 389 role:checkTaskEnter("PvpWin", {score = myScore})
393 390 end
394   -
395   - role:log("pvp_action", {desc = "battleEnd", short1 = 1, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0})
396 391  
397 392 SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({
398 393 reward = reward,
... ... @@ -494,7 +489,7 @@ function _M.startBattleHRpc(agent, data)
494 489 if pvpFreeH >= globalCsv.pvp_battle_free_count_high then
495 490 local cost = {[ItemId.PvpKey] = globalCsv.pvp_battle_high_cost}
496 491 if not role:checkItemEnough(cost) then return 5 end
497   - role:costItems(cost, {log = {desc = "startPvp", short1 = 2}})
  492 + role:costItems(cost, {log = {desc = "startPvp", int1 = 2}})
498 493 else
499 494 role.dailyData:updateProperty({field = "pvpFreeH", delta = 1})
500 495 end
... ... @@ -520,8 +515,6 @@ function _M.startBattleHRpc(agent, data)
520 515  
521 516 role:checkTaskEnter("PvpBattle")
522 517  
523   - role:log("pvp_action", {desc = "startBattle", short1 = 2, int1 = revenge and 1 or 0})
524   -
525 518 end
526 519  
527 520 SendPacket(actionCodes.Pvp_startBattleHRpc, MsgPack.pack({
... ... @@ -693,7 +686,6 @@ function _M.endBattleHRpc(agent, data)
693 686 if isWin then
694 687 role:checkTaskEnter("PvpWin", {score = myScore})
695 688 end
696   - role:log("pvp_action", {desc = "battleEnd", short1 = 2, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0})
697 689  
698 690 SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({
699 691 reward = reward,
... ... @@ -842,7 +834,6 @@ function _M.highDivisionGiftRpc(agent, data)
842 834 })
843 835  
844 836 local reward, change = role:award(newReward, {log = {desc = "pvpDivisionH"}})
845   - role:log("pvp_action", {desc = "pvpDivisionH"})
846 837  
847 838 SendPacket(actionCodes.Pvp_highDivisionGiftRpc, MsgPack.pack(role:packReward(reward, change)))
848 839 return true
... ... @@ -877,8 +868,6 @@ function _M.shopBuyRpc(agent, data)
877 868 end
878 869 local reward, change = role:award(gift, {log = {desc = "pvpShop", int1 = id, int2 = count}})
879 870  
880   - role:log("pvp_action", {desc = "pvpShop", int1 = id, int2 = count})
881   -
882 871 SendPacket(actionCodes.Pvp_shopBuyRpc, MsgPack.pack(role:packReward(reward, change)))
883 872 return true
884 873 end
... ... @@ -970,7 +959,6 @@ function _M.crossBetRpc(agent, data)
970 959 local result, code = role:setCrossServerPvpBet(msg.idx)
971 960 if not result then return 10 + code end
972 961  
973   - role:log("pvp_action", {desc = "crossBet"})
974 962 SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result))
975 963 return true
976 964 end
... ...
src/actions/RoleAction.lua
... ... @@ -586,7 +586,7 @@ function _M.openTimeBoxRpc(agent, data)
586 586 carriage_dismantle_type = quick and 1 or 0, -- 拆解方式,时间到期:0,钥匙开启:1
587 587 carriage_dismantle_time = costTime, -- 拆解耗时,填写实际耗时
588 588 carriage_dismantle_cost = costKey, -- 拆解花费钥匙数量,未使用填写0
589   - carriage_dismantle_rwd = json.encode(reward), -- 拆解获得物资,json格式记录,{'itemid1':2,'itemid2':3,…………..}
  589 + carriage_dismantle_rwd = reward, -- 拆解获得物资,json格式记录,{'itemid1':2,'itemid2':3,…………..}
590 590 })
591 591 else
592 592 return
... ... @@ -681,7 +681,7 @@ function _M.storyBookRewardRpc(agent, data)
681 681 carriage_video_id = storyId, --放映室片段ID
682 682 carriage_video_coinid = reward[ItemId.Gold] and ItemId.Gold or 0, --放映奖励货币类型,无奖励则填写0
683 683 carriage_video_coinnum = reward[ItemId.Gold] or 0, --放映奖励货币数量,无奖励则填写0
684   - carriage_video_item = json.encode(reward), --放映奖励其他物品数量,json格式记录,{'itemid1':10,'itemid2':5,…………..},无奖励则填写0
  684 + carriage_video_item = reward, --放映奖励其他物品数量,json格式记录,{'itemid1':10,'itemid2':5,…………..},无奖励则填写0
685 685 })
686 686  
687 687 SendPacket(actionCodes.Role_storyBookRewardRpc, MsgPack.pack(role:packReward(reward, change)))
... ... @@ -749,7 +749,7 @@ function _M.taskRpc(agent, data)
749 749 role:log("task_reward", {
750 750 task_reward_id = taskId, --任务奖励ID
751 751 task_reward_type = taskType, --任务奖励类型,见 任务奖励类型枚举表
752   - task_reward_detail = json.encode(reward), --任务奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
  752 + task_reward_detail = reward, --任务奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
753 753 })
754 754  
755 755 SendPacket(actionCodes.Role_taskRpc, MsgPack.pack(role:packReward(reward, change)))
... ... @@ -844,7 +844,7 @@ function _M.achiveRpc(agent, data)
844 844 role:log("achievement", {
845 845 achievement_id = taskId, -- 成就id
846 846 achievement_type = achiveTask.type, -- 成就类型,具体枚举表中成就类型枚举表
847   - achievement_reward = json.encode(reward), -- 达成成就奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
  847 + achievement_reward = reward, -- 达成成就奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
848 848 })
849 849  
850 850 SendPacket(actionCodes.Role_achiveRpc, MsgPack.pack(role:packReward(reward, change)))
... ... @@ -1000,8 +1000,6 @@ function _M.changeSettingRpc(agent, data)
1000 1000 setting[id] = status
1001 1001 role:updateProperty({field = "setting", value = setting})
1002 1002  
1003   - role:log("role_action", {desc = "changeSetting", int1 = id, int2 = status})
1004   -
1005 1003 SendPacket(actionCodes.Role_changeSettingRpc, '')
1006 1004 return true
1007 1005 end
... ... @@ -1035,7 +1033,7 @@ function _M.drawCodeRpc(agent, data)
1035 1033 role:log("get_gift", {
1036 1034 gift_id = giftId, -- 礼包ID
1037 1035 gift_key = code, -- 礼包key
1038   - gift_reward = json.encode(reward), -- 礼包奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
  1036 + gift_reward = reward, -- 礼包奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
1039 1037 gift_name = "", -- 礼包名称
1040 1038 gift_reason = 0, -- 礼包发放原因,见发放原因枚举表
1041 1039 })
... ...
src/actions/TowerAction.lua
... ... @@ -76,8 +76,6 @@ function _M.startBattleRpc(agent, data)
76 76 role:updateProperty({field = "towerInfo", value = towerInfo})
77 77 role:checkTaskEnter("TowerBattle", {level = towerInfo.l})
78 78  
79   - role:log("tower_action", {desc = "startBattle", int1 = id})
80   -
81 79 SendPacket(actionCodes.Tower_startBattleRpc, '')
82 80 return true
83 81 end
... ... @@ -116,8 +114,6 @@ function _M.endBattleRpc(agent, data)
116 114 towerInfo.k = nil
117 115 role:updateProperty({field = "towerInfo", value = towerInfo})
118 116  
119   - role:log("tower_action", {desc = "endBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id})
120   -
121 117 SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward, change = change}))
122 118 return true
123 119 end
... ... @@ -140,7 +136,6 @@ function _M.bugCountRpc(agent, data)
140 136 towerInfo.c = curCount
141 137 towerInfo.t = nextTime
142 138 role:updateProperty({field = "towerInfo", value = towerInfo})
143   - role:log("tower_action", {desc = "bugCount"})
144 139  
145 140 SendPacket(actionCodes.Tower_bugCountRpc, '')
146 141 return true
... ...
src/adv/Adv.lua
... ... @@ -24,17 +24,6 @@ function Adv:ctor(owner)
24 24 self:initByInfo(self.owner:getProperty("advInfo"))
25 25 end
26 26  
27   -function Adv:log(contents)
28   - contents = contents or {}
29   - if contents["cint1"] or contents["cint2"] or contents["cint3"] then
30   - print("advLog error log have cint1 or cint2 or cint3 ", debug.traceback())
31   - end
32   - contents["cint1"] = self.chapterId
33   - contents["cint2"] = self.level
34   -
35   - self.owner:log("adv_action", contents)
36   -end
37   -
38 27 --初始化adv 信息
39 28 function Adv:initByInfo(advInfo)
40 29 if not next(advInfo) then return end --还没有 开始新地图
... ... @@ -509,18 +498,18 @@ function Adv:awardArtifact(id, params)
509 498 self:checkAchievement(Adv.AchievType.GetMWeapon, 1, id)
510 499  
511 500  
512   - if params.log then
513   - local log = clone(params.log)
514   - if log["cint1"] or log["cint2"] or log["cint3"] then
515   - print("awardArtifact error log have cint1 or cint2 or cint3 ", debug.traceback())
516   - end
517   - log["cint1"] = self.chapterId
518   - log["cint2"] = self.level
519   - log["cint3"] = id
520   - self.owner:log("in_artifact", log)
521   - else
522   - print("awardArtifact no log ", debug.traceback())
523   - end
  501 + -- if params.log then
  502 + -- local log = clone(params.log)
  503 + -- if log["cint1"] or log["cint2"] or log["cint3"] then
  504 + -- print("awardArtifact error log have cint1 or cint2 or cint3 ", debug.traceback())
  505 + -- end
  506 + -- log["cint1"] = self.chapterId
  507 + -- log["cint2"] = self.level
  508 + -- log["cint3"] = id
  509 + -- self.owner:log("in_artifact", log)
  510 + -- else
  511 + -- print("awardArtifact no log ", debug.traceback())
  512 + -- end
524 513 if not params.isChoose then
525 514 self:pushBackEvent(AdvBackEventType.Artifact, {id = id})
526 515 end
... ... @@ -609,7 +598,6 @@ function Adv:wearArtifact(slot, id)
609 598 else
610 599 id = nil
611 600 end
612   - self:log({desc = "wearArtifact", int1 = id})
613 601  
614 602 self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}})
615 603 return true
... ... @@ -668,9 +656,6 @@ function Adv:artifactLevelUp(id, level)
668 656 end
669 657 if newLv == advAFGet[id] then return end
670 658  
671   - self:log({desc = "artifactLevelUp", int1 = id, int2 = level})
672   -
673   -
674 659 local status = 0
675 660 if curWear[id] then -- 穿着呢
676 661 local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]]
... ... @@ -715,8 +700,6 @@ function Adv:chooseArtifact(index)
715 700 if not self.waitArtifact or not self.waitArtifact[index] then return end
716 701 self:award({[self.waitArtifact[index]] = 1}, {log = {desc = "chooseArtifact"}, isChoose = true})
717 702  
718   - self:log({desc = "chooseArtifact", int1 = self.waitArtifact[index]})
719   -
720 703 self.waitArtifact = nil
721 704  
722 705 -- 支援效果继续选择
... ... @@ -809,8 +792,6 @@ function Adv:over(success, rewardRatio, overType)
809 792 end
810 793 self:clearAdvUnlockCache()
811 794  
812   - self:log({desc = "over", short1 = success and 1 or 0, int1 = overType})
813   -
814 795 local chapterId = self.chapterId
815 796 self:clear()
816 797 self.owner:checkTaskEnter("AdvScore", {score = score})
... ... @@ -911,23 +892,23 @@ function Adv:award(gift, params)
911 892 items = items:setv(itemId, nums)
912 893 end
913 894  
914   - if params.log then
915   - local log = clone(params.log)
916   - if log["cint1"] or log["cint2"] or log["cint3"] or log["long1"] then
917   - print("addAdvItem error log have cint1 or cint2 or cint3 ", debug.traceback())
918   - end
919   - log["cint1"] = itemId
920   - log["cint2"] = math.abs(count)
921   - log["cint3"] = self.chapterId
922   - log["long1"] = self.level
923   - if count >= 0 then
924   - self.owner:log("in_adv", log)
925   - else
926   - self.owner:log("out_adv", log)
927   - end
928   - else
929   - print("addAdvItem no log ", debug.traceback())
930   - end
  895 + -- if params.log then
  896 + -- local log = clone(params.log)
  897 + -- if log["cint1"] or log["cint2"] or log["cint3"] or log["long1"] then
  898 + -- print("addAdvItem error log have cint1 or cint2 or cint3 ", debug.traceback())
  899 + -- end
  900 + -- log["cint1"] = itemId
  901 + -- log["cint2"] = math.abs(count)
  902 + -- log["cint3"] = self.chapterId
  903 + -- log["long1"] = self.level
  904 + -- if count >= 0 then
  905 + -- self.owner:log("in_adv", log)
  906 + -- else
  907 + -- self.owner:log("out_adv", log)
  908 + -- end
  909 + -- else
  910 + -- print("addAdvItem no log ", debug.traceback())
  911 + -- end
931 912 end
932 913 end
933 914 if items ~= oldItems then
... ... @@ -1021,7 +1002,6 @@ local function clickOut(self, room, block, params, isExit)
1021 1002 isRelay = true,
1022 1003 })
1023 1004 else
1024   - self:log({desc = "pass"})
1025 1005 self:initByChapter({
1026 1006 chapterId = self.chapterId,
1027 1007 level = self.level + 1,
... ...
src/models/Activity.lua
... ... @@ -219,7 +219,7 @@ function Activity:checkWeeklyAct(actType, notify, count, pool)
219 219 self.owner:log("activity", {
220 220 activity_id = cfg.id, -- 活动ID(或活动指定任务的ID)
221 221 activity_type = actType, -- 活动类型,见活动类型枚举表
222   - activity_reward = json.encode(cfg.reward:toNumMap()), -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
  222 + activity_reward = cfg.reward:toNumMap(), -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
223 223 })
224 224  
225 225 self.owner:sendMail(info.mailId, nil, cfg.reward, {cfg.condition1})
... ...
src/models/RoleLog.lua
... ... @@ -123,7 +123,7 @@ local MethodType = {
123 123 level_before = true, -- 变动前的等级,可以跳级
124 124 level_changemain = true, -- 等级变动原因,副本通关:mission,领取奖励:reward
125 125 level_changedetail = true, -- 等级变动原因明细,副本通关则记录关卡ID,领取奖励则记录奖励ID
126   - level_reward = true, -- 等级变动奖励,json格式记录,{道具ID1:道具数量,道具ID2:道具数量}
  126 + level_reward = "json", -- 等级变动奖励,json格式记录,{道具ID1:道具数量,道具ID2:道具数量}
127 127 },
128 128 onGuidePoint = { --游戏引导
129 129 guild_type = true, --引导类型,新手引导:0,系统引导:1,弱引导:2
... ... @@ -180,7 +180,7 @@ local MethodType = {
180 180 mission_enemylist = true, -- 地方英雄ID,排序以玩家出战设置为准,PVP多个队伍则记录多个列表。示例:[[1,2,3],[456]]
181 181 mission_damage = true, -- 英雄输出值。示例:{'heroid1':1000,'heroid2':2000,………..}
182 182 mission_ultskill = true, -- 大招使用情况。示例:{'heroid1':1000,'heroid2':2000,………..}
183   - mission_reward = true, -- 获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  183 + mission_reward = "json", -- 获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
184 184 mission_starttime = true, -- 战斗开始时间,格式 unixtime 秒级
185 185 mission_roundtime = true, -- 对局时长(秒)
186 186 mission_result = true, -- 战斗结果(0-无效,1-胜利,2-失败)
... ... @@ -191,9 +191,9 @@ local MethodType = {
191 191 mission_score = true, -- 本局分数,PVP玩法记录为对战后积分,无得分的填0
192 192 mission_cleartype = true, -- 1正常通关;2代理拾荒
193 193 mission_rank = true, -- 对战后排名,适用于PVP玩法和电波塔,其他玩法留空
194   - misson_monsterkill = true, -- 击杀怪物ID和数量,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
195   - misson_teamskill = true, -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..}
196   - misson_teambond = true, -- 编队羁绊和羁绊等级,json格式记录,{"bondid1":1,"bondid2":2,………..}
  194 + misson_monsterkill = "json", -- 击杀怪物ID和数量,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  195 + misson_teamskill = "json", -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..}
  196 + misson_teambond = "json", -- 编队羁绊和羁绊等级,json格式记录,{"bondid1":1,"bondid2":2,………..}
197 197 },
198 198 residence_reward = { --玩家挂机或排名奖励 --TODO
199 199 mission_threadid = true, --大关卡ID
... ... @@ -201,31 +201,31 @@ local MethodType = {
201 201 mission_type = true, --关卡类型,见关卡类型枚举表
202 202 residence_reward_type = true, --领取奖励方式,快速(超前领取)记录为1,正常领取记录为0
203 203 residence_time = true, --挂机或排名时长
204   - residence_reward = true, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  204 + residence_reward = "json", --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
205 205 },
206 206 hero_rise = { --英雄觉醒
207 207 hero_id = true, --英雄ID
208   - hero_rise_cost = true, --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  208 + hero_rise_cost = "json", --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
209 209 hero_rise_score = true, --英雄觉醒后评分提升
210   - hero_rise_result = true, --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
  210 + hero_rise_result = "json", --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
211 211 },
212 212 hero_upgrade = { --英雄升级
213 213 hero_id = true, -- 英雄ID
214   - hero_upgrade_cost = true, -- 英雄升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
215   - hero_upgrade_result = true, -- 英雄升级效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
  214 + hero_upgrade_cost = "json", -- 英雄升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  215 + hero_upgrade_result = "json", -- 英雄升级效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
216 216 hero_upgrade_type = true, -- 英雄升级方式,连续升级:1,单击升级:0
217 217 hero_upgrade_score = true, -- 英雄升级后评分
218 218 hero_upgrade_scoreget = true, -- 通过英雄升级提升的评分
219 219 },
220 220 hero_break = { --英雄突破
221 221 hero_id = true, -- 英雄ID
222   - hero_break_cost = true, -- 英雄突破消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
223   - hero_break_result = true, -- 英雄突破效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
  222 + hero_break_cost = "json", -- 英雄突破消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  223 + hero_break_result = "json", -- 英雄突破效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
224 224 hero_break_level = true, -- 英雄突破后等级上限
225 225 },
226 226 hero_talent = { --英雄天赋升级
227 227 hero_id = true, -- 英雄ID
228   - hero_talent_cost = true, -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  228 + hero_talent_cost = "json", -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
229 229 hero_talent_levelbef = true, -- 英雄技能升级前等级
230 230 hero_talent_level = true, -- 英雄技能升级后等级
231 231 },
... ... @@ -236,7 +236,7 @@ local MethodType = {
236 236 hero_jewel_part = true, -- 铭文装备部位
237 237 hero_jewel_score = true, -- 铭文装备后的英雄分值
238 238 hero_jewel_scorebefore = true, -- 铭文装备前的英雄分值
239   - hero_jewel_result = true, -- 铭文装备后效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
  239 + hero_jewel_result = "json", -- 铭文装备后效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..}
240 240 },
241 241 hero_note = { --英雄评价
242 242 hero_id = true, -- 英雄ID
... ... @@ -248,8 +248,8 @@ local MethodType = {
248 248 hero_id = true, -- 英雄ID
249 249 },
250 250 hero_recycle = { --英雄回收
251   - hero_recycle_list = true, -- 回收的英雄id列表,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
252   - hero_recycle_reward = true, -- 回收后获得的奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  251 + hero_recycle_list = "json", -- 回收的英雄id列表,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  252 + hero_recycle_reward = "json", -- 回收后获得的奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
253 253 hero_recycle_cnt = true, -- 总回收英雄量
254 254 },
255 255 gacha = { --英雄招募
... ... @@ -257,16 +257,16 @@ local MethodType = {
257 257 gacha_type = true, -- 卡池类型
258 258 gacha_up = true, -- 卡池UP角色
259 259 gacha_times = true, -- 抽卡次数
260   - gacha_reward = true, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
261   - currency = true, -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
  260 + gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"}
  261 + currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...}
262 262 },
263 263 equip_wear = { --装备穿戴与卸载
264 264 hero_id = true, --英雄ID
265 265 equip_id = true, --装备ID
266 266 equip_wear_action = true, --装备操作类型:装备:0,卸载:1
267 267 equip_wear_part = true, --装备部位,记录部位ID
268   - equip_wear_result = true, --装备操作后结果,记录属性变化,json格式记录,{“aa”:1234,"bb":4567}
269   - equip_wear_change = true, --装备操作变化值,记录属性变化,记录正负值,json格式记录,{“aa”:1234,"bb":-45}
  268 + equip_wear_result = "json", --装备操作后结果,记录属性变化,json格式记录,{“aa”:1234,"bb":4567}
  269 + equip_wear_change = "json", --装备操作变化值,记录属性变化,记录正负值,json格式记录,{“aa”:1234,"bb":-45}
270 270 equip_wear_mode = true, --用以区分自动装备还是手动装备,自动记录为0,手动记录为1
271 271 equip_wear_seqid = "ucode", --自动穿戴时记录的系列ID,用以关联一次性装备时候产生的多条记录
272 272 },
... ... @@ -287,7 +287,7 @@ local MethodType = {
287 287 carriage_dismantle_type = true, -- 拆解方式,时间到期:0,钥匙开启:1
288 288 carriage_dismantle_time = true, -- 拆解耗时,填写实际耗时
289 289 carriage_dismantle_cost = true, -- 拆解花费钥匙数量,未使用填写0
290   - carriage_dismantle_rwd = true, -- 拆解获得物资,json格式记录,{'itemid1':2,'itemid2':3,…………..}
  290 + carriage_dismantle_rwd = "json", -- 拆解获得物资,json格式记录,{'itemid1':2,'itemid2':3,…………..}
291 291 },
292 292 carriage_logistics = { --后勤室
293 293 carriage_logistics_type = true, -- 后勤室制作类型ID,变异:0,通常:1,魔法:2
... ... @@ -310,24 +310,24 @@ local MethodType = {
310 310 carriage_video_id = true, --放映室片段ID
311 311 carriage_video_coinid = true, --放映奖励货币类型,无奖励则填写0
312 312 carriage_video_coinnum = true, --放映奖励货币数量,无奖励则填写0
313   - carriage_video_item = true, --放映奖励其他物品数量,json格式记录,{'itemid1':10,'itemid2':5,…………..},无奖励则填写0
  313 + carriage_video_item = "json", --放映奖励其他物品数量,json格式记录,{'itemid1':10,'itemid2':5,…………..},无奖励则填写0
314 314 },
315 315 carriage_cook = { --调理室
316 316 item_id = true, -- 道具id
317 317 item_level = true, -- 道具等级
318 318 item_type = true, -- 道具类型,具体见枚举表中道具类型枚举表
319 319 carriage_cook_amount = true, -- 制作总量
320   - carriage_cook_cost = true, -- 制作消耗道具,json格式记录,{'itemid1':10,'itemid2':5,…………..}
  320 + carriage_cook_cost = "json", -- 制作消耗道具,json格式记录,{'itemid1':10,'itemid2':5,…………..}
321 321 },
322 322 activity = { --活动或指南奖励
323 323 activity_id = true, -- 活动ID(或活动指定任务的ID)
324 324 activity_type = true, -- 活动类型,见活动类型枚举表
325   - activity_reward = true, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
  325 + activity_reward = "json", -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
326 326 },
327 327 task_reward = { --任务奖励
328 328 task_reward_id = true, --任务奖励ID
329 329 task_reward_type = true, --任务奖励类型,见 任务奖励类型枚举表
330   - task_reward_detail = true, --任务奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
  330 + task_reward_detail = "json", --任务奖励,json格式记录,{'itemid1':123,'itemid2':456,………...}
331 331 },
332 332 shop_purchase = { --商店购买行为
333 333 item_id = true, -- 道具id
... ... @@ -351,14 +351,6 @@ local MethodType = {
351 351 friend_roleid = true, -- 好友账户下的角色id
352 352 friend_cnt = true, -- 操作后好友数量
353 353 },
354   - friend_list = { --好友列表 --TODO
355   - friend_accountid = true, --好友账户id
356   - friend_roleid = true, --好友账户下的角色id
357   - },
358   - friend_black = { --黑名单列表 --TODO
359   - friend_accountid = true, -- 好友账户id
360   - friend_roleid = true, -- 好友账户下的角色id
361   - },
362 354 communication = { --玩家发言
363 355 publish_type = true, --发言类型,全部:0,公告:1,世界:2,联盟:3,私聊:4
364 356 publish_status = true, --发送状态,发送成功:0,发送失败:1,被屏蔽:2,其他:3
... ... @@ -390,28 +382,41 @@ local MethodType = {
390 382 restaurant_order = { --订单任务
391 383 restaurant_order_id = true, -- 订单任务ID
392 384 restaurant_order_status = true, -- 订单任务状态,接受:0, 拒绝:1, 完成:2
393   - restaurant_order_rwd = true, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
  385 + restaurant_order_rwd = "json", -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
394 386 restaurant_order_lv = true, -- 订单品质等级,普通:0, 稀有:1, 顶级:2, 豪华:3
395 387 },
396 388 restaurant_collect = { --餐厅顾客图谱
397 389 restaurant_collect_id = true, -- 图谱收集ID
398   - restaurant_collect_rwd = true, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
  390 + restaurant_collect_rwd = "json", -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
399 391 restaurant_collect_plan = true, -- 收集进度,即解锁顾客,数字表示
400 392 },
401 393 achievement = { --成就达成
402 394 achievement_id = true, -- 成就id
403 395 achievement_type = true, -- 成就类型,具体枚举表中成就类型枚举表
404   - achievement_reward = true, -- 达成成就奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
  396 + achievement_reward = "json", -- 达成成就奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
405 397 },
406 398 get_gift = { --礼包兑换
407 399 gift_id = true, -- 礼包ID
408 400 gift_key = true, -- 礼包key
409   - gift_reward = true, -- 礼包奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
  401 + gift_reward = "json", -- 礼包奖励,json格式记录,{"itemid1":123,"itemid2":12,……….}
410 402 gift_name = true, -- 礼包名称
411 403 gift_reason = true, -- 礼包发放原因,见发放原因枚举表
412 404 },
413 405 }
414 406  
  407 +local function printError(info)
  408 + print(info)
  409 + print(debug.traceback())
  410 +end
  411 +
  412 +local function jsonEncode(tab)
  413 + local newTab = {}
  414 + for k , v in pairs(tab) do
  415 + newTab[tostring(k)] = v
  416 + end
  417 + return json.encode(newTab)
  418 +end
  419 +
415 420 local function isIos(self)
416 421 local sid = self:getProperty("sid")
417 422 return sid == 2
... ... @@ -450,18 +455,11 @@ local function getBaseLog(self)
450 455 return log
451 456 end
452 457  
453   -local function printError(info)
454   - print(info)
455   - print(debug.traceback())
456   -end
  458 +
457 459  
458 460 local RoleLog = {}
459 461 function RoleLog.bind(Role)
460   -
461   - function Role:log()
462   - end
463   -
464   - function Role:log_new(logType, contents)
  462 + function Role:log(logType, contents)
465 463 contents = contents or {}
466 464 local schema = MethodType[logType]
467 465 if not schema then
... ... @@ -472,8 +470,13 @@ function RoleLog.bind(Role)
472 470  
473 471 doc["method"] = logType
474 472 for field, value in pairs(contents) do
475   - if not schema[ftype] then
476   - printError(string.format("LOG ERROR: logType [%s] have new field [%s], call yunying.", logType, field))
  473 + if not schema[field] then
  474 + printError(string.format("LOG ERROR: logType [%s] have new field [%s], call.", logType, field))
  475 + else
  476 + if value == 'json' then
  477 + value = jsonEncode(value)
  478 + end
  479 + doc[field] = value
477 480 end
478 481 end
479 482  
... ...
src/models/RolePlugin.lua
... ... @@ -837,7 +837,7 @@ function RolePlugin.bind(Role)
837 837  
838 838 count = count or 1
839 839  
840   - self:logItems(equipCsv.id, 0, count, params.log)
  840 + self:logItems(func, 0, count, params.log)
841 841  
842 842 if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then
843 843 local unlockData = csvdb["unlockCsv"][func]
... ...
src/models/RolePvp.lua
... ... @@ -500,7 +500,7 @@ function Role:setCrossServerPvpBet(idx)
500 500 local ok, result = pcall(skynet.call, pvpd, "lua", "setBet", idx, self:getProperty("id"), costNum)
501 501 if ok then
502 502 if result then
503   - self:costItems(cost, {log = {desc = "crossPvpBet", short1 = day}})
  503 + self:costItems(cost, {log = {desc = "crossPvpBet", int1 = day}})
504 504 pvpBet[day] = {idx, cost[ItemId.Gold]}
505 505 self:setProperty("pvpBet", pvpBet)
506 506 end
... ...