Commit 252524fcd172800e2a2f409d26fa1c8e640e5219
Merge branch 'develop' into tr/publish
* develop: 日志bug 修改每日礼包检测开启bug log缺失 ucode nokey 修改引导, 抽卡阶段奖励修改 gm增加跳过引导的命令 guide skip 自己的日志 自动挂机下一关 去除日志 拾荒引导拾取探险点后服务器设置当前引导步骤,而不是客户端指定 付费签到,抽卡阶段奖励,探索指令 自选箱子协议 保底日志
Showing
29 changed files
with
755 additions
and
139 deletions
Show diff stats
src/GlobalVar.lua
... | ... | @@ -68,6 +68,7 @@ ItemType = { |
68 | 68 | AdvItem = 14, -- 冒险道具 |
69 | 69 | FuncOpen = 15, -- 管理功能开放 |
70 | 70 | SpeedBox = 16, -- 加速箱子 |
71 | + SelectItemBox = 17, -- 自选箱子 | |
71 | 72 | } |
72 | 73 | |
73 | 74 | --在这个里面的会记录的是功能开放 对应类型open 而不是 ID |
... | ... | @@ -274,10 +275,8 @@ CardType = { |
274 | 275 | PrivilegeCard = 3, --特权卡 |
275 | 276 | GrowFund = 4, --成长助力 |
276 | 277 | BattleCard = 5, --赛季卡 |
277 | - BattlePassCard_1 = 6, -- 探索指令1 | |
278 | - BattlePassCard_2 = 7, -- 探索指令2 | |
279 | - BattlePassCard_3 = 8, -- 探索指令3 | |
280 | - BattlePassCard_4 = 9, -- 探索指令4 | |
278 | + PaySignCard = 6, -- 付费签到卡 | |
279 | + BattlePassCard = 7, -- 探索指令 | |
281 | 280 | } |
282 | 281 | |
283 | 282 | HeroQuality = { | ... | ... |
src/ProtocolCode.lua
... | ... | @@ -46,6 +46,7 @@ actionCodes = { |
46 | 46 | Role_goldBuyRpc = 131, |
47 | 47 | Role_getDownloadCvRewardRpc = 132, |
48 | 48 | Role_updateFeedbackInfoRpc = 133, |
49 | + Role_useSelectItemRpc = 134, -- 使用多选一礼包 | |
49 | 50 | |
50 | 51 | Adv_startAdvRpc = 151, |
51 | 52 | Adv_startHangRpc = 152, |
... | ... | @@ -92,6 +93,7 @@ actionCodes = { |
92 | 93 | Hero_repayHeroRpc = 221, |
93 | 94 | Hero_unlockPoolRpc = 222, |
94 | 95 | Hero_changeCrown = 223, |
96 | + Hero_drawHeroExtraRewardNtf = 224, | |
95 | 97 | |
96 | 98 | Hang_startRpc = 251, |
97 | 99 | Hang_checkRpc = 252, | ... | ... |
src/actions/ActivityAction.lua
... | ... | @@ -70,6 +70,7 @@ function _M.sudokuRpc(agent, data) |
70 | 70 | activity_type = 0, -- 活动类型,见活动类型枚举表 |
71 | 71 | activity_reward = reward or {}, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} |
72 | 72 | }) |
73 | + role:mylog("act_action", {desc = "sudoku", int1 = id, int2 = phase}) | |
73 | 74 | |
74 | 75 | SendPacket(actionCodes.Activity_sudokuRpc, MsgPack.pack({task = role:packReward(task, tchange), reward = role:packReward(reward, rchange), rId = rId})) |
75 | 76 | return true | ... | ... |
src/actions/AdvAction.lua
... | ... | @@ -174,6 +174,7 @@ function _M.startAdvRpc( agent, data ) |
174 | 174 | role:checkTaskEnter("AdvStart", {id = chapterId}) |
175 | 175 | role:checkTaskEnter("AdvStartSelf", {id = chapterId}) |
176 | 176 | role:getAdvData():popBackEvents() -- 清一下事件 |
177 | + role:getAdvData():mylog({desc = "start", int1 = supportIdx}) | |
177 | 178 | |
178 | 179 | SendPacket(actionCodes.Adv_startAdvRpc, '') |
179 | 180 | return true |
... | ... | @@ -254,6 +255,7 @@ function _M.startHangRpc(agent, data) |
254 | 255 | |
255 | 256 | role:changeAdvCount(adv_idle_energy) |
256 | 257 | role:checkTaskEnter("AdvStart", {id = chapterId}) |
258 | + role:mylog("adv_action", {desc = "startHang", int1 = chapterId}) | |
257 | 259 | |
258 | 260 | SendPacket(actionCodes.Adv_startHangRpc, '') |
259 | 261 | return true |
... | ... | @@ -293,6 +295,8 @@ function _M.quickHangRpc(agent, data) |
293 | 295 | info.time = 0 |
294 | 296 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) |
295 | 297 | |
298 | + role:mylog("adv_action", {desc = "advQuickHang", int1 = chapterId}) | |
299 | + | |
296 | 300 | SendPacket(actionCodes.Adv_quickHangRpc, '') |
297 | 301 | return true |
298 | 302 | end |
... | ... | @@ -374,6 +378,8 @@ function _M.endHangRpc(agent, data) |
374 | 378 | |
375 | 379 | role:changeUpdates({{type = "advHang", field = chapterId, value = nil}}) |
376 | 380 | |
381 | + role:mylog("adv_action", {desc = "endHang", int1 = chapterId, short1 = cancel and 1 or 0}) | |
382 | + | |
377 | 383 | SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, change = change, isFull = isFull})) |
378 | 384 | return true |
379 | 385 | end |
... | ... | @@ -403,6 +409,7 @@ function _M.buyAdvCountRpc(agent , data) |
403 | 409 | role:changeAdvCount(-count * globalCsv.adv_daily_buy_num) |
404 | 410 | role.dailyData:updateProperty({field = "advBC", delta = count}) |
405 | 411 | end |
412 | + role:mylog("adv_action", {desc = "buyAdvCount", short1 = isEl and 1 or 0, int1 = count}) | |
406 | 413 | |
407 | 414 | SendPacket(actionCodes.Adv_buyAdvCountRpc, '') |
408 | 415 | return true |
... | ... | @@ -427,6 +434,8 @@ function _M.finishTaskRpc(agent, data) |
427 | 434 | if not status then return end |
428 | 435 | role:checkTaskEnter("AdvOverTask", {id = taskId}) |
429 | 436 | |
437 | + adv:mylog({desc = "finishTask", int1 = taskId}) | |
438 | + | |
430 | 439 | SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack(role:packReward(reward, change))) |
431 | 440 | return true |
432 | 441 | end |
... | ... | @@ -448,6 +457,8 @@ function _M.clickBlockRpc(agent, data) |
448 | 457 | |
449 | 458 | if adv:isWaitChooseArtifact() then return returnFail() end |
450 | 459 | |
460 | + adv:mylog({desc = "clickBlock", int1 = msg.roomId, int2 = msg.blockId}) | |
461 | + | |
451 | 462 | local status, errorCode = adv:clickBlock(msg.roomId, msg.blockId, msg) |
452 | 463 | if not status then return returnFail(errorCode) end |
453 | 464 | |
... | ... | @@ -483,8 +494,8 @@ function _M.useItemRpc(agent, data) |
483 | 494 | if itemId == 5020 then |
484 | 495 | role:finishGuide(53) |
485 | 496 | end |
486 | - | |
487 | 497 | adv:checkAchievement(adv.AchievType.UseItem, count, itemId) |
498 | + adv:mylog({desc = "useItem", int1 = itemId, int2 = count}) | |
488 | 499 | |
489 | 500 | for i = 1, count do |
490 | 501 | adv:doActive(itemData.effect, target) -- target |
... | ... | @@ -520,6 +531,7 @@ function _M.usePotionRpc(agent, data) |
520 | 531 | local adv = role:getAdvData() |
521 | 532 | if adv:isWaitChooseArtifact() then return end |
522 | 533 | |
534 | + adv:mylog({desc = "usePotion", int1 = potionId}) | |
523 | 535 | |
524 | 536 | local status = adv:doActive(potionData.effect, target) -- target |
525 | 537 | if not status then return end |
... | ... | @@ -619,6 +631,7 @@ function _M.exitAdvRpc(agent, data) |
619 | 631 | role:saveGuide(57,1,true) |
620 | 632 | end |
621 | 633 | local adv = role:getAdvData() |
634 | + adv:mylog({desc = "exit"}) | |
622 | 635 | local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标 |
623 | 636 | SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()})) |
624 | 637 | return true |
... | ... | @@ -689,7 +702,7 @@ function _M.endBattleRpc(agent, data) |
689 | 702 | role:saveGuide(61,1,true) |
690 | 703 | end |
691 | 704 | end |
692 | - | |
705 | + adv:mylog({desc = "endBattle"}) | |
693 | 706 | local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) |
694 | 707 | |
695 | 708 | if not status then return end |
... | ... | @@ -772,7 +785,9 @@ function _M.wheelSurfRpc(agent, data) |
772 | 785 | end |
773 | 786 | role:award(reward, {log = {desc = "advWheelSurf", int1 = ptype}}) |
774 | 787 | role:finishGuide(58) |
788 | + | |
775 | 789 | role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype}) |
790 | + role:mylog("adv_action", {desc = "advWheelSurf", int1 = ptype, int2 = count}) | |
776 | 791 | |
777 | 792 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) |
778 | 793 | return true |
... | ... | @@ -801,6 +816,7 @@ function _M.repayWheelSurfRpc(agent, data) |
801 | 816 | local gift = drawData["pool3"]:randWeight(true) |
802 | 817 | local reward, change = {[gift[1]] = gift[2]} |
803 | 818 | reward, change = role:award(reward, {log = {desc = "advRepayWheelSurf", int1 = ptype}}) |
819 | + role:mylog("adv_action", {desc = "advRepayWheelSurf", int1 = ptype}) | |
804 | 820 | |
805 | 821 | SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack(role:packReward(reward, change))) |
806 | 822 | return true |
... | ... | @@ -824,6 +840,8 @@ function _M.finishAchievRpc(agent, data) |
824 | 840 | if not status then return end |
825 | 841 | adv:updateAchievement() |
826 | 842 | role:finishGuide(57) |
843 | + role:mylog("adv_action", {desc = "finishAchiev", short1 = ctype, int1 = chapterId, int2 = taskId}) | |
844 | + | |
827 | 845 | SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack(role:packReward(reward, change))) |
828 | 846 | return true |
829 | 847 | end |
... | ... | @@ -879,6 +897,7 @@ function _M.refreshSupportRpc(agent, data) |
879 | 897 | end |
880 | 898 | |
881 | 899 | role:advRandomSupportEffect() |
900 | + role:mylog("adv_action", {desc = "advSupRe", short1 = cr < al and 0 or 1}) | |
882 | 901 | |
883 | 902 | SendPacket(actionCodes.Adv_refreshSupportRpc, '') |
884 | 903 | return true | ... | ... |
src/actions/CarAction.lua
... | ... | @@ -47,6 +47,8 @@ function _M.makePotionRpc( agent, data ) |
47 | 47 | carriage_cook_amount = count, -- 制作总量 |
48 | 48 | carriage_cook_cost = cost, -- 制作消耗道具,json格式记录,{'itemid1':10,'itemid2':5,…………..} |
49 | 49 | }) |
50 | + role:mylog("role_action", {desc = "makePotion", int1 = potionId, int2 = count}) | |
51 | + | |
50 | 52 | SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag})) |
51 | 53 | return true |
52 | 54 | end |
... | ... | @@ -105,7 +107,7 @@ function _M.equipUpRpc( agent, data ) |
105 | 107 | equip_upgrade_cost = costCount, -- 升级操作消耗装备数量 |
106 | 108 | equip_upgrade_current = cost, -- 升级消耗的货币类型 |
107 | 109 | }) |
108 | - | |
110 | + role:mylog("role_action", {desc = "equipUp", int1 = id, int2 = count}) | |
109 | 111 | SendPacket(actionCodes.Car_equipUpRpc, '') |
110 | 112 | return true |
111 | 113 | end |
... | ... | @@ -145,7 +147,7 @@ function _M.runeUpRpc( agent, data ) |
145 | 147 | hero:updateProperty({field = "battleV", value = hero:getBattleValue()}) |
146 | 148 | end |
147 | 149 | end |
148 | - ownRune:log({desc = "runeUp", int1 = level + 1}) | |
150 | + ownRune:mylog({desc = "runeUp", int1 = level + 1}) | |
149 | 151 | |
150 | 152 | SendPacket(actionCodes.Car_runeUpRpc, '') |
151 | 153 | return true |
... | ... | @@ -179,7 +181,8 @@ function _M.saleEquipRpc(agent, data ) |
179 | 181 | end |
180 | 182 | role:checkTaskEnter("SaleEquip", {count = allCount}) |
181 | 183 | reward, change = role:award(reward, {log = {desc = "saleEquip"}}) |
182 | - | |
184 | + role:mylog("role_action", {desc = "saleEquip", int1 = allCount}) | |
185 | + | |
183 | 186 | SendPacket(actionCodes.Car_saleEquipRpc, MsgPack.pack(role:packReward(reward, change))) |
184 | 187 | return true |
185 | 188 | end | ... | ... |
src/actions/DinerAction.lua
... | ... | @@ -106,6 +106,8 @@ function _M.addSellRpc( agent, data ) |
106 | 106 | end |
107 | 107 | role:finishGuide(28) |
108 | 108 | |
109 | + role:mylog("diner_action", {desc = "addSell", int1 = dish, int2 = count}) | |
110 | + | |
109 | 111 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
110 | 112 | SendPacket(actionCodes.Diner_addSellRpc, "") |
111 | 113 | return true |
... | ... | @@ -161,6 +163,7 @@ function _M.removeSellRpc( agent, data ) |
161 | 163 | restaurant_sale_coin = reward[ItemId.DinerCoin] or 0, -- 售卖获得美食币 |
162 | 164 | restaurant_sale_gear = reward[ItemId.Gold] or 0, -- 售卖获得齿轮 |
163 | 165 | }) |
166 | + role:mylog("diner_action", {desc = "removeSell", int1 = dish}) | |
164 | 167 | |
165 | 168 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
166 | 169 | SendPacket(actionCodes.Diner_removeSellRpc, MsgPack.pack({reward = reward, change = change})) |
... | ... | @@ -230,7 +233,7 @@ function _M.getSellRewardRpc( agent, data ) |
230 | 233 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) |
231 | 234 | end |
232 | 235 | |
233 | - | |
236 | + role:mylog("diner_action", {desc = "sell"}) | |
234 | 237 | |
235 | 238 | SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward, change = change})) |
236 | 239 | return true |
... | ... | @@ -319,6 +322,8 @@ function _M.expediteSellRpc( agent, data ) |
319 | 322 | end |
320 | 323 | role:checkTaskEnter("FoodSellQuick") |
321 | 324 | |
325 | + role:mylog("diner_action", {desc = "sellQ"}) | |
326 | + | |
322 | 327 | SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward, change = change, popular = popular})) |
323 | 328 | return true |
324 | 329 | end |
... | ... | @@ -365,6 +370,7 @@ function _M.levelUpRpc( agent, data ) |
365 | 370 | restaurant_up_effectbef = curLevel, --升级前加成 |
366 | 371 | restaurant_up_effect = curLevel + 1, --升级后加成 |
367 | 372 | }) |
373 | + role:mylog("diner_action", {desc = "buildUp", int1 = index, int2 = curLevel + 1}) | |
368 | 374 | |
369 | 375 | SendPacket(actionCodes.Diner_levelUpRpc, '') |
370 | 376 | return true |
... | ... | @@ -454,6 +460,8 @@ function _M.talentUpRpc( agent, data ) |
454 | 460 | carriage_logistics_gear = cost[ItemId.Gold] or 0, -- 后勤室升级花费齿轮数量 |
455 | 461 | carriage_logistics_coin = cost[ItemId.DinerCoin] or 0, -- 后勤室升级花费美食币数量 |
456 | 462 | }) |
463 | + role:mylog("diner_action", {desc = "talentUp", int1 = dish, int2 = dishLevel + 1}) | |
464 | + | |
457 | 465 | SendPacket(actionCodes.Diner_talentUpRpc, '') |
458 | 466 | return true |
459 | 467 | end |
... | ... | @@ -487,6 +495,7 @@ function _M.skillUpRpc( agent, data ) |
487 | 495 | |
488 | 496 | role:costItems(cost, {log = {desc = "dinerSkillUp", int1 = skill, int2 = skillLevel + 1}}) |
489 | 497 | role.dinerData:updateProperty({field = "skillTree", value = skillTree:setv(skill, skillLevel + 1)}) |
498 | + role:mylog("diner_action", {desc = "skillUp", int1 = skill, int2 = skillLevel + 1}) | |
490 | 499 | |
491 | 500 | SendPacket(actionCodes.Diner_skillUpRpc, '') |
492 | 501 | return true |
... | ... | @@ -514,6 +523,8 @@ function _M.lockTaskRpc( agent, data ) |
514 | 523 | end |
515 | 524 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
516 | 525 | |
526 | + role:mylog("diner_action", {desc = "lockTask", int1 = order.id}) | |
527 | + | |
517 | 528 | SendPacket(actionCodes.Diner_lockTaskRpc, MsgPack.pack({lock = order.lock})) |
518 | 529 | return true |
519 | 530 | end |
... | ... | @@ -550,7 +561,8 @@ function _M.updateTaskRpc( agent, data ) |
550 | 561 | orders[index].status = 1 |
551 | 562 | orders[index].lock = 1 |
552 | 563 | |
553 | - role:checkTaskEnter("GetOderTask", {rarity = taskSet.rarity}) | |
564 | + role:checkTaskEnter("GetOderTask", {rarity = taskData.rarity}) | |
565 | + role:mylog("diner_action", {desc = "getTask", int1 = order.id}) | |
554 | 566 | elseif cmd == 1 then |
555 | 567 | if order.status ~= 1 then |
556 | 568 | return 31 |
... | ... | @@ -558,6 +570,8 @@ function _M.updateTaskRpc( agent, data ) |
558 | 570 | orders[index].status = 0 |
559 | 571 | orders[index].lock = 0 |
560 | 572 | |
573 | + role:mylog("diner_action", {desc = "deleteTask", int1 = order.id}) | |
574 | + | |
561 | 575 | elseif cmd == 2 then |
562 | 576 | if order.status ~= 1 then |
563 | 577 | return 32 |
... | ... | @@ -565,10 +579,11 @@ function _M.updateTaskRpc( agent, data ) |
565 | 579 | if order.n < taskData.value then |
566 | 580 | return 6 |
567 | 581 | end |
582 | + role:mylog("diner_action", {desc = "finishTask", int1 = order.id}) | |
568 | 583 | |
569 | 584 | reward, change = role:award(taskData.reward, {log = {desc = "dinerFinishTask", int1 = order.id}}) |
570 | 585 | table.remove(orders,index) |
571 | - role:checkTaskEnter("OverOderTask", {rarity = taskSet.rarity}) | |
586 | + role:checkTaskEnter("OverOderTask", {rarity = taskData.rarity}) | |
572 | 587 | else |
573 | 588 | return 33 |
574 | 589 | end |
... | ... | @@ -577,8 +592,8 @@ function _M.updateTaskRpc( agent, data ) |
577 | 592 | role:log("restaurant_order", { |
578 | 593 | restaurant_order_id = order.id, -- 订单任务ID |
579 | 594 | restaurant_order_status = cmd, -- 订单任务状态,接受:0, 拒绝:1, 完成:2 |
580 | - restaurant_order_rwd = reward, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….} | |
581 | - restaurant_order_lv = taskSet.rarity, -- 订单品质等级,普通:0, 稀有:1, 顶级:2, 豪华:3 | |
595 | + restaurant_order_rwd = reward or {}, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….} | |
596 | + restaurant_order_lv = taskData.rarity, -- 订单品质等级,普通:0, 稀有:1, 顶级:2, 豪华:3 | |
582 | 597 | }) |
583 | 598 | |
584 | 599 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
... | ... | @@ -656,6 +671,8 @@ function _M.refreshTaskRpc( agent, data ) |
656 | 671 | end |
657 | 672 | |
658 | 673 | role:finishGuide(41) |
674 | + role:mylog("diner_action", {desc = "reTask"}) | |
675 | + | |
659 | 676 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
660 | 677 | |
661 | 678 | SendPacket(actionCodes.Diner_refreshTaskRpc, '') |
... | ... | @@ -696,6 +713,8 @@ function _M.addWantFoodRpc(agent , data) |
696 | 713 | end |
697 | 714 | |
698 | 715 | role:finishGuide(36) |
716 | + role:mylog("diner_action", {desc = "wantFood"}) | |
717 | + | |
699 | 718 | role.dinerData:updateProperty({field = "gfood", value = gfood}) |
700 | 719 | |
701 | 720 | SendPacket(actionCodes.Diner_addWantFoodRpc, '') |
... | ... | @@ -742,6 +761,7 @@ function _M.getGreenhouseRpc( agent, data ) |
742 | 761 | local reward, change = role:award(reward, {log = {desc = "greenHourse", int1 = level}}) |
743 | 762 | role:checkTaskEnter("FoodMGet") |
744 | 763 | |
764 | + role:mylog("diner_action", {desc = "greenHourse"}) | |
745 | 765 | |
746 | 766 | SendPacket(actionCodes.Diner_getGreenhouseRpc, MsgPack.pack({reward = reward, change = change})) |
747 | 767 | return true |
... | ... | @@ -880,6 +900,7 @@ function _M.entrustRpc(agent , data) |
880 | 900 | role.dinerData:updateProperty({field = "entrust", value = entrust}) |
881 | 901 | |
882 | 902 | role:finishGuide(26) |
903 | + role:mylog("diner_action", {desc = "entrus", short1 = ctype, int1 = entrustId}) | |
883 | 904 | |
884 | 905 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward, change = change})) |
885 | 906 | return true |
... | ... | @@ -916,6 +937,7 @@ function _M.collectRpc(agent , data) |
916 | 937 | restaurant_collect_rwd = reward, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….} |
917 | 938 | restaurant_collect_plan = count, -- 收集进度,即解锁顾客,数字表示 |
918 | 939 | }) |
940 | + role:mylog("diner_action", {desc = "collect", int1 = id}) | |
919 | 941 | |
920 | 942 | SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward, change = change})) |
921 | 943 | return true |
... | ... | @@ -945,6 +967,8 @@ function _M.comboRewardRpc(agent , data) |
945 | 967 | |
946 | 968 | role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 |
947 | 969 | |
970 | + role:mylog("diner_action", {desc = "combo", int1 = id}) | |
971 | + | |
948 | 972 | SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward, change = change})) |
949 | 973 | return true |
950 | 974 | end | ... | ... |
src/actions/EmailAction.lua
... | ... | @@ -53,6 +53,7 @@ function _M.listRpc(agent, data) |
53 | 53 | content = email.content, |
54 | 54 | attachments = email.attachments |
55 | 55 | }) |
56 | + role:mylog("mail_action", {desc = "get_global", key1 = email.title, key2 = email.attachments}) | |
56 | 57 | end |
57 | 58 | end |
58 | 59 | end |
... | ... | @@ -98,6 +99,7 @@ function _M.drawAllAttachRpc(agent, data) |
98 | 99 | for key, v in pairs(attachments:toNumMap()) do |
99 | 100 | reward[key] = (reward[key] or 0) + v |
100 | 101 | end |
102 | + role:mylog("mail_action", {desc = "draw_attach", int1 = email:getProperty("emailId"), key1 = email:getProperty("title"), key2 = attachments}) | |
101 | 103 | end |
102 | 104 | end |
103 | 105 | reward, change = role:award(reward, {log = {desc = "draw_attach"}}) |
... | ... | @@ -123,7 +125,7 @@ function _M.drawAttachRpc(agent, data) |
123 | 125 | email:setProperty("status", 2) |
124 | 126 | email:log(role, 2) |
125 | 127 | SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward, change = change})) |
126 | - | |
128 | + role:mylog("mail_action", {desc = "draw_attach", int1 = id, key1 = email:getProperty("title"), key2 = attachments}) | |
127 | 129 | return true |
128 | 130 | end |
129 | 131 | |
... | ... | @@ -140,6 +142,7 @@ function _M.checkRpc(agent, data) |
140 | 142 | |
141 | 143 | email:setProperty("status", 1) |
142 | 144 | email:log(role, 1) |
145 | + role:mylog("mail_action", {desc = "check_mail", int1 = id}) | |
143 | 146 | |
144 | 147 | SendPacket(actionCodes.Email_checkRpc, '') |
145 | 148 | return true |
... | ... | @@ -175,6 +178,9 @@ function _M.delRpc(agent, data) |
175 | 178 | end |
176 | 179 | end |
177 | 180 | end) |
181 | + for delId, _ in ipairs(result) do | |
182 | + role:mylog("mail_action", {desc = "del_mail", int1 = delId}) | |
183 | + end | |
178 | 184 | SendPacket(actionCodes.Email_delRpc, MsgPack.pack({result = result})) |
179 | 185 | return true |
180 | 186 | end | ... | ... |
src/actions/FriendAction.lua
... | ... | @@ -111,6 +111,7 @@ function _M.searchRpc(agent, data) |
111 | 111 | })) |
112 | 112 | end |
113 | 113 | |
114 | + role:mylog("role_action", {desc = "searchFriend"}) | |
114 | 115 | SendPacket(actionCodes.Friend_searchRpc, MsgPack.pack({searchList = searchList})) |
115 | 116 | return true |
116 | 117 | end |
... | ... | @@ -177,6 +178,8 @@ function _M.applyRpc(agent, data) |
177 | 178 | myInfo.online = true |
178 | 179 | myInfo.hadApply = true |
179 | 180 | |
181 | + role:mylog("role_action", {desc = "addFriend", int1 = 1}) | |
182 | + | |
180 | 183 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方 |
181 | 184 | end |
182 | 185 | |
... | ... | @@ -283,6 +286,8 @@ function _M.handleApplyRpc(agent, data) |
283 | 286 | friend_roleid = objectId, -- 好友账户下的角色id |
284 | 287 | friend_cnt = curCount + 1, -- 操作后好友数量 |
285 | 288 | }) |
289 | + role:mylog("role_action", {desc = "addFriend", int1 = 1}) | |
290 | + | |
286 | 291 | end |
287 | 292 | |
288 | 293 | elseif cmd == 0 then -- 不同意 |
... | ... | @@ -347,6 +352,8 @@ function _M.handleApplyRpc(agent, data) |
347 | 352 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {myInfo}})) -- 通知对方 |
348 | 353 | end |
349 | 354 | if next(needAdd) then |
355 | + role:mylog("role_action", {desc = "addFriend", int1 = #needAdd}) | |
356 | + | |
350 | 357 | SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = needAddInfo})) |
351 | 358 | else |
352 | 359 | result = 1 |
... | ... | @@ -553,6 +560,8 @@ function _M.pointRpc(agent, data) |
553 | 560 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) |
554 | 561 | role:checkTaskEnter("GiveFriendP", {count = 1}) |
555 | 562 | rpcRole(objId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newPoint = 1, roleId = roleId})) |
563 | + | |
564 | + role:mylog("role_action", {desc = "giveFPoint", int1 = 1}) | |
556 | 565 | end |
557 | 566 | elseif cmd == 2 then -- 领取 |
558 | 567 | local objId = msg.roleId |
... | ... | @@ -572,6 +581,7 @@ function _M.pointRpc(agent, data) |
572 | 581 | role.dailyData:updateProperty({field = "getFP", value = getP}) |
573 | 582 | role:checkTaskEnter("GetFriendP", {count = 1}) |
574 | 583 | |
584 | + role:mylog("role_action", {desc = "getFPoint", int1 = 1}) | |
575 | 585 | end |
576 | 586 | elseif cmd == 3 then -- 一键赠送领取 |
577 | 587 | -- 赠送 |
... | ... | @@ -593,6 +603,8 @@ function _M.pointRpc(agent, data) |
593 | 603 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) |
594 | 604 | role:checkTaskEnter("GiveFriendP", {count = change}) |
595 | 605 | |
606 | + role:mylog("role_action", {desc = "giveFPoint", int1 = change}) | |
607 | + | |
596 | 608 | else |
597 | 609 | result = 1 |
598 | 610 | end |
... | ... | @@ -617,6 +629,7 @@ function _M.pointRpc(agent, data) |
617 | 629 | reward = role:award({[ItemId.FriendPoint] = getCount}, {log = {desc = "friendPoint"}}) |
618 | 630 | role.dailyData:updateProperty({field = "getFP", value = getP}) |
619 | 631 | role:checkTaskEnter("GetFriendP", {count = getCount}) |
632 | + role:mylog("role_action", {desc = "getFPoint", int1 = getCount}) | |
620 | 633 | else |
621 | 634 | result = (result or 0) + 2 |
622 | 635 | end | ... | ... |
src/actions/GmAction.lua
... | ... | @@ -446,18 +446,33 @@ function _M.email(role, pms) |
446 | 446 | return "成功" |
447 | 447 | end |
448 | 448 | |
449 | -table.insert(helpDes, {"清除引导", "cguide", "0全/1强/2弱"}) | |
450 | -function _M.cguide(role, pms) | |
451 | - local id = tonum(pms.pm1, 0) | |
452 | - if id == 0 then | |
453 | - role:updateProperties({ | |
454 | - newerGuide = "1=1", | |
455 | - funcGuide = "", | |
456 | - }, notNotify) | |
457 | - elseif id == 1 then | |
458 | - role:updateProperty({field = "newerGuide", value = "1=1"}) | |
459 | - elseif id == 2 then | |
460 | - role:updateProperty({field = "funcGuide", value = ""}) | |
449 | +table.insert(helpDes, {"引导", "guide", "skip/reset"}) | |
450 | +function _M.guide(role, pms) | |
451 | + local cmd = pms.pm1 or "un" | |
452 | + if cmd == "SKIP" then | |
453 | + role:updateProperty({field = "newerGuide", value = "9999=1"}) | |
454 | + local str = "" | |
455 | + for _, set in pairs(csvdb["guide_mainCsv"]) do | |
456 | + str = str:setv(set[1].major * 1000,1) | |
457 | + for _,data in ipairs(set) do | |
458 | + if data["break"] ~= 0 then | |
459 | + str = str:setv(data.major * 1000 + data.minor,1) | |
460 | + end | |
461 | + end | |
462 | + end | |
463 | + role:updateProperty({field = "funcGuide", value = str}) | |
464 | + elseif cmd == "RESET" then | |
465 | + local id = tonum(pms.pm2, 0) | |
466 | + if id == 0 then | |
467 | + role:updateProperties({ | |
468 | + newerGuide = "1=1", | |
469 | + funcGuide = "", | |
470 | + }, notNotify) | |
471 | + elseif id == 1 then | |
472 | + role:updateProperty({field = "newerGuide", value = "1=1"}) | |
473 | + elseif id == 2 then | |
474 | + role:updateProperty({field = "funcGuide", value = ""}) | |
475 | + end | |
461 | 476 | end |
462 | 477 | |
463 | 478 | return "成功" |
... | ... | @@ -472,7 +487,7 @@ function _M.test(role, pms) |
472 | 487 | local id = tonum(pms.pm1, 0) |
473 | 488 | --local hero = require ("actions.HeroAction") |
474 | 489 | --hero.unlockPoolRpc({role = role}, MsgPack.pack({type = id})) |
475 | - role.storeData:onBattleCardReset() | |
490 | + print(role:getNextCarbonId(id)) | |
476 | 491 | return "成功" |
477 | 492 | end |
478 | 493 | ... | ... |
src/actions/HangAction.lua
... | ... | @@ -258,6 +258,7 @@ function _M.endBattleRpc(agent, data) |
258 | 258 | role:finishGuide(5) |
259 | 259 | elseif carbonId == 10102 then |
260 | 260 | role:finishGuide(8) |
261 | + role:saveGuide(9, 2) | |
261 | 262 | elseif carbonId == 10103 then |
262 | 263 | role:finishGuide(9) |
263 | 264 | elseif carbonId == 10220 then |
... | ... | @@ -270,8 +271,15 @@ function _M.endBattleRpc(agent, data) |
270 | 271 | end |
271 | 272 | end |
272 | 273 | end |
273 | - if hangInfo.carbonId < carbonId then | |
274 | - hangInfo.carbonId = carbonId | |
274 | + local nextCarbonId = role:getNextCarbonId(carbonId) | |
275 | + -- 设置挂机关卡 | |
276 | + if isWin and hangInfo.carbonId < nextCarbonId then | |
277 | + hangInfo.carbonId = nextCarbonId | |
278 | + local cfg = csvdb["idle_battleCsv"][nextCarbonId] | |
279 | + if cfg then | |
280 | + hangInfo.bossTime = skynet.timex() + cfg.idle_time | |
281 | + print(hangInfo.bossTime) | |
282 | + end | |
275 | 283 | end |
276 | 284 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
277 | 285 | ... | ... |
src/actions/HeroAction.lua
... | ... | @@ -57,6 +57,7 @@ function _M.levelUpRpc( agent, data ) |
57 | 57 | if hero:getProperty("type") == 103 then |
58 | 58 | role:finishGuide(7) |
59 | 59 | end |
60 | + hero:mylog({desc = "levelUp", int1 = hero:getProperty("level")}) | |
60 | 61 | |
61 | 62 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) |
62 | 63 | SendPacket(actionCodes.Hero_levelUpRpc, '') |
... | ... | @@ -84,6 +85,7 @@ function _M.breakRpc( agent, data ) |
84 | 85 | hero_break_result = getChangeAttrJson(oldAttr, hero:getTotalAttrs()), -- 英雄突破效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} |
85 | 86 | hero_break_level = hero:getMaxLevel(), -- 英雄突破后等级上限 |
86 | 87 | }) |
88 | + hero:mylog({desc = "break", int1 = hero:getProperty("breakL")}) | |
87 | 89 | |
88 | 90 | SendPacket(actionCodes.Hero_breakRpc, '') |
89 | 91 | return true |
... | ... | @@ -107,6 +109,7 @@ function _M.wakeRpc(agent, data) |
107 | 109 | role:costItems(cost, {log = {desc = "heroWake", int1 = msg.id, int2 = hero:getProperty("type")}}) |
108 | 110 | |
109 | 111 | local oldAttr = hero:getTotalAttrs() |
112 | + local oldBattleV = hero:getProperty("battleV") | |
110 | 113 | hero:updateProperty({field = "wakeL", delta = 1}) |
111 | 114 | |
112 | 115 | local curLevel = hero:getProperty("wakeL") |
... | ... | @@ -114,11 +117,13 @@ function _M.wakeRpc(agent, data) |
114 | 117 | if curLevel == 4 then -- 解锁cg |
115 | 118 | role:checkTaskEnter("WakeCG", {heroType = typ}) |
116 | 119 | end |
120 | + hero:mylog({desc = "wake", int1 = hero:getProperty("wakeL")}) | |
117 | 121 | |
118 | 122 | role:log("hero_rise", { |
119 | 123 | hero_id = typ, --英雄ID |
120 | 124 | hero_rise_cost = cost, --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
121 | 125 | hero_rise_score = hero:getProperty("battleV"), --英雄觉醒后评分提升 |
126 | + hero_rise_scoreget = hero:getProperty("battleV") - oldBattleV, --英雄觉醒后评分提升 | |
122 | 127 | hero_rise_result = getChangeAttrJson(oldAttr, hero:getTotalAttrs()), --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} |
123 | 128 | }) |
124 | 129 | |
... | ... | @@ -195,10 +200,12 @@ function _M.talentRpc(agent, data) |
195 | 200 | |
196 | 201 | role:log("hero_talent", { |
197 | 202 | hero_id = hero:getProperty("type"), --英雄ID |
203 | + hero_talent_id = index, --天赋ID | |
198 | 204 | hero_talent_cost = cost, -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
199 | 205 | hero_talent_levelbef = oldSkillLv, -- 英雄技能升级前等级 |
200 | 206 | hero_talent_level = hero:getSkillLevel(1), -- 英雄技能升级后等级 |
201 | 207 | }) |
208 | + hero:mylog({desc = "talent", int1 = index, int2 = talent:getv(index, 0)}) | |
202 | 209 | |
203 | 210 | SendPacket(actionCodes.Hero_talentRpc, '') |
204 | 211 | return true |
... | ... | @@ -577,14 +584,16 @@ function _M.referRunesRpc(agent, data) |
577 | 584 | local attrChange = getChangeAttrJson(oldAttr, hero:getTotalAttrs()) |
578 | 585 | for runeId, typ in pairs(wear) do |
579 | 586 | local ownRune = role.runeBag[runeId] |
580 | - role:log("hero_jewel", { | |
581 | - hero_id = hero:getProperty("type"), -- 英雄ID | |
582 | - hero_jewel_id = ownRune:getProperty("id"), -- 铭文ID | |
583 | - hero_jewel_part = typ, -- 铭文装备部位 | |
584 | - hero_jewel_score = hero:getProperty("battleV"), -- 铭文装备后的英雄分值 | |
585 | - hero_jewel_scorebefore = oldBattleV, -- 铭文装备前的英雄分值 | |
586 | - hero_jewel_result = attrChange, -- 铭文装备后效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} | |
587 | - }) | |
587 | + if ownRune then | |
588 | + role:log("hero_jewel", { | |
589 | + hero_id = hero:getProperty("type"), -- 英雄ID | |
590 | + hero_jewel_id = ownRune:getProperty("id"), -- 铭文ID | |
591 | + hero_jewel_part = typ, -- 铭文装备部位 | |
592 | + hero_jewel_score = hero:getProperty("battleV"), -- 铭文装备后的英雄分值 | |
593 | + hero_jewel_scorebefore = oldBattleV, -- 铭文装备前的英雄分值 | |
594 | + hero_jewel_result = attrChange, -- 铭文装备后效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} | |
595 | + }) | |
596 | + end | |
588 | 597 | end |
589 | 598 | |
590 | 599 | SendPacket(actionCodes.Hero_referRunesRpc, "") |
... | ... | @@ -691,6 +700,7 @@ function _M.getResetRewardRpc(agent, data) |
691 | 700 | equip = "", |
692 | 701 | rune = "", |
693 | 702 | }) |
703 | + hero:mylog({desc = "resetHero"}) | |
694 | 704 | |
695 | 705 | for itemId, count in pairs(reward) do |
696 | 706 | reward[itemId] = math.floor(count * globalCsv.unit_back_discount) |
... | ... | @@ -830,6 +840,7 @@ function _M.drawHeroRpc(agent, data) |
830 | 840 | |
831 | 841 | local ssrCount = 0 |
832 | 842 | local reward = {} |
843 | + local logReward = {} | |
833 | 844 | for i = 1, drawCount[drawType] do |
834 | 845 | floorHeroCount = floorHeroCount + 1 |
835 | 846 | local isFloorBack = draw_floor_back_counts and floorHeroCount >= draw_floor_back_counts |
... | ... | @@ -860,9 +871,11 @@ function _M.drawHeroRpc(agent, data) |
860 | 871 | local heroData = csvdb["unitCsv"][fragId] |
861 | 872 | local count = globalCsv.draw_unit_tofragment[heroData.rare] |
862 | 873 | role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) |
874 | + logReward[fragId] = (logReward[fragId] or 0) + count | |
863 | 875 | table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) |
864 | 876 | else |
865 | 877 | role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) |
878 | + logReward[itemId] = (logReward[itemId] or 0) + 1 | |
866 | 879 | table.insert(reward, {id = itemId, count = 1}) |
867 | 880 | end |
868 | 881 | end |
... | ... | @@ -873,27 +886,50 @@ function _M.drawHeroRpc(agent, data) |
873 | 886 | role:setProperty("floorHero", floorHero) |
874 | 887 | end |
875 | 888 | |
876 | - if btype == 1 or btype == 2 then | |
877 | - local repayHero = role:getProperty("repayHero") or 0 | |
878 | - repayHero = repayHero + drawCount[drawType] | |
879 | - role:updateProperty({field = "repayHero", value = repayHero}) | |
880 | - end | |
881 | - | |
882 | 889 | role:checkTaskEnter("DrawHero", {pool = btype, count = drawCount[drawType]}) |
883 | 890 | if ssrCount > 0 then |
884 | 891 | role:checkTaskEnter("DrawSSR", {count = ssrCount}) |
885 | 892 | end |
886 | 893 | role:finishGuide(11) |
887 | - | |
894 | + | |
888 | 895 | role:log("gacha", { |
889 | 896 | gacha_id = poolId, -- 卡池ID |
890 | 897 | gacha_type = btype, -- 卡池类型 |
891 | 898 | gacha_up = 0, -- 卡池UP角色 |
892 | 899 | gacha_times = drawCount[drawType], -- 抽卡次数 |
893 | - gacha_reward = reward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | |
900 | + gacha_reward = logReward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | |
894 | 901 | currency = cost, -- 购买道具消耗的货币 |
902 | + gacha_cnt = floorHeroCount, | |
895 | 903 | }) |
896 | 904 | SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 |
905 | + | |
906 | + if btype == 1 or btype == 2 then | |
907 | + -- 达到一定次数,给响应奖励 | |
908 | + local oldVal = role:getProperty("repayHero") or 0 | |
909 | + local newVal = oldVal + drawCount[drawType] | |
910 | + local drawCardReward, val = role:getDrawCardExtraReward(oldVal, newVal) | |
911 | + -- 空字符穿代表直接给英雄 走以前repayHeroRpc | |
912 | + if drawCardReward == "" then | |
913 | + local id = math.randWeight(csvdb["build_giftCsv"], "pool_1") | |
914 | + | |
915 | + local r,change = {} | |
916 | + local itemData = csvdb["itemCsv"][id] | |
917 | + --if itemData.type == ItemType.Hero and role:isHaveHero(itemData.id - ItemStartId.Hero) then | |
918 | + -- local fragId = itemData.id - ItemStartId.Hero | |
919 | + -- local heroData = csvdb["unitCsv"][fragId] | |
920 | + -- local count = globalCsv.draw_unit_tofragment[heroData.rare] | |
921 | + -- r, change = role:award({[fragId] = count}, {log = {desc = "drawHeroExtraReward"}}) | |
922 | + -- --r = {id = fragId, count = count, from = id, fcount = 1} | |
923 | + --else | |
924 | + r, change = role:award({[id] = 1}, {log = {desc = "drawHeroExtraReward"}}) | |
925 | + --end | |
926 | + SendPacket(actionCodes.Hero_drawHeroExtraRewardNtf, MsgPack.pack(role:packReward(r, change))) | |
927 | + elseif drawCardReward and drawCardReward ~= "" then | |
928 | + role:award(drawCardReward, {log = {desc = "drawHeroExtraReward", int1 = oldVal, int2 = newVal}}) | |
929 | + SendPacket(actionCodes.Hero_drawHeroExtraRewardNtf, MsgPack.pack({reward = drawCardReward:toNumMap()})) | |
930 | + end | |
931 | + role:updateProperty({field = "repayHero", value = val}) | |
932 | + end | |
897 | 933 | return true |
898 | 934 | end |
899 | 935 | |
... | ... | @@ -922,6 +958,7 @@ function _M.repayHeroRpc(agent, data) |
922 | 958 | role:award({[id] = 1}, {log = {desc = "heroRepay"}}) |
923 | 959 | reward = {id = id, count = 1} |
924 | 960 | end |
961 | + role:mylog("hero_action", {desc = "heroRepay", int1=result}) | |
925 | 962 | SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward})) |
926 | 963 | return true |
927 | 964 | end |
... | ... | @@ -953,7 +990,7 @@ function _M.unlockPoolRpc(agent, data) |
953 | 990 | role.dailyData:updateProperty({field="unlockPool", value = unlockPool}) |
954 | 991 | role.dailyData:updateProperty({field="curPool", value = type}) |
955 | 992 | |
956 | - --role:log("hero_action", {desc = "unlockPool", int1=type}) | |
993 | + role:mylog("hero_action", {desc = "unlockPool", int1=type}) | |
957 | 994 | SendPacket(actionCodes.Hero_unlockPoolRpc, MsgPack.pack({})) |
958 | 995 | return true |
959 | 996 | end | ... | ... |
src/actions/PvpAction.lua
... | ... | @@ -296,6 +296,9 @@ 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:mylog("pvp_action", {desc = "startBattle", short1 = 1, int1 = revenge and 1 or 0}) | |
299 | 302 | end |
300 | 303 | |
301 | 304 | SendPacket(actionCodes.Pvp_startBattleRpc, MsgPack.pack({matchInfo = matchInfo, key = key, result = result, wait = wait})) |
... | ... | @@ -393,6 +396,7 @@ function _M.endBattleRpc(agent, data) |
393 | 396 | reward = reward, |
394 | 397 | rank = myRank, |
395 | 398 | }) |
399 | + role:mylog("pvp_action", {desc = "battleEnd", short1 = 1, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0}) | |
396 | 400 | |
397 | 401 | _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 |
398 | 402 | _pvpRecordInfoCacheC = {} -- 记录刷新了 |
... | ... | @@ -525,6 +529,8 @@ function _M.startBattleHRpc(agent, data) |
525 | 529 | |
526 | 530 | role:checkTaskEnter("PvpBattle") |
527 | 531 | |
532 | + role:mylog("pvp_action", {desc = "startBattle", short1 = 2, int1 = revenge and 1 or 0}) | |
533 | + | |
528 | 534 | end |
529 | 535 | |
530 | 536 | SendPacket(actionCodes.Pvp_startBattleHRpc, MsgPack.pack({ |
... | ... | @@ -707,7 +713,8 @@ function _M.endBattleHRpc(agent, data) |
707 | 713 | if isWin then |
708 | 714 | role:checkTaskEnter("PvpWin", {score = myScore}) |
709 | 715 | end |
710 | - | |
716 | + role:mylog("pvp_action", {desc = "battleEnd", short1 = 2, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0}) | |
717 | + | |
711 | 718 | SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ |
712 | 719 | reward = reward, |
713 | 720 | change = change, |
... | ... | @@ -855,6 +862,7 @@ function _M.highDivisionGiftRpc(agent, data) |
855 | 862 | }) |
856 | 863 | |
857 | 864 | local reward, change = role:award(newReward, {log = {desc = "pvpDivisionH"}}) |
865 | + role:mylog("pvp_action", {desc = "pvpDivisionH"}) | |
858 | 866 | |
859 | 867 | SendPacket(actionCodes.Pvp_highDivisionGiftRpc, MsgPack.pack(role:packReward(reward, change))) |
860 | 868 | return true |
... | ... | @@ -889,6 +897,8 @@ function _M.shopBuyRpc(agent, data) |
889 | 897 | end |
890 | 898 | local reward, change = role:award(gift, {log = {desc = "pvpShop", int1 = id, int2 = count}}) |
891 | 899 | |
900 | + role:mylog("pvp_action", {desc = "pvpShop", int1 = id, int2 = count}) | |
901 | + | |
892 | 902 | SendPacket(actionCodes.Pvp_shopBuyRpc, MsgPack.pack(role:packReward(reward, change))) |
893 | 903 | return true |
894 | 904 | end |
... | ... | @@ -980,6 +990,7 @@ function _M.crossBetRpc(agent, data) |
980 | 990 | local result, code = role:setCrossServerPvpBet(msg.idx) |
981 | 991 | if not result then return 10 + code end |
982 | 992 | |
993 | + role:mylog("pvp_action", {desc = "crossBet"}) | |
983 | 994 | SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result)) |
984 | 995 | return true |
985 | 996 | end | ... | ... |
src/actions/RoleAction.lua
... | ... | @@ -173,7 +173,7 @@ function _M.loginRpc( agent, data ) |
173 | 173 | response.role = role:data() |
174 | 174 | response.result = "SUCCESS" |
175 | 175 | response.serverTime = now |
176 | - response.openTime = getServerOpenTs() | |
176 | + --response.openTime = getServerOpenTs() | |
177 | 177 | |
178 | 178 | local modules = {} |
179 | 179 | |
... | ... | @@ -549,7 +549,6 @@ function _M.openTimeBoxRpc(agent, data) |
549 | 549 | local quick = msg.quick |
550 | 550 | if not boxL[slot] then return end |
551 | 551 | local costKey = 0 |
552 | - local costTime = skynet.timex() - boxL[slot].time | |
553 | 552 | if boxL[slot].time > skynet.timex() then -- 没开完 |
554 | 553 | if not quick then return end |
555 | 554 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") |
... | ... | @@ -560,6 +559,7 @@ function _M.openTimeBoxRpc(agent, data) |
560 | 559 | local boxId = boxL[slot].id |
561 | 560 | local itemData = csvdb["itemCsv"][boxId] |
562 | 561 | local randomData = csvdb["item_randomCsv"][itemData.id] |
562 | + local costTime = skynet.timex() - (boxL[slot].time - randomData.openTime) | |
563 | 563 | -- 随机奖励 |
564 | 564 | reward = {} |
565 | 565 | for i = 1, 10 do |
... | ... | @@ -684,7 +684,7 @@ function _M.storyBookRewardRpc(agent, data) |
684 | 684 | role:changeUpdates({{ type = "storyB", field = storyId, value = storyStatus[storyId] }}) |
685 | 685 | local reward, change = role:award(storyBookData.gift, {log = {desc = "storybookReward", int1 = storyId}}) |
686 | 686 | |
687 | - role:log("carriage_decals", { | |
687 | + role:log("carriage_video", { | |
688 | 688 | carriage_video_type = storyBookData.type, --放映室类型,剧情CG:0, 角色CG:1, 主线剧情:2, 角色剧情:3, 活动剧情:4, 图鉴:5 |
689 | 689 | carriage_video_id = storyId, --放映室片段ID |
690 | 690 | carriage_video_coinid = reward[ItemId.Gold] and ItemId.Gold or 0, --放映奖励货币类型,无奖励则填写0 |
... | ... | @@ -1207,4 +1207,31 @@ function _M.updateFeedbackInfoRpc(agent, data) |
1207 | 1207 | return true |
1208 | 1208 | end |
1209 | 1209 | |
1210 | +function _M.useSelectItemRpc(agent, data) | |
1211 | + local role = agent.role | |
1212 | + local msg = MsgPack.unpack(data) | |
1213 | + local itemId = msg.itemId | |
1214 | + local index = msg.index | |
1215 | + local count = msg.count | |
1216 | + if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end | |
1217 | + local itemData = csvdb["itemCsv"][itemId] | |
1218 | + if itemData.type ~= ItemType.SelectItemBox then return end | |
1219 | + local itemMap = itemData.use_effect:toNumMap() | |
1220 | + local i = 1 | |
1221 | + local reward, change = {} | |
1222 | + for k, v in pairs(itemMap) do | |
1223 | + if i == index then | |
1224 | + reward[k] = v * count | |
1225 | + break | |
1226 | + end | |
1227 | + i = i + 1 | |
1228 | + end | |
1229 | + | |
1230 | + if next(reward) then | |
1231 | + reward, change = role:award(reward, {log = {desc = "openItem", int1 = itemId, int2 = count}}) | |
1232 | + role:costItems({[itemId] = count}, {log = {desc = "openItem"}}) | |
1233 | + end | |
1234 | + SendPacket(actionCodes.Role_useSelectItemRpc, MsgPack.pack(role:packReward(reward, change))) | |
1235 | +end | |
1236 | + | |
1210 | 1237 | return _M |
1211 | 1238 | \ No newline at end of file | ... | ... |
src/actions/StoreAction.lua
... | ... | @@ -178,7 +178,7 @@ function _M.purchaseOrderResult(agent, data) |
178 | 178 | item_level = 1, -- 购买的道具等级 |
179 | 179 | order_cost = dataSet.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' |
180 | 180 | order_currency = "CNY", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 |
181 | - order_type = self.getProperty("rmbC") > 0 and 0 or 1, -- 订单类型,首充记录为1,否则为0 | |
181 | + order_type = role:getProperty("rmbC") > 0 and 0 or 1, -- 订单类型,首充记录为1,否则为0 | |
182 | 182 | order_id = msg.platformOrder, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' |
183 | 183 | }) |
184 | 184 | |
... | ... | @@ -206,7 +206,7 @@ function _M.shopBuyRpc(agent , data) |
206 | 206 | if not dataSet then return end |
207 | 207 | |
208 | 208 | if dataSet.unlock ~= "" then |
209 | - if not role:checkHangPass(tonumber(config.unlock)) then | |
209 | + if not role:checkHangPass(tonumber(dataSet.unlock)) then | |
210 | 210 | skynet.error(string.format("shopBuyRpc,user do not finish hang pass, user_id:%d", role:getProperty("id"))) |
211 | 211 | return 1 |
212 | 212 | end |
... | ... | @@ -261,6 +261,7 @@ function _M.shopBuyRpc(agent , data) |
261 | 261 | shop_purchase_current = costCount or 0, -- 购买道具消耗的货币数量 |
262 | 262 | shop_id = dataSet.shop, -- 商店ID |
263 | 263 | }) |
264 | + role:mylog("role_action", {desc = desc, int1 = id, int2 = count}) | |
264 | 265 | SendPacket(actionCodes.Store_shopBuyRpc, MsgPack.pack({reward = reward})) |
265 | 266 | return true |
266 | 267 | end |
... | ... | @@ -385,7 +386,7 @@ function _M.getExploreCommandRewardRpc(agent, data) |
385 | 386 | local id = msg.id -- 探索id |
386 | 387 | local subId = msg.subId -- 领取的阶段id |
387 | 388 | |
388 | - local tab_name = "reward_battlepass_" .. id .. "Csv" | |
389 | + local tab_name = "reward_levelpass" .. id .. "Csv" | |
389 | 390 | local config = csvdb[tab_name][id] |
390 | 391 | if not config then return end |
391 | 392 | |
... | ... | @@ -409,7 +410,7 @@ function _M.getExploreCommandRewardRpc(agent, data) |
409 | 410 | return 3 |
410 | 411 | end |
411 | 412 | |
412 | - if not role:checkHangPass(config.carbonId) then | |
413 | + if not role:checkHangPass(config.level) then | |
413 | 414 | return 4 |
414 | 415 | end |
415 | 416 | ... | ... |
src/actions/TowerAction.lua
... | ... | @@ -75,7 +75,7 @@ function _M.startBattleRpc(agent, data) |
75 | 75 | |
76 | 76 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
77 | 77 | role:checkTaskEnter("TowerBattle", {level = towerInfo.l}) |
78 | - | |
78 | + role:mylog("tower_action", {desc = "startBattle", int1 = id}) | |
79 | 79 | SendPacket(actionCodes.Tower_startBattleRpc, '') |
80 | 80 | return true |
81 | 81 | end |
... | ... | @@ -128,6 +128,7 @@ function _M.endBattleRpc(agent, data) |
128 | 128 | reward = reward, |
129 | 129 | rank = rank, |
130 | 130 | }) |
131 | + role:mylog("tower_action", {desc = "endBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id}) | |
131 | 132 | |
132 | 133 | SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward, change = change})) |
133 | 134 | return true |
... | ... | @@ -151,7 +152,7 @@ function _M.bugCountRpc(agent, data) |
151 | 152 | towerInfo.c = curCount |
152 | 153 | towerInfo.t = nextTime |
153 | 154 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
154 | - | |
155 | + role:mylog("tower_action", {desc = "bugCount"}) | |
155 | 156 | SendPacket(actionCodes.Tower_bugCountRpc, '') |
156 | 157 | return true |
157 | 158 | end | ... | ... |
src/adv/Adv.lua
... | ... | @@ -24,6 +24,17 @@ function Adv:ctor(owner) |
24 | 24 | self:initByInfo(self.owner:getProperty("advInfo")) |
25 | 25 | end |
26 | 26 | |
27 | +function Adv:mylog(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:mylog("adv_action", contents) | |
36 | +end | |
37 | + | |
27 | 38 | --初始化adv 信息 |
28 | 39 | function Adv:initByInfo(advInfo) |
29 | 40 | if not next(advInfo) then return end --还没有 开始新地图 |
... | ... | @@ -498,18 +509,18 @@ function Adv:awardArtifact(id, params) |
498 | 509 | self:checkAchievement(Adv.AchievType.GetMWeapon, 1, id) |
499 | 510 | |
500 | 511 | |
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 | |
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:mylog("in_artifact", log) | |
521 | + else | |
522 | + print("awardArtifact no log ", debug.traceback()) | |
523 | + end | |
513 | 524 | if not params.isChoose then |
514 | 525 | self:pushBackEvent(AdvBackEventType.Artifact, {id = id}) |
515 | 526 | end |
... | ... | @@ -598,6 +609,7 @@ function Adv:wearArtifact(slot, id) |
598 | 609 | else |
599 | 610 | id = nil |
600 | 611 | end |
612 | + self:mylog({desc = "wearArtifact", int1 = id}) | |
601 | 613 | |
602 | 614 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) |
603 | 615 | return true |
... | ... | @@ -656,6 +668,9 @@ function Adv:artifactLevelUp(id, level) |
656 | 668 | end |
657 | 669 | if newLv == advAFGet[id] then return end |
658 | 670 | |
671 | + self:mylog({desc = "artifactLevelUp", int1 = id, int2 = level}) | |
672 | + | |
673 | + | |
659 | 674 | local status = 0 |
660 | 675 | if curWear[id] then -- 穿着呢 |
661 | 676 | local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] |
... | ... | @@ -700,6 +715,8 @@ function Adv:chooseArtifact(index) |
700 | 715 | if not self.waitArtifact or not self.waitArtifact[index] then return end |
701 | 716 | self:award({[self.waitArtifact[index]] = 1}, {log = {desc = "chooseArtifact"}, isChoose = true}) |
702 | 717 | |
718 | + self:mylog({desc = "chooseArtifact", int1 = self.waitArtifact[index]}) | |
719 | + | |
703 | 720 | self.waitArtifact = nil |
704 | 721 | |
705 | 722 | -- 支援效果继续选择 |
... | ... | @@ -796,6 +813,8 @@ function Adv:over(success, rewardRatio, overType) |
796 | 813 | end |
797 | 814 | self:clearAdvUnlockCache() |
798 | 815 | |
816 | + self:mylog({desc = "over", short1 = success and 1 or 0, int1 = overType}) | |
817 | + | |
799 | 818 | local chapterId = self.chapterId |
800 | 819 | self:clear() |
801 | 820 | self.owner:checkTaskEnter("AdvScore", {score = score}) |
... | ... | @@ -899,23 +918,26 @@ function Adv:award(gift, params) |
899 | 918 | items = items:setv(itemId, nums) |
900 | 919 | end |
901 | 920 | |
902 | - -- if params.log then | |
903 | - -- local log = clone(params.log) | |
904 | - -- if log["cint1"] or log["cint2"] or log["cint3"] or log["long1"] then | |
905 | - -- print("addAdvItem error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
906 | - -- end | |
907 | - -- log["cint1"] = itemId | |
908 | - -- log["cint2"] = math.abs(count) | |
909 | - -- log["cint3"] = self.chapterId | |
910 | - -- log["long1"] = self.level | |
911 | - -- if count >= 0 then | |
912 | - -- self.owner:log("in_adv", log) | |
913 | - -- else | |
914 | - -- self.owner:log("out_adv", log) | |
915 | - -- end | |
916 | - -- else | |
917 | - -- print("addAdvItem no log ", debug.traceback()) | |
918 | - -- end | |
921 | + if itemId == 16 and not self.owner:checkOverGuide(51,4) then | |
922 | + self.owner:saveGuide(51,4) | |
923 | + end | |
924 | + if params.log then | |
925 | + local log = clone(params.log) | |
926 | + if log["cint1"] or log["cint2"] or log["cint3"] or log["long1"] then | |
927 | + print("addAdvItem error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
928 | + end | |
929 | + log["cint1"] = itemId | |
930 | + log["cint2"] = math.abs(count) | |
931 | + log["cint3"] = self.chapterId | |
932 | + log["long1"] = self.level | |
933 | + if count >= 0 then | |
934 | + self.owner:mylog("in_adv", log) | |
935 | + else | |
936 | + self.owner:mylog("out_adv", log) | |
937 | + end | |
938 | + else | |
939 | + print("addAdvItem no log ", debug.traceback()) | |
940 | + end | |
919 | 941 | end |
920 | 942 | end |
921 | 943 | if items ~= oldItems then |
... | ... | @@ -1009,6 +1031,7 @@ local function clickOut(self, room, block, params, isExit) |
1009 | 1031 | isRelay = true, |
1010 | 1032 | }) |
1011 | 1033 | else |
1034 | + self:mylog({desc = "pass"}) | |
1012 | 1035 | self:initByChapter({ |
1013 | 1036 | chapterId = self.chapterId, |
1014 | 1037 | level = self.level + 1, | ... | ... |
src/adv/AdvMap.lua
... | ... | @@ -553,7 +553,11 @@ createMap = function(self, mapId, isEnter, isNewRelay) |
553 | 553 | if randomCommon() == false then |
554 | 554 | return false |
555 | 555 | end |
556 | - table.insert(monsterEvents, event) | |
556 | + local curData = csvdb["event_monsterCsv"][event.id] | |
557 | + if curData.noKey and curData.noKey == 1 then | |
558 | + else | |
559 | + table.insert(monsterEvents, event) | |
560 | + end | |
557 | 561 | end |
558 | 562 | |
559 | 563 | --选择点 | ... | ... |
src/adv/AdvTask.lua
... | ... | @@ -376,6 +376,7 @@ function AdvTask.bind(Adv) |
376 | 376 | else |
377 | 377 | if (status or -1) >= data.value1 then |
378 | 378 | status = -1 |
379 | + self.owner:mylog("adv_action", {desc = "finishAchiev", short1 = 1, int1 = self.chapterId, int2 = taskId}) | |
379 | 380 | end |
380 | 381 | if status and status ~= oldStatus then |
381 | 382 | insertChange(self, self.chapterId, taskId, status) | ... | ... |
src/agent.lua
... | ... | @@ -285,6 +285,7 @@ function CMD.close() |
285 | 285 | local role = agentInfo.role |
286 | 286 | if not role then return end |
287 | 287 | role:log("onLogout", {logtime = skynet.timex()-role:getProperty("ltime")}) |
288 | + role:mylog("logout", {int1 = skynet.timex()-role:getProperty("ltime")}) | |
288 | 289 | role:onOfflineEvent() |
289 | 290 | end |
290 | 291 | ... | ... |
src/models/Activity.lua
... | ... | @@ -260,7 +260,6 @@ activityFunc[Activity.ActivityType.DrawHero] = { |
260 | 260 | -- ["close"] = function(self, actType, notify) |
261 | 261 | -- end, |
262 | 262 | ["crossDay"] = function(self, actType, notify) |
263 | - print("cross day draw card") | |
264 | 263 | self.owner:sendMail(MailId.ActDrawCard) |
265 | 264 | end, |
266 | 265 | } |
... | ... | @@ -278,7 +277,6 @@ activityFunc[Activity.ActivityType.FoodSell] = { |
278 | 277 | -- ["close"] = function(self, actType, notify) |
279 | 278 | -- end, |
280 | 279 | ["crossDay"] = function(self, actType, notify) |
281 | - print("cross day sell food") | |
282 | 280 | self.owner:sendMail(MailId.ActSellFood) |
283 | 281 | end, |
284 | 282 | } |
... | ... | @@ -313,7 +311,6 @@ activityFunc[Activity.ActivityType.OpenBox] = { |
313 | 311 | -- ["close"] = function(self, actType, notify) |
314 | 312 | -- end, |
315 | 313 | ["crossDay"] = function(self, actType, notify) |
316 | - print("cross day open box") | |
317 | 314 | self.owner:sendMail(MailId.ActOpenBox) |
318 | 315 | end, |
319 | 316 | } |
... | ... | @@ -407,9 +404,9 @@ function Activity:getPaySignReward() |
407 | 404 | |
408 | 405 | local diffDay = diffFromOpen() + 1 |
409 | 406 | |
410 | - local curData = self.activity:getActData("PaySignIn") | |
407 | + local curData = self:getActData("PaySignIn") | |
411 | 408 | local reward, change = {} |
412 | - for day, csvData in ipairs(csvdb["pay_signInCsv"]) do | |
409 | + for day, csvData in pairs(csvdb["pay_signInCsv"]) do | |
413 | 410 | if day <= diffDay then |
414 | 411 | if not curData[day] then |
415 | 412 | curData[day] = 1 | ... | ... |
src/models/HeroPlugin.lua
... | ... | @@ -3,7 +3,7 @@ local HeroPlugin = {} |
3 | 3 | |
4 | 4 | function HeroPlugin.bind(Hero) |
5 | 5 | |
6 | - function Hero:log(contents) | |
6 | + function Hero:mylog(contents) | |
7 | 7 | contents = contents or {} |
8 | 8 | if contents["cint1"] or contents["cint2"] or contents["cint3"] then |
9 | 9 | print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback()) |
... | ... | @@ -11,7 +11,7 @@ function HeroPlugin.bind(Hero) |
11 | 11 | contents["cint1"] = self:getProperty("id") |
12 | 12 | contents["cint2"] = self:getProperty("type") |
13 | 13 | |
14 | - self.owner:log("hero_action", contents) | |
14 | + self.owner:mylog("hero_action", contents) | |
15 | 15 | end |
16 | 16 | |
17 | 17 | function Hero:getMaxLevel() | ... | ... |
src/models/RoleLog.lua
1 | -local server_id = (skynet.getenv("serverType") or "localtest") .. "_" .. skynet.getenv("servId") | |
1 | +local serverId = skynet.getenv("servId") | |
2 | +local server_id = (skynet.getenv("serverType") or "localtest") .. "_" .. serverId | |
2 | 3 | |
3 | 4 | --[[ |
4 | 5 | 100 购买/兑换行为 |
... | ... | @@ -40,6 +41,7 @@ local ItemReason = { |
40 | 41 | towerCount = 126, -- 电波塔次数 |
41 | 42 | freeGift = 127, -- 免费礼包 |
42 | 43 | exploreCommand = 128, -- 探索指令 |
44 | + drawHeroExtraReward = 129, -- 抽卡阶段奖励 | |
43 | 45 | |
44 | 46 | |
45 | 47 | advHang = 301, -- 拾荒挂机 |
... | ... | @@ -197,10 +199,9 @@ local MethodType = { |
197 | 199 | mission_strength = true, -- 消耗的体力或次数 |
198 | 200 | mission_score = true, -- 本局分数,PVP玩法记录为对战后积分,无得分的填0 |
199 | 201 | mission_cleartype = true, -- 1正常通关;2代理拾荒 |
200 | - mission_rank = true, -- 对战后排名,适用于PVP玩法和电波塔,其他玩法留空 | |
202 | + mission_rank = "auto", -- 对战后排名,适用于PVP玩法和电波塔,其他玩法留空 | |
201 | 203 | misson_monsterkill = "json", -- 击杀怪物ID和数量,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
202 | 204 | misson_teamskill = "json", -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..} |
203 | - misson_teambond = "json", -- 编队羁绊和羁绊等级,json格式记录,{"bondid1":1,"bondid2":2,………..} | |
204 | 205 | }, |
205 | 206 | residence_reward = { --玩家挂机或排名奖励 |
206 | 207 | mission_threadid = true, --大关卡ID |
... | ... | @@ -214,6 +215,7 @@ local MethodType = { |
214 | 215 | hero_id = true, --英雄ID |
215 | 216 | hero_rise_cost = "json", --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
216 | 217 | hero_rise_score = true, --英雄觉醒后评分提升 |
218 | + hero_rise_scoreget = true, -- 提升的评分 | |
217 | 219 | hero_rise_result = "json", --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} |
218 | 220 | }, |
219 | 221 | hero_upgrade = { --英雄升级 |
... | ... | @@ -235,6 +237,7 @@ local MethodType = { |
235 | 237 | hero_talent_cost = "json", -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
236 | 238 | hero_talent_levelbef = true, -- 英雄技能升级前等级 |
237 | 239 | hero_talent_level = true, -- 英雄技能升级后等级 |
240 | + hero_talent_id = true, -- 天赋id | |
238 | 241 | }, |
239 | 242 | hero_jewel = { --英雄铭文 |
240 | 243 | hero_id = true, -- 英雄ID |
... | ... | @@ -266,6 +269,7 @@ local MethodType = { |
266 | 269 | gacha_times = true, -- 抽卡次数 |
267 | 270 | gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
268 | 271 | currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
272 | + gacha_cnt = true, -- 保底计数 | |
269 | 273 | }, |
270 | 274 | equip_wear = { --装备穿戴与卸载 |
271 | 275 | hero_id = true, --英雄ID |
... | ... | @@ -283,7 +287,7 @@ local MethodType = { |
283 | 287 | equip_upgrade_amount = true, -- 升级获取的装备数量 |
284 | 288 | equip_upgrade_usedid = true, -- 升级消耗的装备ID |
285 | 289 | equip_upgrade_cost = true, -- 升级操作消耗装备数量 |
286 | - equip_upgrade_current = true, -- 升级操作消耗货币数量 | |
290 | + equip_upgrade_current = "json", -- 升级操作消耗货币数量 | |
287 | 291 | }, |
288 | 292 | carriage_dismantle = { --物资拆解 |
289 | 293 | item_id = true, -- 道具id |
... | ... | @@ -463,6 +467,178 @@ local function getBaseLog(self) |
463 | 467 | end |
464 | 468 | |
465 | 469 | |
470 | +-- logType | |
471 | +local LogType = { | |
472 | + create = "common", | |
473 | + login = "common", | |
474 | + logout = "common", | |
475 | + guide = "common", | |
476 | + | |
477 | + in_item = "common", | |
478 | + out_item = "common", | |
479 | + in_diamond = "common", | |
480 | + out_diamond = "common", | |
481 | + in_hero = "common", | |
482 | + out_hero = "common", | |
483 | + in_equip = "common", | |
484 | + out_equip = "common", | |
485 | + in_rune = "common", | |
486 | + out_rune = "common", | |
487 | + player_exp = "common", | |
488 | + func_open = "common", | |
489 | + in_adv = "common", | |
490 | + out_adv = "common", | |
491 | + in_artifact = "common", | |
492 | + | |
493 | + mail_action = "common", | |
494 | + role_action = "common", | |
495 | + hang_action = "common", | |
496 | + hero_action = "common", | |
497 | + adv_action = "common", | |
498 | + rune_action = "common", | |
499 | + pvp_action = "common", | |
500 | + diner_action = "common", | |
501 | + tower_action = "common", | |
502 | + gm_action = "common", | |
503 | + act_action = "common", | |
504 | +} | |
505 | + | |
506 | +-- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* | |
507 | +local Mapping = { | |
508 | + -- 预留一些数据格式 担心integer 范围不够用 将 通用的int* 全部换为long | |
509 | + common = { | |
510 | + desc = "keyword",--索引的短字符串 | |
511 | + ucode = "keyword",--关联日志对应ucode | |
512 | + key1 = "keyword", --可索引的短字符串 | |
513 | + key2 = "keyword", --可索引的短字符串 | |
514 | + -- 几乎不用的长文本 | |
515 | + text1 = "text", --长字符串不索引的类型 | |
516 | + -- 五个不同类型的数字 基本上满足数量要求 尽量从低到高用 | |
517 | + short1 = "short", | |
518 | + int1 = "long", | |
519 | + int2 = "long", | |
520 | + long1 = "long", | |
521 | + float1 = "float", | |
522 | + | |
523 | + -- 底层使用的 一些参数 | |
524 | + cint1 = "long", | |
525 | + cint2 = "long", | |
526 | + cint3 = "long", | |
527 | + } | |
528 | +} | |
529 | + | |
530 | +-- 所有的日志都包括的部分 role 里面的信息 -- mapping 信息在 gamelog-role | |
531 | +local commonRoleField = { | |
532 | + name = "keyword", | |
533 | + id = "integer", | |
534 | + uid = "keyword", | |
535 | + sid = "short", | |
536 | + device = "keyword", | |
537 | + ctime = "integer", | |
538 | + ltime = "integer", | |
539 | + level = "short", | |
540 | + rmbC = "integer", | |
541 | +} | |
542 | + | |
543 | +local function checkType(logType, field, value, ctype) | |
544 | + local typecheckfunc = { | |
545 | + keyword = function() | |
546 | + --长度不超过256 | |
547 | + if type(value) ~= "string" then | |
548 | + value = tostring(value) | |
549 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [keyword], value : %s", logType, field, value)) | |
550 | + else | |
551 | + if #value > 256 then | |
552 | + printError(string.format("LOG ERROR: logType [%s] field [%s] [keyword] type to long. value : %s", logType, field, value)) | |
553 | + end | |
554 | + end | |
555 | + return value | |
556 | + end, | |
557 | + text = function() | |
558 | + if type(value) ~= "string" then | |
559 | + value = tostring(value) | |
560 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [text], value : %s", logType, field, value)) | |
561 | + end | |
562 | + return value | |
563 | + end, | |
564 | + integer = function() | |
565 | + if type(value) ~= "number" then | |
566 | + value = tonumber(value) | |
567 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], value : %s", logType, field, value)) | |
568 | + end | |
569 | + if value then | |
570 | + if math.type(value) ~= "integer" then | |
571 | + local oldValue = value | |
572 | + value = math.floor(value) | |
573 | + if value ~= oldValue then | |
574 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], is float, value : %s", logType, field, value)) | |
575 | + end | |
576 | + end | |
577 | + if -2147483648 > value or value > 2147483647 then | |
578 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], too big, value : %s", logType, field, value)) | |
579 | + value = nil | |
580 | + end | |
581 | + end | |
582 | + return value | |
583 | + end, | |
584 | + short = function() | |
585 | + if type(value) ~= "number" then | |
586 | + value = tonumber(value) | |
587 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], value : %s", logType, field, value)) | |
588 | + end | |
589 | + if value then | |
590 | + if math.type(value) ~= "integer" then | |
591 | + local oldValue = value | |
592 | + value = math.floor(value) | |
593 | + if value ~= oldValue then | |
594 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], is float, value : %s", logType, field, value)) | |
595 | + end | |
596 | + end | |
597 | + | |
598 | + if -32768 > value or value > 32768 then | |
599 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], too big, value : %s", logType, field, value)) | |
600 | + value = nil | |
601 | + end | |
602 | + end | |
603 | + return value | |
604 | + end, | |
605 | + long = function() | |
606 | + if type(value) ~= "number" then | |
607 | + value = tonumber(value) | |
608 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], value : %s", logType, field, value)) | |
609 | + end | |
610 | + if value then | |
611 | + if math.type(value) ~= "integer" then | |
612 | + local oldValue = value | |
613 | + value = math.floor(value) | |
614 | + if type(value) ~= "integer" then | |
615 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], too big, value : %s", logType, field, value)) | |
616 | + value = nil | |
617 | + elseif value ~= oldValue then | |
618 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], is float, value : %s", logType, field, value)) | |
619 | + end | |
620 | + end | |
621 | + end | |
622 | + return value | |
623 | + end, | |
624 | + float = function() | |
625 | + if type(value) ~= "number" then | |
626 | + value = tonumber(value) | |
627 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [float], value : %s", logType, field, value)) | |
628 | + end | |
629 | + return value | |
630 | + end, | |
631 | + } | |
632 | + | |
633 | + if typecheckfunc[ctype] then | |
634 | + return typecheckfunc[ctype]() | |
635 | + else | |
636 | + printError(string.format("LOG ERROR: logType [%s] field [%s] have a new type [%s] need add check.", logType, field, ctype)) | |
637 | + return nil | |
638 | + end | |
639 | +end | |
640 | + | |
641 | + | |
466 | 642 | |
467 | 643 | local RoleLog = {} |
468 | 644 | function RoleLog.bind(Role) |
... | ... | @@ -490,14 +666,15 @@ function RoleLog.bind(Role) |
490 | 666 | for field, tag in pairs(schema) do |
491 | 667 | if not contents[field] then |
492 | 668 | if tag == "ucode" then |
493 | - contents[field] = self:getActionUcode() | |
669 | + doc[field] = self:getActionUcode() | |
670 | + elseif tag == "auto" then | |
494 | 671 | else |
495 | 672 | printError(string.format("LOG ERROR: logType [%s] lose field [%s].", logType, field)) |
496 | 673 | end |
497 | 674 | end |
498 | 675 | end |
499 | 676 | if not logd then return end |
500 | - pcall(skynet.send, logd, "lua", "log", doc) | |
677 | + pcall(skynet.send, logd, "lua", "log", doc, "bi") | |
501 | 678 | end |
502 | 679 | |
503 | 680 | function Role:logItems(itemId, before, after, log) |
... | ... | @@ -528,6 +705,38 @@ function RoleLog.bind(Role) |
528 | 705 | }) |
529 | 706 | end |
530 | 707 | |
708 | + function Role:mylog(logType, contents) | |
709 | + contents = contents or {} | |
710 | + local _logType = LogType[logType] | |
711 | + if not _logType then | |
712 | + printError(string.format("LOG ERROR: new logType [%s] need Add Maping.", logType)) | |
713 | + return | |
714 | + end | |
715 | + local doc = {} | |
716 | + for field, ctype in pairs(commonRoleField) do | |
717 | + if contents[field] then | |
718 | + printError(string.format("LOG ERROR: logType [%s] had field [%s] overwrite default.", logType, field)) | |
719 | + end | |
720 | + doc[field] = checkType("commonRoleField", field, self:getProperty(field), ctype) | |
721 | + end | |
722 | + | |
723 | + local mapping = Mapping[_logType] | |
724 | + if mapping["ucode"] and not contents["ucode"] then | |
725 | + contents["ucode"] = self:getActionUcode() | |
726 | + end | |
727 | + for field, value in pairs(contents) do | |
728 | + local ftype = mapping[field] | |
729 | + if ftype then | |
730 | + doc[field] = checkType(logType, field, value, ftype) | |
731 | + else | |
732 | + printError(string.format("LOG ERROR: logType [%s] have new field [%s] no type in mapping.", logType, field)) | |
733 | + end | |
734 | + end | |
735 | + doc["@type"] = logType | |
736 | + if not logd then return end | |
737 | + pcall(skynet.send, logd, "lua", "log", doc, "log") | |
738 | + end | |
739 | + | |
531 | 740 | |
532 | 741 | function Role:startActionUcode() |
533 | 742 | if not self._uniqueCount then |
... | ... | @@ -548,5 +757,6 @@ function RoleLog.bind(Role) |
548 | 757 | end |
549 | 758 | |
550 | 759 | |
760 | + | |
551 | 761 | end |
552 | 762 | return RoleLog |
553 | 763 | \ No newline at end of file | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -229,13 +229,28 @@ function RolePlugin.bind(Role) |
229 | 229 | self:log("setLevel", { |
230 | 230 | level_before = oldLevel, |
231 | 231 | level_changemain = log.desc, |
232 | - level_changedetail = log.sub or "", | |
232 | + level_changedetail = log.int1 or 0, | |
233 | 233 | level_reward = {}, |
234 | 234 | }) |
235 | 235 | else |
236 | 236 | print("addPlayExp no log ", debug.traceback()) |
237 | 237 | end |
238 | + end | |
239 | + | |
240 | + if params.log then | |
241 | + local log = params.log | |
242 | + if log["cint1"] or log["cint2"] then | |
243 | + print("addPlayExp error log have cint1 or cint2 or cint3", debug.traceback()) | |
244 | + end | |
238 | 245 | |
246 | + | |
247 | + log["cint1"] = addExp | |
248 | + log["cint2"] = newExp | |
249 | + log["cint3"] = level | |
250 | + | |
251 | + self:mylog("player_exp", log) | |
252 | + else | |
253 | + print("addPlayExp no log ", debug.traceback()) | |
239 | 254 | end |
240 | 255 | |
241 | 256 | self:updateProperties({level = level, exp = newExp}) |
... | ... | @@ -259,6 +274,21 @@ function RolePlugin.bind(Role) |
259 | 274 | end |
260 | 275 | |
261 | 276 | self:logItems(params.itemId, origin, nums, params.log) |
277 | + if params.log then | |
278 | + local log = params.log | |
279 | + if log["cint1"] or log["cint2"] then | |
280 | + print("addItem error log have cint1 or cint2 ", debug.traceback()) | |
281 | + end | |
282 | + log["cint1"] = params.itemId | |
283 | + log["cint2"] = math.abs(params.count) | |
284 | + if params.count <= 0 then | |
285 | + self:mylog("out_item", log) | |
286 | + else | |
287 | + self:mylog("in_item", log) | |
288 | + end | |
289 | + else | |
290 | + print("addItem no log ", debug.traceback()) | |
291 | + end | |
262 | 292 | |
263 | 293 | self:setProperty("items", items) |
264 | 294 | if not params.notNotify then |
... | ... | @@ -329,11 +359,22 @@ function RolePlugin.bind(Role) |
329 | 359 | end |
330 | 360 | |
331 | 361 | self:logItems(ItemId.Diamond, origin, count, params.log) |
362 | + if params.log then | |
363 | + local log = params.log | |
364 | + if log["cint1"] or log["cint2"] or log["cint3"] then | |
365 | + print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
366 | + end | |
367 | + log["cint1"] = origin | |
368 | + log["cint2"] = count | |
369 | + self:mylog("in_diamond", log) | |
370 | + else | |
371 | + print("gainDiamond no log ", debug.traceback()) | |
372 | + end | |
373 | + | |
332 | 374 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) |
333 | 375 | return true |
334 | 376 | end |
335 | 377 | |
336 | - | |
337 | 378 | function Role:costDiamond(params) |
338 | 379 | if not params or type(params) ~= "table" then return false end |
339 | 380 | local count = tonum(params.count) |
... | ... | @@ -368,6 +409,17 @@ function RolePlugin.bind(Role) |
368 | 409 | |
369 | 410 | |
370 | 411 | self:logItems(ItemId.Diamond, origin, count, params.log) |
412 | + if params.log then | |
413 | + local log = params.log | |
414 | + if log["cint1"] or log["cint2"] or log["cint3"] then | |
415 | + print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
416 | + end | |
417 | + log["cint1"] = origin | |
418 | + log["cint2"] = count | |
419 | + self:mylog("out_diamond", log) | |
420 | + else | |
421 | + print("costDiamond no log ", debug.traceback()) | |
422 | + end | |
371 | 423 | |
372 | 424 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) |
373 | 425 | return true |
... | ... | @@ -406,6 +458,17 @@ function RolePlugin.bind(Role) |
406 | 458 | |
407 | 459 | self:logItems(heroType + ItemStartId.Hero, 0, 1, params.log) |
408 | 460 | |
461 | + if params.log then | |
462 | + local log = params.log | |
463 | + if log["cint1"] or log["cint2"] or log["cint3"] then | |
464 | + print("addHero error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
465 | + end | |
466 | + log["cint1"] = heroId | |
467 | + log["cint2"] = heroType | |
468 | + self:mylog("in_hero", log) | |
469 | + else | |
470 | + print("addHero no log ", debug.traceback()) | |
471 | + end | |
409 | 472 | return true, newHero |
410 | 473 | end |
411 | 474 | |
... | ... | @@ -516,6 +579,22 @@ function RolePlugin.bind(Role) |
516 | 579 | self:setProperty("equips", equips) |
517 | 580 | |
518 | 581 | self:logItems(equipCsv.id, oldCount, curCount, pms.log) |
582 | + if pms.log then | |
583 | + local log = pms.log | |
584 | + if log["cint1"] or log["cint2"] or log["cint3"] then | |
585 | + print("addEquip error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
586 | + end | |
587 | + log["cint1"] = equipType | |
588 | + log["cint2"] = equipLv | |
589 | + log["cint3"] = math.abs(count) | |
590 | + if count < 0 then | |
591 | + self:mylog("out_equip", log) | |
592 | + else | |
593 | + self:mylog("in_equip", log) | |
594 | + end | |
595 | + else | |
596 | + print("addEquip no log ", debug.traceback()) | |
597 | + end | |
519 | 598 | |
520 | 599 | if not pms.notNotify then |
521 | 600 | self:changeUpdates({{type = "equips", field = {equipType, equipLv}, value = curCount, isOnlyToC = true}}) -- 通知客户端 |
... | ... | @@ -576,6 +655,20 @@ function RolePlugin.bind(Role) |
576 | 655 | self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) |
577 | 656 | |
578 | 657 | self:logItems(params.id, 0, 1, params.log) |
658 | + if params.log then | |
659 | + local log = params.log | |
660 | + if log["cint1"] or log["cint2"] or log["cint3"] then | |
661 | + print("addRune error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
662 | + end | |
663 | + | |
664 | + log["cint1"] = runeUid | |
665 | + log["cint2"] = params.type | |
666 | + log["cint3"] = params.id | |
667 | + | |
668 | + self:mylog("in_rune", log) | |
669 | + else | |
670 | + print("addRune no log ", debug.traceback()) | |
671 | + end | |
579 | 672 | |
580 | 673 | return 0, newRune |
581 | 674 | else |
... | ... | @@ -592,6 +685,20 @@ function RolePlugin.bind(Role) |
592 | 685 | if rune and rune:getProperty("refer") == 0 then |
593 | 686 | |
594 | 687 | self:logItems(rune:getProperty("id"), 1, 0, params.log) |
688 | + if params.log then | |
689 | + local log = params.log | |
690 | + if log["cint1"] or log["cint2"] or log["cint3"] then | |
691 | + print("delRunes error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
692 | + end | |
693 | + | |
694 | + log["cint1"] = runeId | |
695 | + log["cint2"] = rune:getProperty("type") | |
696 | + log["cint3"] = rune:getProperty("id") | |
697 | + | |
698 | + self:mylog("out_rune", log) | |
699 | + else | |
700 | + print("delRunes no log ", debug.traceback()) | |
701 | + end | |
595 | 702 | |
596 | 703 | self.runeBag[runeId] = nil |
597 | 704 | table.insert(bDel, runeId) |
... | ... | @@ -838,6 +945,19 @@ function RolePlugin.bind(Role) |
838 | 945 | count = count or 1 |
839 | 946 | |
840 | 947 | self:logItems(func, 0, count, params.log) |
948 | + if params.log then | |
949 | + local log = params.log | |
950 | + if log["cint1"] or log["cint2"] or log["cint3"] then | |
951 | + print("funcOpen error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
952 | + end | |
953 | + | |
954 | + log["cint1"] = func | |
955 | + log["cint2"] = count | |
956 | + | |
957 | + self:mylog("func_open", log) | |
958 | + else | |
959 | + print("funcOpen no log ", debug.traceback()) | |
960 | + end | |
841 | 961 | |
842 | 962 | if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then |
843 | 963 | local unlockData = csvdb["unlockCsv"][func] |
... | ... | @@ -1393,7 +1513,10 @@ function RolePlugin.bind(Role) |
1393 | 1513 | |
1394 | 1514 | local order_type = self:getProperty("rmbC") > 0 and 0 or 1 |
1395 | 1515 | local status, reward = self:recharge({ |
1396 | - id = rechargeId | |
1516 | + id = rechargeId, | |
1517 | + transactionId = params.transactionId, | |
1518 | + pay_time = params.pay_time, | |
1519 | + order = partnerOrderStr, | |
1397 | 1520 | }) |
1398 | 1521 | orderObject:setProperty("finishTime", skynet.time()) |
1399 | 1522 | orderObject:setProperty("status", "finish") |
... | ... | @@ -1451,12 +1574,9 @@ function RolePlugin.bind(Role) |
1451 | 1574 | self:gainDiamond({count = diamondCount, isRecharge = true, log = {desc = "recharge", int1 = id}}) |
1452 | 1575 | elseif rechargeData.shop == 2 then --通行证商店 |
1453 | 1576 | reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) |
1454 | - self.storeData:onBuyCard(rechargeData.type, rechargeData.time) | |
1577 | + self.storeData:onBuyCard(rechargeData.type, rechargeData.time, rechargeData.id) | |
1455 | 1578 | elseif rechargeData.shop == 3 then -- 礼包商店 |
1456 | 1579 | reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) |
1457 | - elseif rechargeData.shop == 4 then -- 付费签到 | |
1458 | - reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) | |
1459 | - self.storeData:onBuyPaySignCard(rechargeData.time) | |
1460 | 1580 | else |
1461 | 1581 | skynet.error("invalid recharge shop type " .. id) |
1462 | 1582 | return 3 |
... | ... | @@ -1469,6 +1589,8 @@ function RolePlugin.bind(Role) |
1469 | 1589 | -- 累充 |
1470 | 1590 | local rmb = rechargeData.rmb |
1471 | 1591 | self:updateProperty({field = "rmbC", delta = rmb}) |
1592 | + | |
1593 | + self:mylog("role_action", {desc = "recharge", int1 = id, int2 = rmb, key1 = params.transactionId, key2 = params.order, long1 = params.pay_time}) | |
1472 | 1594 | |
1473 | 1595 | return nil, reward |
1474 | 1596 | end |
... | ... | @@ -1516,6 +1638,7 @@ function RolePlugin.bind(Role) |
1516 | 1638 | end |
1517 | 1639 | self:updateProperty({field = "funcGuide", value = funcGuide}) |
1518 | 1640 | self:log("onGuidePoint", {guild_type = 0, guild_id = master, guild_point = slave, guild_pass = 0}) |
1641 | + self:mylog("guide", {desc = "guide_new",int1 = master*1000+slave}) | |
1519 | 1642 | |
1520 | 1643 | newerGuide = string.format("%d=%d",master,slave) |
1521 | 1644 | self:updateProperty({field = "newerGuide", value = newerGuide}) |
... | ... | @@ -1535,6 +1658,43 @@ function RolePlugin.bind(Role) |
1535 | 1658 | self:updateProperty({field = "newerGuide", value = "9999=1"}) |
1536 | 1659 | end |
1537 | 1660 | end |
1661 | + | |
1662 | + -- 抽卡阶段奖励 | |
1663 | + function Role:getDrawCardExtraReward(oldVal, newVal) | |
1664 | + local reward = nil | |
1665 | + local maxCount = 0 | |
1666 | + for k, v in pairs(csvdb["build_extraRewardCsv"]) do | |
1667 | + if oldVal < k and newVal >= k then | |
1668 | + reward = v["reward"] or "" | |
1669 | + end | |
1670 | + maxCount = k > maxCount and k or maxCount | |
1671 | + end | |
1672 | + | |
1673 | + return reward, (newVal >= maxCount and newVal - maxCount or newVal) | |
1674 | + end | |
1675 | + | |
1676 | + -- 获取下一个挂机关卡id | |
1677 | + function Role:getNextCarbonId(curId) | |
1678 | + local diff = math.floor(curId / 10000) | |
1679 | + local chapterId = math.floor((curId / 100) % 100) | |
1680 | + local subId = curId % 100 | |
1681 | + local nextId = curId + 1 | |
1682 | + local function makeCarbonId(diff, chapterId, subId) | |
1683 | + return diff * 10000 + chapterId * 100 + subId | |
1684 | + end | |
1685 | + if not csvdb["idle_battleCsv"][nextId] then | |
1686 | + nextId = makeCarbonId(diff, chapterId + 1, 1) | |
1687 | + if not csvdb["idle_battleCsv"][nextId] then | |
1688 | + nextId = makeCarbonId(diff + 1, 1, 1) | |
1689 | + if not csvdb["idle_battleCsv"][nextId] then | |
1690 | + nextId = 0 | |
1691 | + end | |
1692 | + end | |
1693 | + end | |
1694 | + | |
1695 | + return nextId | |
1696 | + end | |
1697 | + | |
1538 | 1698 | end |
1539 | 1699 | |
1540 | 1700 | return RolePlugin |
1541 | 1701 | \ No newline at end of file | ... | ... |
src/models/RoleTimeReset.lua
... | ... | @@ -34,7 +34,6 @@ end |
34 | 34 | ResetFunc["CrossMonth"] = function(self, notify, response) |
35 | 35 | local ltime = self:getProperty("ltime") |
36 | 36 | if isCrossMonth(ltime, skynet.timex()) then |
37 | - print("cross month") | |
38 | 37 | self.storeData:resetStoreReored(3) --商店跨月重置 time_reset表关联id |
39 | 38 | end |
40 | 39 | end | ... | ... |
src/models/Rune.lua
... | ... | @@ -26,16 +26,16 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) |
26 | 26 | self:notifyUpdateProperties(datas) |
27 | 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") | |
29 | +function Rune:mylog(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 | 37 | |
38 | - -- self.owner:log("rune_action", contents) | |
38 | + self.owner:mylog("rune_action", contents) | |
39 | 39 | end |
40 | 40 | |
41 | 41 | function Rune:notifyUpdateProperties(params) | ... | ... |
src/models/Store.lua
... | ... | @@ -163,7 +163,7 @@ function Store:getGearExchangeCoef() |
163 | 163 | end |
164 | 164 | |
165 | 165 | -- 购买通行证 |
166 | -function Store:onBuyCard(type, duration) | |
166 | +function Store:onBuyCard(type, duration, id) | |
167 | 167 | local timeNow = skynet.timex() |
168 | 168 | if type == CardType.NormalMonthCard then |
169 | 169 | if self:isMonthCardExpire() then |
... | ... | @@ -189,9 +189,10 @@ function Store:onBuyCard(type, duration) |
189 | 189 | self:updateProperty({field = "growFund", value = 1}) |
190 | 190 | elseif type == CardType.BattleCard then |
191 | 191 | self:updateProperty({field = "battleCard", value = 1}) |
192 | - elseif type == CardType.BattlePassCard_1 or type == CardType.BattlePassCard_2 or | |
193 | - type == CardType.BattlePassCard_3 or type == CardType.BattlePassCard_4 then | |
194 | - local index = type - CardType.BattlePassCard_1 + 1 | |
192 | + elseif type == CardType.PaySignCard then | |
193 | + self:onBuyPaySignCard(duration) | |
194 | + elseif type == CardType.BattlePassCard then | |
195 | + local index = id - 400 -- 401:初级 402:中级 403:高级 404:终极 | |
195 | 196 | local bpInfo = self:getProperty("bpInfo") or {} |
196 | 197 | local info = bpInfo[index] or {} |
197 | 198 | info["flag"] = 1 |
... | ... | @@ -365,6 +366,7 @@ function Store:onBuyPaySignCard(dur) |
365 | 366 | return |
366 | 367 | end |
367 | 368 | actGoodsFlag[goodsIndex] = 1 |
369 | + self:updateProperty({field = "actGoodsFlag", value = actGoodsFlag}) | |
368 | 370 | -- 发钱 |
369 | 371 | local change |
370 | 372 | local reward, curData = self.owner.activity:getPaySignReward() |
... | ... | @@ -375,13 +377,11 @@ function Store:onBuyPaySignCard(dur) |
375 | 377 | |
376 | 378 | self.owner:log("activity", { |
377 | 379 | activity_id = 0, -- 活动ID(或活动指定任务的ID) |
378 | - activity_type = self.onwer.activity.ActivityType.PaySignIn, -- 活动类型,见活动类型枚举表 | |
380 | + activity_type = self.owner.activity.ActivityType.PaySignIn, -- 活动类型,见活动类型枚举表 | |
379 | 381 | activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} |
380 | 382 | }) |
381 | 383 | |
382 | 384 | SendPacket(actionCodes.Activity_actPaySignRewardNtf, MsgPack.pack(self.owner:packReward(reward, change))) |
383 | - | |
384 | - self.owner:updateProperty({field = "actGoodsFlag", value = actGoodsFlag}) | |
385 | 385 | end |
386 | 386 | |
387 | 387 | function Store:checkPaySignReward() | ... | ... |
src/services/agent_ctrl.lua
... | ... | @@ -128,7 +128,7 @@ function _M:check_agent_status() |
128 | 128 | next_log_time = now + 60 |
129 | 129 | local count = table_nums(self.u2f) |
130 | 130 | datacenter.set("onlineCount", count) |
131 | - -- pcall(skynet.send, logd, "lua", "log", "online", {count = count}, "online") | |
131 | + pcall(skynet.send, logd, "lua", "log", {["@type"] = "online", count = count}, "log") | |
132 | 132 | end |
133 | 133 | end |
134 | 134 | ... | ... |
src/services/logd.lua
... | ... | @@ -13,8 +13,37 @@ local pairs = pairs |
13 | 13 | local ipairs = ipairs |
14 | 14 | local string_format = string.format |
15 | 15 | |
16 | +local logId = 0 | |
16 | 17 | local CMD, cs = {} |
17 | -local log_fd, connecting = nil , false | |
18 | + | |
19 | +local logHandle = { | |
20 | + bi = { | |
21 | + host = "127.0.0.1", | |
22 | + port = 13001, | |
23 | + }, | |
24 | + log = { | |
25 | + host = "127.0.0.1", | |
26 | + port = 13002, | |
27 | + handle = function(doc) | |
28 | + -- 注入字段 | |
29 | + local now = skynet.timex() | |
30 | + doc["time"] = now | |
31 | + doc["timestamp"] = now | |
32 | + doc["server"] = serverId | |
33 | + doc["game_name"] = "wasteland" | |
34 | + doc["env"] = "cb" | |
35 | + doc["game_name_type"] = "guaji" | |
36 | + doc["log_id"] = "wastelandC" .. logId .. "S" .. serverId .. "T" .. now | |
37 | + logId = (logId + 1) % 10000000 | |
38 | + end | |
39 | + }, | |
40 | +} | |
41 | + | |
42 | +local connect_relation = {} | |
43 | +local function getConInfo(fd) | |
44 | + return logHandle[connect_relation[fd] or ""] | |
45 | +end | |
46 | + | |
18 | 47 | |
19 | 48 | |
20 | 49 | local socket_message = {} |
... | ... | @@ -27,20 +56,30 @@ end |
27 | 56 | |
28 | 57 | -- SKYNET_SOCKET_TYPE_CONNECT = 2 |
29 | 58 | socket_message[2] = function(id, _ , addr) |
59 | + local cur = getConInfo(id) | |
30 | 60 | skynet.error("LOG SOCKET: connect: ", addr) |
31 | - connecting = false | |
61 | + cur.connected = true | |
62 | + cur.connecting = false | |
32 | 63 | end |
33 | 64 | |
34 | 65 | -- SKYNET_SOCKET_TYPE_CLOSE = 3 |
35 | 66 | socket_message[3] = function(id) |
36 | 67 | skynet.error("LOG SOCKET: closed") |
37 | - connecting = false | |
68 | + local cur = getConInfo(id) | |
69 | + if not cur then return end | |
70 | + cur.connected = false | |
71 | + cur.connecting = false | |
72 | + connect_relation[id] = nil | |
38 | 73 | end |
39 | 74 | |
40 | 75 | -- SKYNET_SOCKET_TYPE_ERROR = 5 |
41 | 76 | socket_message[5] = function(id, _, err) |
42 | 77 | skynet.error("LOG SOCKET: error: ", err) |
43 | - connecting = false | |
78 | + local cur = getConInfo(id) | |
79 | + if not cur then return end | |
80 | + cur.connected = false | |
81 | + cur.connecting = false | |
82 | + connect_relation[id] = nil | |
44 | 83 | end |
45 | 84 | |
46 | 85 | |
... | ... | @@ -55,18 +94,33 @@ skynet.register_protocol { |
55 | 94 | end |
56 | 95 | } |
57 | 96 | |
58 | -function CMD.log(doc) | |
59 | - if not socketdriver.send(log_fd, json.encode(doc) .. "\n") then | |
60 | - if not connecting then | |
61 | - CMD.open() -- 连一下试试 | |
62 | - socketdriver.send(log_fd, json.encode(doc) .. "\n") | |
97 | +function CMD.log(doc, logTo) | |
98 | + logTo = logTo or "log" | |
99 | + local cur = logHandle[logTo] | |
100 | + if not cur then | |
101 | + print("error log to ", logTo) | |
102 | + end | |
103 | + if cur.handle then | |
104 | + cur.handle(doc) | |
105 | + end | |
106 | + if cur.connected and cur.fd then | |
107 | + socketdriver.send(cur.fd, json.encode(doc) .. "\n") | |
108 | + else | |
109 | + -- 断线会丢失一部分日志 | |
110 | + if not cur.connecting then | |
111 | + CMD.open() -- 连一下 | |
63 | 112 | end |
64 | 113 | end |
65 | 114 | end |
66 | 115 | |
67 | 116 | function CMD.open() |
68 | - log_fd = socketdriver.connect("127.0.0.1", 13001) | |
69 | - connecting = true | |
117 | + for logTo, data in pairs(logHandle) do | |
118 | + if not data.connecting and not data.connected then | |
119 | + data.connecting = true | |
120 | + data.fd = socketdriver.connect(data.host, data.port) | |
121 | + connect_relation[data.fd] = logTo | |
122 | + end | |
123 | + end | |
70 | 124 | end |
71 | 125 | |
72 | 126 | local function __init__() |
... | ... | @@ -75,8 +129,8 @@ local function __init__() |
75 | 129 | if command == "open" then |
76 | 130 | skynet.ret(skynet.pack(f(...))) |
77 | 131 | else |
78 | - local logType, doc, index_suffix = ... | |
79 | - cs(function() f(logType, doc, index_suffix) end) | |
132 | + local doc, logTo = ... | |
133 | + cs(function() f(doc, logTo) end) | |
80 | 134 | end |
81 | 135 | end) |
82 | 136 | cs = queue() | ... | ... |