Commit 5f3dd3f8927627d4a2adcbf852a07f21ba67c921
Merge branch 'bugfix' into player
* bugfix: (53 commits) 成就 参数错误 3星解锁 cg 增加神器标签 初始化冒险重置时间 被动新 扣层数 被动 取消 引导用到的剧情的奖励可以直接领 调整顺序 签到成就 充值返利邮件内容优化 奖励关卡活动未开启导致Bug 每周循环任务bug 运营需要 屏蔽字 优化 优化 充值返利邮件档位排序 伤害错误 反的判断 返利邮件拼接充值档位 ...
Showing
43 changed files
with
1425 additions
and
280 deletions
Show diff stats
robot/robot.lua
@@ -34,6 +34,9 @@ local ignoreListener = { | @@ -34,6 +34,9 @@ local ignoreListener = { | ||
34 | ["Role.changeUpdate"] = true, | 34 | ["Role.changeUpdate"] = true, |
35 | ["Role.loadRunes"] = true, | 35 | ["Role.loadRunes"] = true, |
36 | ["Hero.loadInfos"] = true, | 36 | ["Hero.loadInfos"] = true, |
37 | + ["Store.updateproperty"] = true, | ||
38 | + ["Sys.maintainNotice"] = true, | ||
39 | + ["Hero.drawHeroExtraRewardNtf"] = true, | ||
37 | ["Sys.innerErrorMsg"] = function(data) | 40 | ["Sys.innerErrorMsg"] = function(data) |
38 | local msg = MsgPack.unpack(data) | 41 | local msg = MsgPack.unpack(data) |
39 | log("innerErrorMsg: " .. msg.id) | 42 | log("innerErrorMsg: " .. msg.id) |
@@ -123,11 +126,6 @@ local function startUnit(unit) | @@ -123,11 +126,6 @@ local function startUnit(unit) | ||
123 | unitTest.new(client):startTest() | 126 | unitTest.new(client):startTest() |
124 | end | 127 | end |
125 | 128 | ||
126 | -local function handle_timeout10000() | ||
127 | - rpcServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 1, pm2 = 500})) | ||
128 | - rpcServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 2, pm2 = 500})) | ||
129 | - skynet.timeout(10000, handle_timeout6000) | ||
130 | -end | ||
131 | 129 | ||
132 | -- 登录成功开始任务 | 130 | -- 登录成功开始任务 |
133 | function CMD.task() | 131 | function CMD.task() |
@@ -155,6 +153,9 @@ end | @@ -155,6 +153,9 @@ end | ||
155 | 153 | ||
156 | -- 退出 | 154 | -- 退出 |
157 | function CMD.exit() | 155 | function CMD.exit() |
156 | + sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "gmmsg", pm1 = "123"})) | ||
157 | + skynet.sleep(50) | ||
158 | + skynet.ret(skynet.pack()) | ||
158 | skynet.exit() | 159 | skynet.exit() |
159 | end | 160 | end |
160 | 161 |
robot/start.lua
@@ -19,9 +19,9 @@ function MSG.open( ... ) | @@ -19,9 +19,9 @@ function MSG.open( ... ) | ||
19 | end | 19 | end |
20 | 20 | ||
21 | function MSG.close(fd) | 21 | function MSG.close(fd) |
22 | - if fd2serv[fd] then | ||
23 | - skynet.send(fd2serv[fd].agent, "lua", "exit") | ||
24 | - | 22 | + if fd2serv[fd] and not fd2serv[fd].closing then |
23 | + fd2serv[fd].closing = true | ||
24 | + skynet.call(fd2serv[fd].agent, "lua", "exit") | ||
25 | log(string_format("logout %s", fd2serv[fd].id)) | 25 | log(string_format("logout %s", fd2serv[fd].id)) |
26 | 26 | ||
27 | id2fd[fd2serv[fd].id] = nil | 27 | id2fd[fd2serv[fd].id] = nil |
@@ -94,8 +94,8 @@ local function add_robot() | @@ -94,8 +94,8 @@ local function add_robot() | ||
94 | 94 | ||
95 | -- 定时下线 | 95 | -- 定时下线 |
96 | skynet.timeout(math.randomInt(config.online_time[1], config.online_time[2]) * 100, function() | 96 | skynet.timeout(math.randomInt(config.online_time[1], config.online_time[2]) * 100, function() |
97 | - socketdriver.close(fd) | ||
98 | MSG.close(fd) | 97 | MSG.close(fd) |
98 | + socketdriver.close(fd) | ||
99 | end) | 99 | end) |
100 | end | 100 | end |
101 | 101 |
robot/unitTest/hero.lua
@@ -26,7 +26,7 @@ end | @@ -26,7 +26,7 @@ end | ||
26 | 26 | ||
27 | function _M:drawHero() | 27 | function _M:drawHero() |
28 | sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 3, pm2 = 400})) | 28 | sendServer(actionCodes.Gm_clientRequest, MsgPack.pack({cmd = "get", pm1 = 3, pm2 = 400})) |
29 | - requestServer(actionCodes.Hero_drawHeroRpc, MsgPack.pack({pool = 1, type = 1})) | 29 | + requestServer(actionCodes.Hero_drawHeroRpc, MsgPack.pack({pool = 2, type = 1})) |
30 | end | 30 | end |
31 | 31 | ||
32 | function _M:drawHero10() | 32 | function _M:drawHero10() |
src/GlobalVar.lua
@@ -68,6 +68,7 @@ ItemType = { | @@ -68,6 +68,7 @@ ItemType = { | ||
68 | AdvItem = 14, -- 冒险道具 | 68 | AdvItem = 14, -- 冒险道具 |
69 | FuncOpen = 15, -- 管理功能开放 | 69 | FuncOpen = 15, -- 管理功能开放 |
70 | SpeedBox = 16, -- 加速箱子 | 70 | SpeedBox = 16, -- 加速箱子 |
71 | + SelectItemBox = 17, -- 自选箱子 | ||
71 | } | 72 | } |
72 | 73 | ||
73 | --在这个里面的会记录的是功能开放 对应类型open 而不是 ID | 74 | --在这个里面的会记录的是功能开放 对应类型open 而不是 ID |
@@ -274,10 +275,8 @@ CardType = { | @@ -274,10 +275,8 @@ CardType = { | ||
274 | PrivilegeCard = 3, --特权卡 | 275 | PrivilegeCard = 3, --特权卡 |
275 | GrowFund = 4, --成长助力 | 276 | GrowFund = 4, --成长助力 |
276 | BattleCard = 5, --赛季卡 | 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 | HeroQuality = { | 282 | HeroQuality = { |
@@ -294,8 +293,6 @@ MailId = { | @@ -294,8 +293,6 @@ MailId = { | ||
294 | SuperMonthCardEx = 204, | 293 | SuperMonthCardEx = 204, |
295 | BattleCardAward = 210, | 294 | BattleCardAward = 210, |
296 | 295 | ||
297 | - PaySignAward = 222, | ||
298 | - | ||
299 | ActSellFood = 231, | 296 | ActSellFood = 231, |
300 | ActDrawCard = 232, | 297 | ActDrawCard = 232, |
301 | ActAdvDraw = 233, | 298 | ActAdvDraw = 233, |
@@ -304,6 +301,9 @@ MailId = { | @@ -304,6 +301,9 @@ MailId = { | ||
304 | ActDrawCardReward = 222, | 301 | ActDrawCardReward = 222, |
305 | ActAdvDrawReward = 223, | 302 | ActAdvDrawReward = 223, |
306 | ActOpenBoxReward = 224, | 303 | ActOpenBoxReward = 224, |
304 | + | ||
305 | + PaySignAward = 241, | ||
306 | + PayBackAward = 242, | ||
307 | } | 307 | } |
308 | 308 | ||
309 | TriggerEventType = { | 309 | TriggerEventType = { |
src/ProtocolCode.lua
@@ -46,6 +46,7 @@ actionCodes = { | @@ -46,6 +46,7 @@ actionCodes = { | ||
46 | Role_goldBuyRpc = 131, | 46 | Role_goldBuyRpc = 131, |
47 | Role_getDownloadCvRewardRpc = 132, | 47 | Role_getDownloadCvRewardRpc = 132, |
48 | Role_updateFeedbackInfoRpc = 133, | 48 | Role_updateFeedbackInfoRpc = 133, |
49 | + Role_useSelectItemRpc = 134, -- 使用多选一礼包 | ||
49 | 50 | ||
50 | Adv_startAdvRpc = 151, | 51 | Adv_startAdvRpc = 151, |
51 | Adv_startHangRpc = 152, | 52 | Adv_startHangRpc = 152, |
@@ -92,6 +93,7 @@ actionCodes = { | @@ -92,6 +93,7 @@ actionCodes = { | ||
92 | Hero_repayHeroRpc = 221, | 93 | Hero_repayHeroRpc = 221, |
93 | Hero_unlockPoolRpc = 222, | 94 | Hero_unlockPoolRpc = 222, |
94 | Hero_changeCrown = 223, | 95 | Hero_changeCrown = 223, |
96 | + Hero_drawHeroExtraRewardNtf = 224, | ||
95 | 97 | ||
96 | Hang_startRpc = 251, | 98 | Hang_startRpc = 251, |
97 | Hang_checkRpc = 252, | 99 | Hang_checkRpc = 252, |
src/actions/ActivityAction.lua
@@ -70,6 +70,7 @@ function _M.sudokuRpc(agent, data) | @@ -70,6 +70,7 @@ function _M.sudokuRpc(agent, data) | ||
70 | activity_type = 0, -- 活动类型,见活动类型枚举表 | 70 | activity_type = 0, -- 活动类型,见活动类型枚举表 |
71 | activity_reward = reward or {}, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} | 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 | SendPacket(actionCodes.Activity_sudokuRpc, MsgPack.pack({task = role:packReward(task, tchange), reward = role:packReward(reward, rchange), rId = rId})) | 75 | SendPacket(actionCodes.Activity_sudokuRpc, MsgPack.pack({task = role:packReward(task, tchange), reward = role:packReward(reward, rchange), rId = rId})) |
75 | return true | 76 | return true |
@@ -137,6 +138,7 @@ function _M.signRpc(agent, data) | @@ -137,6 +138,7 @@ function _M.signRpc(agent, data) | ||
137 | 138 | ||
138 | local reward, change = role:award(monthData[curDay].item, {log = {desc = "sign", int1 = yearMonth, int2 = curDay}}) | 139 | local reward, change = role:award(monthData[curDay].item, {log = {desc = "sign", int1 = yearMonth, int2 = curDay}}) |
139 | role:changeUpdates({{type = "sign", field = curDay, value = yearMonth}}) | 140 | role:changeUpdates({{type = "sign", field = curDay, value = yearMonth}}) |
141 | + role:checkTaskEnter("SignIn") | ||
140 | 142 | ||
141 | SendPacket(actionCodes.Activity_signRpc, MsgPack.pack(role:packReward(reward, change))) | 143 | SendPacket(actionCodes.Activity_signRpc, MsgPack.pack(role:packReward(reward, change))) |
142 | return true | 144 | return true |
src/actions/AdvAction.lua
@@ -174,6 +174,7 @@ function _M.startAdvRpc( agent, data ) | @@ -174,6 +174,7 @@ function _M.startAdvRpc( agent, data ) | ||
174 | role:checkTaskEnter("AdvStart", {id = chapterId}) | 174 | role:checkTaskEnter("AdvStart", {id = chapterId}) |
175 | role:checkTaskEnter("AdvStartSelf", {id = chapterId}) | 175 | role:checkTaskEnter("AdvStartSelf", {id = chapterId}) |
176 | role:getAdvData():popBackEvents() -- 清一下事件 | 176 | role:getAdvData():popBackEvents() -- 清一下事件 |
177 | + role:getAdvData():mylog({desc = "start", int1 = supportIdx}) | ||
177 | 178 | ||
178 | SendPacket(actionCodes.Adv_startAdvRpc, '') | 179 | SendPacket(actionCodes.Adv_startAdvRpc, '') |
179 | return true | 180 | return true |
@@ -254,6 +255,7 @@ function _M.startHangRpc(agent, data) | @@ -254,6 +255,7 @@ function _M.startHangRpc(agent, data) | ||
254 | 255 | ||
255 | role:changeAdvCount(adv_idle_energy) | 256 | role:changeAdvCount(adv_idle_energy) |
256 | role:checkTaskEnter("AdvStart", {id = chapterId}) | 257 | role:checkTaskEnter("AdvStart", {id = chapterId}) |
258 | + role:mylog("adv_action", {desc = "startHang", int1 = chapterId}) | ||
257 | 259 | ||
258 | SendPacket(actionCodes.Adv_startHangRpc, '') | 260 | SendPacket(actionCodes.Adv_startHangRpc, '') |
259 | return true | 261 | return true |
@@ -293,6 +295,8 @@ function _M.quickHangRpc(agent, data) | @@ -293,6 +295,8 @@ function _M.quickHangRpc(agent, data) | ||
293 | info.time = 0 | 295 | info.time = 0 |
294 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) | 296 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) |
295 | 297 | ||
298 | + role:mylog("adv_action", {desc = "advQuickHang", int1 = chapterId}) | ||
299 | + | ||
296 | SendPacket(actionCodes.Adv_quickHangRpc, '') | 300 | SendPacket(actionCodes.Adv_quickHangRpc, '') |
297 | return true | 301 | return true |
298 | end | 302 | end |
@@ -374,6 +378,8 @@ function _M.endHangRpc(agent, data) | @@ -374,6 +378,8 @@ function _M.endHangRpc(agent, data) | ||
374 | 378 | ||
375 | role:changeUpdates({{type = "advHang", field = chapterId, value = nil}}) | 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 | SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, change = change, isFull = isFull})) | 383 | SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, change = change, isFull = isFull})) |
378 | return true | 384 | return true |
379 | end | 385 | end |
@@ -403,6 +409,7 @@ function _M.buyAdvCountRpc(agent , data) | @@ -403,6 +409,7 @@ function _M.buyAdvCountRpc(agent , data) | ||
403 | role:changeAdvCount(-count * globalCsv.adv_daily_buy_num) | 409 | role:changeAdvCount(-count * globalCsv.adv_daily_buy_num) |
404 | role.dailyData:updateProperty({field = "advBC", delta = count}) | 410 | role.dailyData:updateProperty({field = "advBC", delta = count}) |
405 | end | 411 | end |
412 | + role:mylog("adv_action", {desc = "buyAdvCount", short1 = isEl and 1 or 0, int1 = count}) | ||
406 | 413 | ||
407 | SendPacket(actionCodes.Adv_buyAdvCountRpc, '') | 414 | SendPacket(actionCodes.Adv_buyAdvCountRpc, '') |
408 | return true | 415 | return true |
@@ -427,6 +434,8 @@ function _M.finishTaskRpc(agent, data) | @@ -427,6 +434,8 @@ function _M.finishTaskRpc(agent, data) | ||
427 | if not status then return end | 434 | if not status then return end |
428 | role:checkTaskEnter("AdvOverTask", {id = taskId}) | 435 | role:checkTaskEnter("AdvOverTask", {id = taskId}) |
429 | 436 | ||
437 | + adv:mylog({desc = "finishTask", int1 = taskId}) | ||
438 | + | ||
430 | SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack(role:packReward(reward, change))) | 439 | SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack(role:packReward(reward, change))) |
431 | return true | 440 | return true |
432 | end | 441 | end |
@@ -448,6 +457,8 @@ function _M.clickBlockRpc(agent, data) | @@ -448,6 +457,8 @@ function _M.clickBlockRpc(agent, data) | ||
448 | 457 | ||
449 | if adv:isWaitChooseArtifact() then return returnFail() end | 458 | if adv:isWaitChooseArtifact() then return returnFail() end |
450 | 459 | ||
460 | + adv:mylog({desc = "clickBlock", int1 = msg.roomId, int2 = msg.blockId}) | ||
461 | + | ||
451 | local status, errorCode = adv:clickBlock(msg.roomId, msg.blockId, msg) | 462 | local status, errorCode = adv:clickBlock(msg.roomId, msg.blockId, msg) |
452 | if not status then return returnFail(errorCode) end | 463 | if not status then return returnFail(errorCode) end |
453 | 464 | ||
@@ -483,8 +494,8 @@ function _M.useItemRpc(agent, data) | @@ -483,8 +494,8 @@ function _M.useItemRpc(agent, data) | ||
483 | if itemId == 5020 then | 494 | if itemId == 5020 then |
484 | role:finishGuide(53) | 495 | role:finishGuide(53) |
485 | end | 496 | end |
486 | - | ||
487 | adv:checkAchievement(adv.AchievType.UseItem, count, itemId) | 497 | adv:checkAchievement(adv.AchievType.UseItem, count, itemId) |
498 | + adv:mylog({desc = "useItem", int1 = itemId, int2 = count}) | ||
488 | 499 | ||
489 | for i = 1, count do | 500 | for i = 1, count do |
490 | adv:doActive(itemData.effect, target) -- target | 501 | adv:doActive(itemData.effect, target) -- target |
@@ -520,6 +531,7 @@ function _M.usePotionRpc(agent, data) | @@ -520,6 +531,7 @@ function _M.usePotionRpc(agent, data) | ||
520 | local adv = role:getAdvData() | 531 | local adv = role:getAdvData() |
521 | if adv:isWaitChooseArtifact() then return end | 532 | if adv:isWaitChooseArtifact() then return end |
522 | 533 | ||
534 | + adv:mylog({desc = "usePotion", int1 = potionId}) | ||
523 | 535 | ||
524 | local status = adv:doActive(potionData.effect, target) -- target | 536 | local status = adv:doActive(potionData.effect, target) -- target |
525 | if not status then return end | 537 | if not status then return end |
@@ -619,6 +631,7 @@ function _M.exitAdvRpc(agent, data) | @@ -619,6 +631,7 @@ function _M.exitAdvRpc(agent, data) | ||
619 | role:saveGuide(57,1,true) | 631 | role:saveGuide(57,1,true) |
620 | end | 632 | end |
621 | local adv = role:getAdvData() | 633 | local adv = role:getAdvData() |
634 | + adv:mylog({desc = "exit"}) | ||
622 | local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标 | 635 | local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标 |
623 | SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()})) | 636 | SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()})) |
624 | return true | 637 | return true |
@@ -689,7 +702,7 @@ function _M.endBattleRpc(agent, data) | @@ -689,7 +702,7 @@ function _M.endBattleRpc(agent, data) | ||
689 | role:saveGuide(61,1,true) | 702 | role:saveGuide(61,1,true) |
690 | end | 703 | end |
691 | end | 704 | end |
692 | - | 705 | + adv:mylog({desc = "endBattle"}) |
693 | local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) | 706 | local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) |
694 | 707 | ||
695 | if not status then return end | 708 | if not status then return end |
@@ -772,7 +785,9 @@ function _M.wheelSurfRpc(agent, data) | @@ -772,7 +785,9 @@ function _M.wheelSurfRpc(agent, data) | ||
772 | end | 785 | end |
773 | role:award(reward, {log = {desc = "advWheelSurf", int1 = ptype}}) | 786 | role:award(reward, {log = {desc = "advWheelSurf", int1 = ptype}}) |
774 | role:finishGuide(58) | 787 | role:finishGuide(58) |
788 | + | ||
775 | role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype}) | 789 | role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype}) |
790 | + role:mylog("adv_action", {desc = "advWheelSurf", int1 = ptype, int2 = count}) | ||
776 | 791 | ||
777 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) | 792 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) |
778 | return true | 793 | return true |
@@ -801,6 +816,7 @@ function _M.repayWheelSurfRpc(agent, data) | @@ -801,6 +816,7 @@ function _M.repayWheelSurfRpc(agent, data) | ||
801 | local gift = drawData["pool3"]:randWeight(true) | 816 | local gift = drawData["pool3"]:randWeight(true) |
802 | local reward, change = {[gift[1]] = gift[2]} | 817 | local reward, change = {[gift[1]] = gift[2]} |
803 | reward, change = role:award(reward, {log = {desc = "advRepayWheelSurf", int1 = ptype}}) | 818 | reward, change = role:award(reward, {log = {desc = "advRepayWheelSurf", int1 = ptype}}) |
819 | + role:mylog("adv_action", {desc = "advRepayWheelSurf", int1 = ptype}) | ||
804 | 820 | ||
805 | SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack(role:packReward(reward, change))) | 821 | SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack(role:packReward(reward, change))) |
806 | return true | 822 | return true |
@@ -824,6 +840,8 @@ function _M.finishAchievRpc(agent, data) | @@ -824,6 +840,8 @@ function _M.finishAchievRpc(agent, data) | ||
824 | if not status then return end | 840 | if not status then return end |
825 | adv:updateAchievement() | 841 | adv:updateAchievement() |
826 | role:finishGuide(57) | 842 | role:finishGuide(57) |
843 | + role:mylog("adv_action", {desc = "finishAchiev", short1 = ctype, int1 = chapterId, int2 = taskId}) | ||
844 | + | ||
827 | SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack(role:packReward(reward, change))) | 845 | SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack(role:packReward(reward, change))) |
828 | return true | 846 | return true |
829 | end | 847 | end |
@@ -879,6 +897,7 @@ function _M.refreshSupportRpc(agent, data) | @@ -879,6 +897,7 @@ function _M.refreshSupportRpc(agent, data) | ||
879 | end | 897 | end |
880 | 898 | ||
881 | role:advRandomSupportEffect() | 899 | role:advRandomSupportEffect() |
900 | + role:mylog("adv_action", {desc = "advSupRe", short1 = cr < al and 0 or 1}) | ||
882 | 901 | ||
883 | SendPacket(actionCodes.Adv_refreshSupportRpc, '') | 902 | SendPacket(actionCodes.Adv_refreshSupportRpc, '') |
884 | return true | 903 | return true |
src/actions/CarAction.lua
@@ -47,6 +47,8 @@ function _M.makePotionRpc( agent, data ) | @@ -47,6 +47,8 @@ function _M.makePotionRpc( agent, data ) | ||
47 | carriage_cook_amount = count, -- 制作总量 | 47 | carriage_cook_amount = count, -- 制作总量 |
48 | carriage_cook_cost = cost, -- 制作消耗道具,json格式记录,{'itemid1':10,'itemid2':5,…………..} | 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 | SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag})) | 52 | SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag})) |
51 | return true | 53 | return true |
52 | end | 54 | end |
@@ -105,7 +107,7 @@ function _M.equipUpRpc( agent, data ) | @@ -105,7 +107,7 @@ function _M.equipUpRpc( agent, data ) | ||
105 | equip_upgrade_cost = costCount, -- 升级操作消耗装备数量 | 107 | equip_upgrade_cost = costCount, -- 升级操作消耗装备数量 |
106 | equip_upgrade_current = cost, -- 升级消耗的货币类型 | 108 | equip_upgrade_current = cost, -- 升级消耗的货币类型 |
107 | }) | 109 | }) |
108 | - | 110 | + role:mylog("role_action", {desc = "equipUp", int1 = id, int2 = count}) |
109 | SendPacket(actionCodes.Car_equipUpRpc, '') | 111 | SendPacket(actionCodes.Car_equipUpRpc, '') |
110 | return true | 112 | return true |
111 | end | 113 | end |
@@ -145,7 +147,7 @@ function _M.runeUpRpc( agent, data ) | @@ -145,7 +147,7 @@ function _M.runeUpRpc( agent, data ) | ||
145 | hero:updateProperty({field = "battleV", value = hero:getBattleValue()}) | 147 | hero:updateProperty({field = "battleV", value = hero:getBattleValue()}) |
146 | end | 148 | end |
147 | end | 149 | end |
148 | - ownRune:log({desc = "runeUp", int1 = level + 1}) | 150 | + ownRune:mylog({desc = "runeUp", int1 = level + 1}) |
149 | 151 | ||
150 | SendPacket(actionCodes.Car_runeUpRpc, '') | 152 | SendPacket(actionCodes.Car_runeUpRpc, '') |
151 | return true | 153 | return true |
@@ -179,7 +181,8 @@ function _M.saleEquipRpc(agent, data ) | @@ -179,7 +181,8 @@ function _M.saleEquipRpc(agent, data ) | ||
179 | end | 181 | end |
180 | role:checkTaskEnter("SaleEquip", {count = allCount}) | 182 | role:checkTaskEnter("SaleEquip", {count = allCount}) |
181 | reward, change = role:award(reward, {log = {desc = "saleEquip"}}) | 183 | reward, change = role:award(reward, {log = {desc = "saleEquip"}}) |
182 | - | 184 | + role:mylog("role_action", {desc = "saleEquip", int1 = allCount}) |
185 | + | ||
183 | SendPacket(actionCodes.Car_saleEquipRpc, MsgPack.pack(role:packReward(reward, change))) | 186 | SendPacket(actionCodes.Car_saleEquipRpc, MsgPack.pack(role:packReward(reward, change))) |
184 | return true | 187 | return true |
185 | end | 188 | end |
src/actions/DinerAction.lua
@@ -106,6 +106,8 @@ function _M.addSellRpc( agent, data ) | @@ -106,6 +106,8 @@ function _M.addSellRpc( agent, data ) | ||
106 | end | 106 | end |
107 | role:finishGuide(28) | 107 | role:finishGuide(28) |
108 | 108 | ||
109 | + role:mylog("diner_action", {desc = "addSell", int1 = dish, int2 = count}) | ||
110 | + | ||
109 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) | 111 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
110 | SendPacket(actionCodes.Diner_addSellRpc, "") | 112 | SendPacket(actionCodes.Diner_addSellRpc, "") |
111 | return true | 113 | return true |
@@ -161,6 +163,7 @@ function _M.removeSellRpc( agent, data ) | @@ -161,6 +163,7 @@ function _M.removeSellRpc( agent, data ) | ||
161 | restaurant_sale_coin = reward[ItemId.DinerCoin] or 0, -- 售卖获得美食币 | 163 | restaurant_sale_coin = reward[ItemId.DinerCoin] or 0, -- 售卖获得美食币 |
162 | restaurant_sale_gear = reward[ItemId.Gold] or 0, -- 售卖获得齿轮 | 164 | restaurant_sale_gear = reward[ItemId.Gold] or 0, -- 售卖获得齿轮 |
163 | }) | 165 | }) |
166 | + role:mylog("diner_action", {desc = "removeSell", int1 = dish}) | ||
164 | 167 | ||
165 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) | 168 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
166 | SendPacket(actionCodes.Diner_removeSellRpc, MsgPack.pack({reward = reward, change = change})) | 169 | SendPacket(actionCodes.Diner_removeSellRpc, MsgPack.pack({reward = reward, change = change})) |
@@ -230,7 +233,7 @@ function _M.getSellRewardRpc( agent, data ) | @@ -230,7 +233,7 @@ function _M.getSellRewardRpc( agent, data ) | ||
230 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) | 233 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) |
231 | end | 234 | end |
232 | 235 | ||
233 | - | 236 | + role:mylog("diner_action", {desc = "sell"}) |
234 | 237 | ||
235 | SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward, change = change})) | 238 | SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward, change = change})) |
236 | return true | 239 | return true |
@@ -319,6 +322,8 @@ function _M.expediteSellRpc( agent, data ) | @@ -319,6 +322,8 @@ function _M.expediteSellRpc( agent, data ) | ||
319 | end | 322 | end |
320 | role:checkTaskEnter("FoodSellQuick") | 323 | role:checkTaskEnter("FoodSellQuick") |
321 | 324 | ||
325 | + role:mylog("diner_action", {desc = "sellQ"}) | ||
326 | + | ||
322 | SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward, change = change, popular = popular})) | 327 | SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward, change = change, popular = popular})) |
323 | return true | 328 | return true |
324 | end | 329 | end |
@@ -365,6 +370,7 @@ function _M.levelUpRpc( agent, data ) | @@ -365,6 +370,7 @@ function _M.levelUpRpc( agent, data ) | ||
365 | restaurant_up_effectbef = curLevel, --升级前加成 | 370 | restaurant_up_effectbef = curLevel, --升级前加成 |
366 | restaurant_up_effect = curLevel + 1, --升级后加成 | 371 | restaurant_up_effect = curLevel + 1, --升级后加成 |
367 | }) | 372 | }) |
373 | + role:mylog("diner_action", {desc = "buildUp", int1 = index, int2 = curLevel + 1}) | ||
368 | 374 | ||
369 | SendPacket(actionCodes.Diner_levelUpRpc, '') | 375 | SendPacket(actionCodes.Diner_levelUpRpc, '') |
370 | return true | 376 | return true |
@@ -454,6 +460,8 @@ function _M.talentUpRpc( agent, data ) | @@ -454,6 +460,8 @@ function _M.talentUpRpc( agent, data ) | ||
454 | carriage_logistics_gear = cost[ItemId.Gold] or 0, -- 后勤室升级花费齿轮数量 | 460 | carriage_logistics_gear = cost[ItemId.Gold] or 0, -- 后勤室升级花费齿轮数量 |
455 | carriage_logistics_coin = cost[ItemId.DinerCoin] or 0, -- 后勤室升级花费美食币数量 | 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 | SendPacket(actionCodes.Diner_talentUpRpc, '') | 465 | SendPacket(actionCodes.Diner_talentUpRpc, '') |
458 | return true | 466 | return true |
459 | end | 467 | end |
@@ -487,6 +495,7 @@ function _M.skillUpRpc( agent, data ) | @@ -487,6 +495,7 @@ function _M.skillUpRpc( agent, data ) | ||
487 | 495 | ||
488 | role:costItems(cost, {log = {desc = "dinerSkillUp", int1 = skill, int2 = skillLevel + 1}}) | 496 | role:costItems(cost, {log = {desc = "dinerSkillUp", int1 = skill, int2 = skillLevel + 1}}) |
489 | role.dinerData:updateProperty({field = "skillTree", value = skillTree:setv(skill, skillLevel + 1)}) | 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 | SendPacket(actionCodes.Diner_skillUpRpc, '') | 500 | SendPacket(actionCodes.Diner_skillUpRpc, '') |
492 | return true | 501 | return true |
@@ -514,6 +523,8 @@ function _M.lockTaskRpc( agent, data ) | @@ -514,6 +523,8 @@ function _M.lockTaskRpc( agent, data ) | ||
514 | end | 523 | end |
515 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) | 524 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
516 | 525 | ||
526 | + role:mylog("diner_action", {desc = "lockTask", int1 = order.id}) | ||
527 | + | ||
517 | SendPacket(actionCodes.Diner_lockTaskRpc, MsgPack.pack({lock = order.lock})) | 528 | SendPacket(actionCodes.Diner_lockTaskRpc, MsgPack.pack({lock = order.lock})) |
518 | return true | 529 | return true |
519 | end | 530 | end |
@@ -550,7 +561,8 @@ function _M.updateTaskRpc( agent, data ) | @@ -550,7 +561,8 @@ function _M.updateTaskRpc( agent, data ) | ||
550 | orders[index].status = 1 | 561 | orders[index].status = 1 |
551 | orders[index].lock = 1 | 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 | elseif cmd == 1 then | 566 | elseif cmd == 1 then |
555 | if order.status ~= 1 then | 567 | if order.status ~= 1 then |
556 | return 31 | 568 | return 31 |
@@ -558,6 +570,8 @@ function _M.updateTaskRpc( agent, data ) | @@ -558,6 +570,8 @@ function _M.updateTaskRpc( agent, data ) | ||
558 | orders[index].status = 0 | 570 | orders[index].status = 0 |
559 | orders[index].lock = 0 | 571 | orders[index].lock = 0 |
560 | 572 | ||
573 | + role:mylog("diner_action", {desc = "deleteTask", int1 = order.id}) | ||
574 | + | ||
561 | elseif cmd == 2 then | 575 | elseif cmd == 2 then |
562 | if order.status ~= 1 then | 576 | if order.status ~= 1 then |
563 | return 32 | 577 | return 32 |
@@ -565,10 +579,11 @@ function _M.updateTaskRpc( agent, data ) | @@ -565,10 +579,11 @@ function _M.updateTaskRpc( agent, data ) | ||
565 | if order.n < taskData.value then | 579 | if order.n < taskData.value then |
566 | return 6 | 580 | return 6 |
567 | end | 581 | end |
582 | + role:mylog("diner_action", {desc = "finishTask", int1 = order.id}) | ||
568 | 583 | ||
569 | reward, change = role:award(taskData.reward, {log = {desc = "dinerFinishTask", int1 = order.id}}) | 584 | reward, change = role:award(taskData.reward, {log = {desc = "dinerFinishTask", int1 = order.id}}) |
570 | table.remove(orders,index) | 585 | table.remove(orders,index) |
571 | - role:checkTaskEnter("OverOderTask", {rarity = taskSet.rarity}) | 586 | + role:checkTaskEnter("OverOderTask", {rarity = taskData.rarity}) |
572 | else | 587 | else |
573 | return 33 | 588 | return 33 |
574 | end | 589 | end |
@@ -577,8 +592,8 @@ function _M.updateTaskRpc( agent, data ) | @@ -577,8 +592,8 @@ function _M.updateTaskRpc( agent, data ) | ||
577 | role:log("restaurant_order", { | 592 | role:log("restaurant_order", { |
578 | restaurant_order_id = order.id, -- 订单任务ID | 593 | restaurant_order_id = order.id, -- 订单任务ID |
579 | restaurant_order_status = cmd, -- 订单任务状态,接受:0, 拒绝:1, 完成:2 | 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 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) | 599 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
@@ -656,6 +671,8 @@ function _M.refreshTaskRpc( agent, data ) | @@ -656,6 +671,8 @@ function _M.refreshTaskRpc( agent, data ) | ||
656 | end | 671 | end |
657 | 672 | ||
658 | role:finishGuide(41) | 673 | role:finishGuide(41) |
674 | + role:mylog("diner_action", {desc = "reTask"}) | ||
675 | + | ||
659 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) | 676 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
660 | 677 | ||
661 | SendPacket(actionCodes.Diner_refreshTaskRpc, '') | 678 | SendPacket(actionCodes.Diner_refreshTaskRpc, '') |
@@ -696,6 +713,8 @@ function _M.addWantFoodRpc(agent , data) | @@ -696,6 +713,8 @@ function _M.addWantFoodRpc(agent , data) | ||
696 | end | 713 | end |
697 | 714 | ||
698 | role:finishGuide(36) | 715 | role:finishGuide(36) |
716 | + role:mylog("diner_action", {desc = "wantFood"}) | ||
717 | + | ||
699 | role.dinerData:updateProperty({field = "gfood", value = gfood}) | 718 | role.dinerData:updateProperty({field = "gfood", value = gfood}) |
700 | 719 | ||
701 | SendPacket(actionCodes.Diner_addWantFoodRpc, '') | 720 | SendPacket(actionCodes.Diner_addWantFoodRpc, '') |
@@ -742,6 +761,7 @@ function _M.getGreenhouseRpc( agent, data ) | @@ -742,6 +761,7 @@ function _M.getGreenhouseRpc( agent, data ) | ||
742 | local reward, change = role:award(reward, {log = {desc = "greenHourse", int1 = level}}) | 761 | local reward, change = role:award(reward, {log = {desc = "greenHourse", int1 = level}}) |
743 | role:checkTaskEnter("FoodMGet") | 762 | role:checkTaskEnter("FoodMGet") |
744 | 763 | ||
764 | + role:mylog("diner_action", {desc = "greenHourse"}) | ||
745 | 765 | ||
746 | SendPacket(actionCodes.Diner_getGreenhouseRpc, MsgPack.pack({reward = reward, change = change})) | 766 | SendPacket(actionCodes.Diner_getGreenhouseRpc, MsgPack.pack({reward = reward, change = change})) |
747 | return true | 767 | return true |
@@ -880,6 +900,8 @@ function _M.entrustRpc(agent , data) | @@ -880,6 +900,8 @@ function _M.entrustRpc(agent , data) | ||
880 | role.dinerData:updateProperty({field = "entrust", value = entrust}) | 900 | role.dinerData:updateProperty({field = "entrust", value = entrust}) |
881 | 901 | ||
882 | role:finishGuide(26) | 902 | role:finishGuide(26) |
903 | + role:mylog("diner_action", {desc = "entrus", short1 = ctype, int1 = entrustId}) | ||
904 | + role:checkTaskEnter("VillageApply", {}) | ||
883 | 905 | ||
884 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward, change = change})) | 906 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward, change = change})) |
885 | return true | 907 | return true |
@@ -916,6 +938,7 @@ function _M.collectRpc(agent , data) | @@ -916,6 +938,7 @@ function _M.collectRpc(agent , data) | ||
916 | restaurant_collect_rwd = reward, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….} | 938 | restaurant_collect_rwd = reward, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….} |
917 | restaurant_collect_plan = count, -- 收集进度,即解锁顾客,数字表示 | 939 | restaurant_collect_plan = count, -- 收集进度,即解锁顾客,数字表示 |
918 | }) | 940 | }) |
941 | + role:mylog("diner_action", {desc = "collect", int1 = id}) | ||
919 | 942 | ||
920 | SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward, change = change})) | 943 | SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward, change = change})) |
921 | return true | 944 | return true |
@@ -945,6 +968,8 @@ function _M.comboRewardRpc(agent , data) | @@ -945,6 +968,8 @@ function _M.comboRewardRpc(agent , data) | ||
945 | 968 | ||
946 | role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 | 969 | role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 |
947 | 970 | ||
971 | + role:mylog("diner_action", {desc = "combo", int1 = id}) | ||
972 | + | ||
948 | SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward, change = change})) | 973 | SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward, change = change})) |
949 | return true | 974 | return true |
950 | end | 975 | end |
src/actions/EmailAction.lua
@@ -53,6 +53,7 @@ function _M.listRpc(agent, data) | @@ -53,6 +53,7 @@ function _M.listRpc(agent, data) | ||
53 | content = email.content, | 53 | content = email.content, |
54 | attachments = email.attachments | 54 | attachments = email.attachments |
55 | }) | 55 | }) |
56 | + role:mylog("mail_action", {desc = "get_global", key1 = email.title, key2 = email.attachments}) | ||
56 | end | 57 | end |
57 | end | 58 | end |
58 | end | 59 | end |
@@ -98,6 +99,7 @@ function _M.drawAllAttachRpc(agent, data) | @@ -98,6 +99,7 @@ function _M.drawAllAttachRpc(agent, data) | ||
98 | for key, v in pairs(attachments:toNumMap()) do | 99 | for key, v in pairs(attachments:toNumMap()) do |
99 | reward[key] = (reward[key] or 0) + v | 100 | reward[key] = (reward[key] or 0) + v |
100 | end | 101 | end |
102 | + role:mylog("mail_action", {desc = "draw_attach", int1 = email:getProperty("emailId"), key1 = email:getProperty("title"), key2 = attachments}) | ||
101 | end | 103 | end |
102 | end | 104 | end |
103 | reward, change = role:award(reward, {log = {desc = "draw_attach"}}) | 105 | reward, change = role:award(reward, {log = {desc = "draw_attach"}}) |
@@ -123,7 +125,7 @@ function _M.drawAttachRpc(agent, data) | @@ -123,7 +125,7 @@ function _M.drawAttachRpc(agent, data) | ||
123 | email:setProperty("status", 2) | 125 | email:setProperty("status", 2) |
124 | email:log(role, 2) | 126 | email:log(role, 2) |
125 | SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward, change = change})) | 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 | return true | 129 | return true |
128 | end | 130 | end |
129 | 131 | ||
@@ -140,6 +142,7 @@ function _M.checkRpc(agent, data) | @@ -140,6 +142,7 @@ function _M.checkRpc(agent, data) | ||
140 | 142 | ||
141 | email:setProperty("status", 1) | 143 | email:setProperty("status", 1) |
142 | email:log(role, 1) | 144 | email:log(role, 1) |
145 | + role:mylog("mail_action", {desc = "check_mail", int1 = id}) | ||
143 | 146 | ||
144 | SendPacket(actionCodes.Email_checkRpc, '') | 147 | SendPacket(actionCodes.Email_checkRpc, '') |
145 | return true | 148 | return true |
@@ -175,6 +178,9 @@ function _M.delRpc(agent, data) | @@ -175,6 +178,9 @@ function _M.delRpc(agent, data) | ||
175 | end | 178 | end |
176 | end | 179 | end |
177 | end) | 180 | end) |
181 | + for delId, _ in ipairs(result) do | ||
182 | + role:mylog("mail_action", {desc = "del_mail", int1 = delId}) | ||
183 | + end | ||
178 | SendPacket(actionCodes.Email_delRpc, MsgPack.pack({result = result})) | 184 | SendPacket(actionCodes.Email_delRpc, MsgPack.pack({result = result})) |
179 | return true | 185 | return true |
180 | end | 186 | end |
src/actions/FriendAction.lua
@@ -111,6 +111,7 @@ function _M.searchRpc(agent, data) | @@ -111,6 +111,7 @@ function _M.searchRpc(agent, data) | ||
111 | })) | 111 | })) |
112 | end | 112 | end |
113 | 113 | ||
114 | + role:mylog("role_action", {desc = "searchFriend"}) | ||
114 | SendPacket(actionCodes.Friend_searchRpc, MsgPack.pack({searchList = searchList})) | 115 | SendPacket(actionCodes.Friend_searchRpc, MsgPack.pack({searchList = searchList})) |
115 | return true | 116 | return true |
116 | end | 117 | end |
@@ -177,6 +178,8 @@ function _M.applyRpc(agent, data) | @@ -177,6 +178,8 @@ function _M.applyRpc(agent, data) | ||
177 | myInfo.online = true | 178 | myInfo.online = true |
178 | myInfo.hadApply = true | 179 | myInfo.hadApply = true |
179 | 180 | ||
181 | + role:mylog("role_action", {desc = "addFriend", int1 = 1}) | ||
182 | + | ||
180 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方 | 183 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方 |
181 | end | 184 | end |
182 | 185 | ||
@@ -283,6 +286,8 @@ function _M.handleApplyRpc(agent, data) | @@ -283,6 +286,8 @@ function _M.handleApplyRpc(agent, data) | ||
283 | friend_roleid = objectId, -- 好友账户下的角色id | 286 | friend_roleid = objectId, -- 好友账户下的角色id |
284 | friend_cnt = curCount + 1, -- 操作后好友数量 | 287 | friend_cnt = curCount + 1, -- 操作后好友数量 |
285 | }) | 288 | }) |
289 | + role:mylog("role_action", {desc = "addFriend", int1 = 1}) | ||
290 | + | ||
286 | end | 291 | end |
287 | 292 | ||
288 | elseif cmd == 0 then -- 不同意 | 293 | elseif cmd == 0 then -- 不同意 |
@@ -347,6 +352,8 @@ function _M.handleApplyRpc(agent, data) | @@ -347,6 +352,8 @@ function _M.handleApplyRpc(agent, data) | ||
347 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {myInfo}})) -- 通知对方 | 352 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {myInfo}})) -- 通知对方 |
348 | end | 353 | end |
349 | if next(needAdd) then | 354 | if next(needAdd) then |
355 | + role:mylog("role_action", {desc = "addFriend", int1 = #needAdd}) | ||
356 | + | ||
350 | SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = needAddInfo})) | 357 | SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = needAddInfo})) |
351 | else | 358 | else |
352 | result = 1 | 359 | result = 1 |
@@ -553,6 +560,8 @@ function _M.pointRpc(agent, data) | @@ -553,6 +560,8 @@ function _M.pointRpc(agent, data) | ||
553 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) | 560 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) |
554 | role:checkTaskEnter("GiveFriendP", {count = 1}) | 561 | role:checkTaskEnter("GiveFriendP", {count = 1}) |
555 | rpcRole(objId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newPoint = 1, roleId = roleId})) | 562 | rpcRole(objId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newPoint = 1, roleId = roleId})) |
563 | + | ||
564 | + role:mylog("role_action", {desc = "giveFPoint", int1 = 1}) | ||
556 | end | 565 | end |
557 | elseif cmd == 2 then -- 领取 | 566 | elseif cmd == 2 then -- 领取 |
558 | local objId = msg.roleId | 567 | local objId = msg.roleId |
@@ -572,6 +581,7 @@ function _M.pointRpc(agent, data) | @@ -572,6 +581,7 @@ function _M.pointRpc(agent, data) | ||
572 | role.dailyData:updateProperty({field = "getFP", value = getP}) | 581 | role.dailyData:updateProperty({field = "getFP", value = getP}) |
573 | role:checkTaskEnter("GetFriendP", {count = 1}) | 582 | role:checkTaskEnter("GetFriendP", {count = 1}) |
574 | 583 | ||
584 | + role:mylog("role_action", {desc = "getFPoint", int1 = 1}) | ||
575 | end | 585 | end |
576 | elseif cmd == 3 then -- 一键赠送领取 | 586 | elseif cmd == 3 then -- 一键赠送领取 |
577 | -- 赠送 | 587 | -- 赠送 |
@@ -593,6 +603,8 @@ function _M.pointRpc(agent, data) | @@ -593,6 +603,8 @@ function _M.pointRpc(agent, data) | ||
593 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) | 603 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) |
594 | role:checkTaskEnter("GiveFriendP", {count = change}) | 604 | role:checkTaskEnter("GiveFriendP", {count = change}) |
595 | 605 | ||
606 | + role:mylog("role_action", {desc = "giveFPoint", int1 = change}) | ||
607 | + | ||
596 | else | 608 | else |
597 | result = 1 | 609 | result = 1 |
598 | end | 610 | end |
@@ -617,6 +629,7 @@ function _M.pointRpc(agent, data) | @@ -617,6 +629,7 @@ function _M.pointRpc(agent, data) | ||
617 | reward = role:award({[ItemId.FriendPoint] = getCount}, {log = {desc = "friendPoint"}}) | 629 | reward = role:award({[ItemId.FriendPoint] = getCount}, {log = {desc = "friendPoint"}}) |
618 | role.dailyData:updateProperty({field = "getFP", value = getP}) | 630 | role.dailyData:updateProperty({field = "getFP", value = getP}) |
619 | role:checkTaskEnter("GetFriendP", {count = getCount}) | 631 | role:checkTaskEnter("GetFriendP", {count = getCount}) |
632 | + role:mylog("role_action", {desc = "getFPoint", int1 = getCount}) | ||
620 | else | 633 | else |
621 | result = (result or 0) + 2 | 634 | result = (result or 0) + 2 |
622 | end | 635 | end |
src/actions/GmAction.lua
@@ -27,6 +27,7 @@ function _M.ignoreout(role, pms) | @@ -27,6 +27,7 @@ function _M.ignoreout(role, pms) | ||
27 | else -- 解除 | 27 | else -- 解除 |
28 | role:updateProperty({field = "ignoreMt", value = 0}) | 28 | role:updateProperty({field = "ignoreMt", value = 0}) |
29 | end | 29 | end |
30 | + role:mylog("gm_action", {desc = "ignoreout", key1 = pms.sender}) | ||
30 | return "指令生效" | 31 | return "指令生效" |
31 | end | 32 | end |
32 | 33 | ||
@@ -46,11 +47,17 @@ function _M.ban(role, pms) | @@ -46,11 +47,17 @@ function _M.ban(role, pms) | ||
46 | end) | 47 | end) |
47 | end | 48 | end |
48 | end | 49 | end |
50 | + | ||
51 | + role:mylog("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender}) | ||
52 | + | ||
49 | return isBan and "解封杀成功" or "封杀成功" | 53 | return isBan and "解封杀成功" or "封杀成功" |
50 | end | 54 | end |
51 | 55 | ||
52 | function _M.unban(role, pms) | 56 | function _M.unban(role, pms) |
53 | role:setBan(0, 0) | 57 | role:setBan(0, 0) |
58 | + | ||
59 | + role:mylog("gm_action", {desc = "unban", key1 = pms.sender}) | ||
60 | + | ||
54 | return "解封杀成功" | 61 | return "解封杀成功" |
55 | end | 62 | end |
56 | 63 | ||
@@ -63,6 +70,8 @@ function _M.gmmsg(role, pms) | @@ -63,6 +70,8 @@ function _M.gmmsg(role, pms) | ||
63 | skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd) | 70 | skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd) |
64 | end) | 71 | end) |
65 | end | 72 | end |
73 | + role:mylog("gm_action", {desc = "gmmsg", text1 = pms.pm1, key1 = pms.sender}) | ||
74 | + | ||
66 | return "指令成功" | 75 | return "指令成功" |
67 | end | 76 | end |
68 | 77 | ||
@@ -73,6 +82,8 @@ function _M.silent(role, pms) | @@ -73,6 +82,8 @@ function _M.silent(role, pms) | ||
73 | return "解禁言成功" | 82 | return "解禁言成功" |
74 | end | 83 | end |
75 | role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400}) | 84 | role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400}) |
85 | + | ||
86 | + role:mylog("gm_action", {desc = "silent", int1 = pms.pm1, key1 = pms.sender}) | ||
76 | return "禁言成功" | 87 | return "禁言成功" |
77 | end | 88 | end |
78 | 89 | ||
@@ -90,6 +101,8 @@ function _M.hero(role, pms) | @@ -90,6 +101,8 @@ function _M.hero(role, pms) | ||
90 | if not role:addHero({type = heroType, log = {desc = "gm"}}) then | 101 | if not role:addHero({type = heroType, log = {desc = "gm"}}) then |
91 | return "失败" | 102 | return "失败" |
92 | end | 103 | end |
104 | + | ||
105 | + role:mylog("gm_action", {desc = "hero", int1 = heroType, key1 = pms.sender}) | ||
93 | return "成功" | 106 | return "成功" |
94 | end | 107 | end |
95 | 108 | ||
@@ -122,6 +135,8 @@ function _M.herol(role, pms) | @@ -122,6 +135,8 @@ function _M.herol(role, pms) | ||
122 | hero:updateProperty({field = "level", delta = addLevel}) | 135 | hero:updateProperty({field = "level", delta = addLevel}) |
123 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) | 136 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) |
124 | 137 | ||
138 | + role:mylog("gm_action", {desc = "herol", int1 = heroType, int2 = addLevel, key1 = pms.sender}) | ||
139 | + | ||
125 | return "成功" | 140 | return "成功" |
126 | end | 141 | end |
127 | 142 | ||
@@ -133,6 +148,8 @@ function _M.herola(role, pms) | @@ -133,6 +148,8 @@ function _M.herola(role, pms) | ||
133 | _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel}) | 148 | _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel}) |
134 | end | 149 | end |
135 | 150 | ||
151 | + role:mylog("gm_action", {desc = "herola", int1 = addLevel, key1 = pms.sender}) | ||
152 | + | ||
136 | return "成功" | 153 | return "成功" |
137 | end | 154 | end |
138 | 155 | ||
@@ -143,6 +160,7 @@ function _M.equip(role, pms) | @@ -143,6 +160,7 @@ function _M.equip(role, pms) | ||
143 | local level = tonum(pms.pm2) | 160 | local level = tonum(pms.pm2) |
144 | local count = tonum(pms.pm3) | 161 | local count = tonum(pms.pm3) |
145 | role:addEquip(typ, level, count, {log = {desc = "gm"}}) | 162 | role:addEquip(typ, level, count, {log = {desc = "gm"}}) |
163 | + role:mylog("gm_action", {desc = "equip", int1 = typ, int2 = level, long1 = count, key1 = pms.sender}) | ||
146 | return "成功" | 164 | return "成功" |
147 | end | 165 | end |
148 | 166 | ||
@@ -151,6 +169,7 @@ function _M.rune(role, pms) | @@ -151,6 +169,7 @@ function _M.rune(role, pms) | ||
151 | local typ = tonum(pms.pm1) | 169 | local typ = tonum(pms.pm1) |
152 | local id = tonum(pms.pm2) | 170 | local id = tonum(pms.pm2) |
153 | local result = role:addRune({type = typ,id = id, log = {desc = "gm"}}) | 171 | local result = role:addRune({type = typ,id = id, log = {desc = "gm"}}) |
172 | + role:mylog("gm_action", {desc = "rune", int1 = typ, int2 = id, key1 = pms.sender}) | ||
154 | 173 | ||
155 | return result | 174 | return result |
156 | end | 175 | end |
@@ -171,6 +190,8 @@ function _M.fb(role, pms) -- 直接通关 | @@ -171,6 +190,8 @@ function _M.fb(role, pms) -- 直接通关 | ||
171 | role:hangFinish(carbonId) | 190 | role:hangFinish(carbonId) |
172 | addPre(carbonId) | 191 | addPre(carbonId) |
173 | 192 | ||
193 | + role:mylog("gm_action", {desc = "fb", int1 = carbonId, key1 = pms.sender}) | ||
194 | + | ||
174 | role:checkTaskEnter("HangPass", {id = carbonId}) | 195 | role:checkTaskEnter("HangPass", {id = carbonId}) |
175 | return "成功" | 196 | return "成功" |
176 | end | 197 | end |
@@ -191,6 +212,8 @@ function _M.fbc(role, pms) -- 直接通关 | @@ -191,6 +212,8 @@ function _M.fbc(role, pms) -- 直接通关 | ||
191 | end | 212 | end |
192 | role:updateProperty({field = "hangPass", value = {}}) | 213 | role:updateProperty({field = "hangPass", value = {}}) |
193 | addPre(carbonId) | 214 | addPre(carbonId) |
215 | + | ||
216 | + role:mylog("gm_action", {desc = "fbc", int1 = carbonId, key1 = pms.sender}) | ||
194 | 217 | ||
195 | return "成功" | 218 | return "成功" |
196 | end | 219 | end |
@@ -224,6 +247,8 @@ function _M.exp(role, pms) | @@ -224,6 +247,8 @@ function _M.exp(role, pms) | ||
224 | exp = math.floor(math.max(exp, 0)) | 247 | exp = math.floor(math.max(exp, 0)) |
225 | role:addPlayExp(exp, {log = {desc = "gm"}}) | 248 | role:addPlayExp(exp, {log = {desc = "gm"}}) |
226 | 249 | ||
250 | + role:mylog("gm_action", {desc = "exp", int1 = exp, key1 = pms.sender}) | ||
251 | + | ||
227 | return "成功" | 252 | return "成功" |
228 | end | 253 | end |
229 | 254 | ||
@@ -280,6 +305,7 @@ function _M.get(role, pms) | @@ -280,6 +305,7 @@ function _M.get(role, pms) | ||
280 | end | 305 | end |
281 | local count = tonum(pms.pm2, 1) | 306 | local count = tonum(pms.pm2, 1) |
282 | role:award({[itemId] = count}, {log = {desc = "gm"}}) | 307 | role:award({[itemId] = count}, {log = {desc = "gm"}}) |
308 | + role:mylog("gm_action", {desc = "get", int1 = itemId, int2 = count, key1 = pms.sender}) | ||
283 | end | 309 | end |
284 | return "成功" | 310 | return "成功" |
285 | end | 311 | end |
@@ -303,6 +329,9 @@ function _M.advc(role, pms) | @@ -303,6 +329,9 @@ function _M.advc(role, pms) | ||
303 | advAFWear = {}, | 329 | advAFWear = {}, |
304 | }, notNotify) | 330 | }, notNotify) |
305 | role.advData = nil | 331 | role.advData = nil |
332 | + | ||
333 | + role:mylog("gm_action", {desc = "advc", key1 = pms.sender}) | ||
334 | + | ||
306 | return "成功" | 335 | return "成功" |
307 | end | 336 | end |
308 | 337 | ||
@@ -311,6 +340,8 @@ function _M.advf(role, pms) | @@ -311,6 +340,8 @@ function _M.advf(role, pms) | ||
311 | role:updateProperty({field = "advC", value = 0}) | 340 | role:updateProperty({field = "advC", value = 0}) |
312 | role.dailyData:updateProperty({field = "advElC", value = 0}) | 341 | role.dailyData:updateProperty({field = "advElC", value = 0}) |
313 | 342 | ||
343 | + role:mylog("gm_action", {desc = "advf", key1 = pms.sender}) | ||
344 | + | ||
314 | return "成功" | 345 | return "成功" |
315 | end | 346 | end |
316 | 347 | ||
@@ -330,6 +361,7 @@ function _M.adv(role, pms) | @@ -330,6 +361,7 @@ function _M.adv(role, pms) | ||
330 | advPass[chapterId] = layer | 361 | advPass[chapterId] = layer |
331 | role:updateProperty({field = "advPass", value = advPass}) | 362 | role:updateProperty({field = "advPass", value = advPass}) |
332 | end | 363 | end |
364 | + role:mylog("gm_action", {desc = "adv", int1 = chapterId, int2 = layer, key1 = pms.sender}) | ||
333 | 365 | ||
334 | return "成功" | 366 | return "成功" |
335 | end | 367 | end |
@@ -356,6 +388,7 @@ function _M.advt(role, pms) | @@ -356,6 +388,7 @@ function _M.advt(role, pms) | ||
356 | isEnter = true, | 388 | isEnter = true, |
357 | debugMapId = mapId, | 389 | debugMapId = mapId, |
358 | }) | 390 | }) |
391 | + role:mylog("gm_action", {desc = "advt", int1 = chapterId, int2 = layer, key1 = pms.sender}) | ||
359 | return "成功" | 392 | return "成功" |
360 | end | 393 | end |
361 | 394 | ||
@@ -364,6 +397,8 @@ function _M.advl(role, pms) | @@ -364,6 +397,8 @@ function _M.advl(role, pms) | ||
364 | local exp = tonum(pms.pm1) | 397 | local exp = tonum(pms.pm1) |
365 | role:addAdvLvExp(math.max(0, exp)) | 398 | role:addAdvLvExp(math.max(0, exp)) |
366 | 399 | ||
400 | + role:mylog("gm_action", {desc = "advl", int1 = exp, key1 = pms.sender}) | ||
401 | + | ||
367 | return "成功" | 402 | return "成功" |
368 | end | 403 | end |
369 | 404 | ||
@@ -377,6 +412,7 @@ function _M.advcl(role, pms) | @@ -377,6 +412,7 @@ function _M.advcl(role, pms) | ||
377 | end | 412 | end |
378 | advData.battle.player:addExp(exp) | 413 | advData.battle.player:addExp(exp) |
379 | advData:saveDB() | 414 | advData:saveDB() |
415 | + role:mylog("gm_action", {desc = "advcl", int1 = exp, key1 = pms.sender}) | ||
380 | 416 | ||
381 | return "成功" | 417 | return "成功" |
382 | end | 418 | end |
@@ -386,6 +422,7 @@ function _M.idlec(role, pms) | @@ -386,6 +422,7 @@ function _M.idlec(role, pms) | ||
386 | role:updateProperty({field = "hangTeam", value = {}}) | 422 | role:updateProperty({field = "hangTeam", value = {}}) |
387 | role:updateProperty({field = "hangInfo", value = {}}) | 423 | role:updateProperty({field = "hangInfo", value = {}}) |
388 | role:updateProperty({field = "hangBag", value = {}}) | 424 | role:updateProperty({field = "hangBag", value = {}}) |
425 | + role:mylog("gm_action", {desc = "idlec", key1 = pms.sender}) | ||
389 | 426 | ||
390 | role.advData = nil | 427 | role.advData = nil |
391 | return "成功" | 428 | return "成功" |
@@ -410,6 +447,8 @@ function _M.advit(role, pms) | @@ -410,6 +447,8 @@ function _M.advit(role, pms) | ||
410 | local itemId = tonum(pms.pm1) | 447 | local itemId = tonum(pms.pm1) |
411 | local count = tonum(pms.pm2) | 448 | local count = tonum(pms.pm2) |
412 | reward[itemId] = count | 449 | reward[itemId] = count |
450 | + | ||
451 | + role:mylog("gm_action", {desc = "advit", int1 = itemId, int2 = count, key1 = pms.sender}) | ||
413 | end | 452 | end |
414 | 453 | ||
415 | 454 | ||
@@ -425,6 +464,8 @@ function _M.tower(role, pms) | @@ -425,6 +464,8 @@ function _M.tower(role, pms) | ||
425 | if not csvdb["tower_battleCsv"][level] then return "不存在" end | 464 | if not csvdb["tower_battleCsv"][level] then return "不存在" end |
426 | role:updateProperty({field = "towerInfo", value = {c = globalCsv.tower_count_limit, l = level}}) | 465 | role:updateProperty({field = "towerInfo", value = {c = globalCsv.tower_count_limit, l = level}}) |
427 | 466 | ||
467 | + role:mylog("gm_action", {desc = "tower", int1 = level, key1 = pms.sender}) | ||
468 | + | ||
428 | return "成功" | 469 | return "成功" |
429 | end | 470 | end |
430 | 471 | ||
@@ -443,21 +484,42 @@ function _M.email(role, pms) | @@ -443,21 +484,42 @@ function _M.email(role, pms) | ||
443 | rewardPms = id ~= 0 and reward or nil, | 484 | rewardPms = id ~= 0 and reward or nil, |
444 | }) | 485 | }) |
445 | 486 | ||
487 | + role:mylog("gm_action", {desc = "email", int1 = id, key1 = pms.sender}) | ||
488 | + | ||
446 | return "成功" | 489 | return "成功" |
447 | end | 490 | end |
448 | 491 | ||
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 = ""}) | 492 | +table.insert(helpDes, {"引导", "guide", "skip/reset"}) |
493 | +function _M.guide(role, pms) | ||
494 | + local cmd = pms.pm1 or "un" | ||
495 | + if cmd == "SKIP" then | ||
496 | + role:updateProperty({field = "newerGuide", value = "9999=1"}) | ||
497 | + local str = "" | ||
498 | + for _, set in pairs(csvdb["guide_mainCsv"]) do | ||
499 | + str = str:setv(set[1].major * 1000,1) | ||
500 | + for _,data in ipairs(set) do | ||
501 | + if data["break"] ~= 0 then | ||
502 | + str = str:setv(data.major * 1000 + data.minor,1) | ||
503 | + end | ||
504 | + end | ||
505 | + end | ||
506 | + role:updateProperty({field = "funcGuide", value = str}) | ||
507 | + role:mylog("gm_action", {desc = "sguide", key1 = pms.sender}) | ||
508 | + | ||
509 | + elseif cmd == "RESET" then | ||
510 | + local id = tonum(pms.pm2, 0) | ||
511 | + if id == 0 then | ||
512 | + role:updateProperties({ | ||
513 | + newerGuide = "1=1", | ||
514 | + funcGuide = "", | ||
515 | + }, notNotify) | ||
516 | + elseif id == 1 then | ||
517 | + role:updateProperty({field = "newerGuide", value = "1=1"}) | ||
518 | + elseif id == 2 then | ||
519 | + role:updateProperty({field = "funcGuide", value = ""}) | ||
520 | + end | ||
521 | + role:mylog("gm_action", {desc = "cguide", int1 = id, key1 = pms.sender}) | ||
522 | + | ||
461 | end | 523 | end |
462 | 524 | ||
463 | return "成功" | 525 | return "成功" |
@@ -472,7 +534,7 @@ function _M.test(role, pms) | @@ -472,7 +534,7 @@ function _M.test(role, pms) | ||
472 | local id = tonum(pms.pm1, 0) | 534 | local id = tonum(pms.pm1, 0) |
473 | --local hero = require ("actions.HeroAction") | 535 | --local hero = require ("actions.HeroAction") |
474 | --hero.unlockPoolRpc({role = role}, MsgPack.pack({type = id})) | 536 | --hero.unlockPoolRpc({role = role}, MsgPack.pack({type = id})) |
475 | - role.storeData:onBattleCardReset() | 537 | + print(role:getPaybackReward(0, 10000)) |
476 | return "成功" | 538 | return "成功" |
477 | end | 539 | end |
478 | 540 | ||
@@ -481,4 +543,21 @@ function _M.ayncPurchase(role, params) | @@ -481,4 +543,21 @@ function _M.ayncPurchase(role, params) | ||
481 | return role:handlePurchase(params) or "" | 543 | return role:handlePurchase(params) or "" |
482 | end | 544 | end |
483 | 545 | ||
546 | +function _M.cz(role, pms) | ||
547 | + local id = tonum(pms.pm1) | ||
548 | + local csvData = csvdb["shop_rechargeCsv"][id] | ||
549 | + if not csvData then | ||
550 | + return "充值id错误, 查看shop_recharge.csv" | ||
551 | + end | ||
552 | + role:recharge({ | ||
553 | + id = id, | ||
554 | + transactionId = "GM", | ||
555 | + order = "GM", | ||
556 | + pay_time = skynet.timex(), | ||
557 | + }) | ||
558 | + role:mylog("gm_action", {desc = "recharge", int1 = id, key1 = pms.sender}) | ||
559 | + return "指令成功" | ||
560 | +end | ||
561 | + | ||
562 | + | ||
484 | return _M | 563 | return _M |
485 | \ No newline at end of file | 564 | \ No newline at end of file |
src/actions/HangAction.lua
@@ -166,7 +166,7 @@ function _M.startRpc( agent, data ) | @@ -166,7 +166,7 @@ function _M.startRpc( agent, data ) | ||
166 | elseif carbonId == 10220 then | 166 | elseif carbonId == 10220 then |
167 | role:saveGuide(22,1) | 167 | role:saveGuide(22,1) |
168 | end | 168 | end |
169 | - | 169 | + role:mylog("hang_action", {desc = "startHang", int1 = carbonId}) |
170 | SendPacket(actionCodes.Hang_startRpc, '') | 170 | SendPacket(actionCodes.Hang_startRpc, '') |
171 | return true | 171 | return true |
172 | end | 172 | end |
@@ -258,9 +258,10 @@ function _M.endBattleRpc(agent, data) | @@ -258,9 +258,10 @@ function _M.endBattleRpc(agent, data) | ||
258 | role:finishGuide(5) | 258 | role:finishGuide(5) |
259 | elseif carbonId == 10102 then | 259 | elseif carbonId == 10102 then |
260 | role:finishGuide(8) | 260 | role:finishGuide(8) |
261 | + role:saveGuide(9, 2) | ||
261 | elseif carbonId == 10103 then | 262 | elseif carbonId == 10103 then |
262 | role:finishGuide(9) | 263 | role:finishGuide(9) |
263 | - elseif carbonId == 10220 then | 264 | + elseif carbonId == 20101 then |
264 | role:finishGuide(22) | 265 | role:finishGuide(22) |
265 | end | 266 | end |
266 | for _, guideData in pairs(csvdb["guide_unlockCsv"]) do | 267 | for _, guideData in pairs(csvdb["guide_unlockCsv"]) do |
@@ -270,8 +271,14 @@ function _M.endBattleRpc(agent, data) | @@ -270,8 +271,14 @@ function _M.endBattleRpc(agent, data) | ||
270 | end | 271 | end |
271 | end | 272 | end |
272 | end | 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 | + end | ||
275 | end | 282 | end |
276 | role:updateProperty({field = "hangInfo", value = hangInfo}) | 283 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
277 | 284 | ||
@@ -282,6 +289,9 @@ function _M.endBattleRpc(agent, data) | @@ -282,6 +289,9 @@ function _M.endBattleRpc(agent, data) | ||
282 | reward = reward, | 289 | reward = reward, |
283 | }) | 290 | }) |
284 | 291 | ||
292 | + local team = role:getProperty("pvpTC") | ||
293 | + role:mylog("hang_action", {desc = "hangBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = carbonId, int2 = role:getProperty("hangTBV"), cint1 = role:getHerosCamp(team.heros)}) | ||
294 | + | ||
285 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ | 295 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ |
286 | starNum = msg.starNum, | 296 | starNum = msg.starNum, |
287 | reward = reward, | 297 | reward = reward, |
@@ -324,6 +334,7 @@ function _M.roleFormatRpc(agent , data) | @@ -324,6 +334,7 @@ function _M.roleFormatRpc(agent , data) | ||
324 | hangTeam.leader = msg.leader | 334 | hangTeam.leader = msg.leader |
325 | hangTeam.supports = supports | 335 | hangTeam.supports = supports |
326 | role:saveHangTeam(hangTeam) | 336 | role:saveHangTeam(hangTeam) |
337 | + role:saveGuide(5,8) | ||
327 | SendPacket(actionCodes.Hang_roleFormatRpc, '') | 338 | SendPacket(actionCodes.Hang_roleFormatRpc, '') |
328 | return true | 339 | return true |
329 | end | 340 | end |
@@ -401,10 +412,9 @@ function _M.quickRpc(agent , data) | @@ -401,10 +412,9 @@ function _M.quickRpc(agent , data) | ||
401 | end | 412 | end |
402 | 413 | ||
403 | local doubleCoef = role.activity:isOpen("DoubleDrop") and 2 or 1 | 414 | local doubleCoef = role.activity:isOpen("DoubleDrop") and 2 or 1 |
404 | - | ||
405 | -- 特权卡获取加速获得额外道具 | 415 | -- 特权卡获取加速获得额外道具 |
406 | local coef = role.storeData:getProduceItemSpeedCoef() | 416 | local coef = role.storeData:getProduceItemSpeedCoef() |
407 | - if coef > 1 then | 417 | + if coef > 1 or doubleCoef > 1 then |
408 | for k, cnt in pairs(reward) do | 418 | for k, cnt in pairs(reward) do |
409 | reward[k] = math.floor(cnt * coef * doubleCoef) | 419 | reward[k] = math.floor(cnt * coef * doubleCoef) |
410 | end | 420 | end |
@@ -471,10 +481,17 @@ function _M.buyBonusCountRpc(agent, data) | @@ -471,10 +481,17 @@ function _M.buyBonusCountRpc(agent, data) | ||
471 | local btype = msg.type | 481 | local btype = msg.type |
472 | 482 | ||
473 | if not TimeReset["DailyBattle" .. btype] then return end | 483 | if not TimeReset["DailyBattle" .. btype] then return end |
484 | + local open, actId = role.activity:isOpen("BonusDouble") | ||
485 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
486 | + | ||
487 | + local coef = 1 | ||
488 | + if open and actData then | ||
489 | + coef= tonumber(actData.condition2) | ||
490 | + end | ||
474 | 491 | ||
475 | local bonusC = role.dailyData:getProperty("bonusC") | 492 | local bonusC = role.dailyData:getProperty("bonusC") |
476 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} | 493 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} |
477 | - local lastCount = globalCsv.bonus_daily_buy_count - bonusC[btype]["b"] | 494 | + local lastCount = globalCsv.bonus_daily_buy_count * coef - bonusC[btype]["b"] |
478 | if math.illegalNum(count, 1, lastCount) then return 1 end | 495 | if math.illegalNum(count, 1, lastCount) then return 1 end |
479 | 496 | ||
480 | if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return 2 end | 497 | if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return 2 end |
@@ -494,20 +511,32 @@ function _M.startBonusBattleRpc(agent, data) | @@ -494,20 +511,32 @@ function _M.startBonusBattleRpc(agent, data) | ||
494 | local msg = MsgPack.unpack(data) | 511 | local msg = MsgPack.unpack(data) |
495 | local id = msg.id | 512 | local id = msg.id |
496 | 513 | ||
497 | - if not role:isFuncUnlock(FuncUnlock.BonusBattle) then return end | 514 | + local open, actId = role.activity:isOpen("BonusDouble") |
515 | + | ||
516 | + if not role:isFuncUnlock(FuncUnlock.BonusBattle) then return 1 end | ||
498 | 517 | ||
499 | local bonusData = csvdb["bonus_battleCsv"][id] | 518 | local bonusData = csvdb["bonus_battleCsv"][id] |
500 | 519 | ||
501 | - if not role:isTimeResetOpen(TimeReset["DailyBattle" .. bonusData.type]) then return end | 520 | + if not open then |
521 | + if not role:isTimeResetOpen(TimeReset["DailyBattle" .. bonusData.type]) then return 2 end | ||
522 | + end | ||
502 | 523 | ||
503 | - if not bonusData then return 1 end | ||
504 | - if not role:checkHangPass(bonusData.unlock) then return 2 end | 524 | + if not bonusData then return 3 end |
525 | + if not role:checkHangPass(bonusData.unlock) then return 4 end | ||
505 | 526 | ||
506 | - if not next(role:getProperty("bTeam")) then return 3 end | 527 | + if not next(role:getProperty("bTeam")) then return 5 end |
507 | 528 | ||
508 | local bonusC = role.dailyData:getProperty("bonusC") | 529 | local bonusC = role.dailyData:getProperty("bonusC") |
509 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} | 530 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} |
510 | - if globalCsv.bonus_daily_count - bonusC[bonusData.type]["c"] <= 0 then return 4 end | 531 | + |
532 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
533 | + | ||
534 | + local coef = 1 | ||
535 | + if open and actData then | ||
536 | + coef = tonumber(actData.condition2) | ||
537 | + end | ||
538 | + | ||
539 | + if globalCsv.bonus_daily_count * coef - bonusC[bonusData.type]["c"] <= 0 then return 7 end | ||
511 | 540 | ||
512 | 541 | ||
513 | role.__bonusBattleCache = { | 542 | role.__bonusBattleCache = { |
@@ -525,6 +554,13 @@ function _M.endBonusBattleRpc(agent, data) | @@ -525,6 +554,13 @@ function _M.endBonusBattleRpc(agent, data) | ||
525 | local key = msg.key | 554 | local key = msg.key |
526 | local starNum = msg.starNum | 555 | local starNum = msg.starNum |
527 | if not role.__bonusBattleCache then return 1 end | 556 | if not role.__bonusBattleCache then return 1 end |
557 | + local open, actId = role.activity:isOpen("BonusDouble") | ||
558 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
559 | + | ||
560 | + local coef = 1 | ||
561 | + if open and actData then | ||
562 | + coef = tonumber(actData.condition2) | ||
563 | + end | ||
528 | 564 | ||
529 | if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then | 565 | if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then |
530 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) | 566 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) |
@@ -537,7 +573,7 @@ function _M.endBonusBattleRpc(agent, data) | @@ -537,7 +573,7 @@ function _M.endBonusBattleRpc(agent, data) | ||
537 | -- 胜利扣除次数 | 573 | -- 胜利扣除次数 |
538 | local bonusC = role.dailyData:getProperty("bonusC") | 574 | local bonusC = role.dailyData:getProperty("bonusC") |
539 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} | 575 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} |
540 | - if globalCsv.bonus_daily_count - bonusC[bonusData.type]["c"] <= 0 then return 3 end | 576 | + if globalCsv.bonus_daily_count * coef - bonusC[bonusData.type]["c"] <= 0 then return 3 end |
541 | bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + 1 | 577 | bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + 1 |
542 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) | 578 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) |
543 | 579 | ||
@@ -546,6 +582,9 @@ function _M.endBonusBattleRpc(agent, data) | @@ -546,6 +582,9 @@ function _M.endBonusBattleRpc(agent, data) | ||
546 | if chance[1] ~= 0 then | 582 | if chance[1] ~= 0 then |
547 | reward[chance[1]] = (reward[chance[1]] or 0) + chance[2] | 583 | reward[chance[1]] = (reward[chance[1]] or 0) + chance[2] |
548 | end | 584 | end |
585 | + for k, v in pairs(reward) do | ||
586 | + reward[k] = v * (coef > 1 and actData.condition or 1) | ||
587 | + end | ||
549 | reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = id}}) | 588 | reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = id}}) |
550 | role:checkTaskEnter("BonusPass", {id = id}) | 589 | role:checkTaskEnter("BonusPass", {id = id}) |
551 | end | 590 | end |
@@ -556,6 +595,8 @@ function _M.endBonusBattleRpc(agent, data) | @@ -556,6 +595,8 @@ function _M.endBonusBattleRpc(agent, data) | ||
556 | info = msg.info, | 595 | info = msg.info, |
557 | reward = reward, | 596 | reward = reward, |
558 | }) | 597 | }) |
598 | + role:mylog("hang_action", {desc = "bonusBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id}) | ||
599 | + | ||
559 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ | 600 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ |
560 | starNum = starNum, | 601 | starNum = starNum, |
561 | reward = reward, | 602 | reward = reward, |
@@ -578,6 +619,7 @@ function _M.hangGiftRpc(agent, data) | @@ -578,6 +619,7 @@ function _M.hangGiftRpc(agent, data) | ||
578 | local reward, change = role:award(carbonData.item_clear_special, {log = {desc = "hangGift", int1 = id}}) | 619 | local reward, change = role:award(carbonData.item_clear_special, {log = {desc = "hangGift", int1 = id}}) |
579 | 620 | ||
580 | role:changeUpdates({{type = "hangGift", field = id, value = 1}}) | 621 | role:changeUpdates({{type = "hangGift", field = id, value = 1}}) |
622 | + role:mylog("hang_action", {desc = "hangGift", int1 = id}) | ||
581 | 623 | ||
582 | SendPacket(actionCodes.Hang_hangGiftRpc, MsgPack.pack({reward = reward, change = change})) | 624 | SendPacket(actionCodes.Hang_hangGiftRpc, MsgPack.pack({reward = reward, change = change})) |
583 | return true | 625 | return true |
src/actions/HeroAction.lua
@@ -57,6 +57,7 @@ function _M.levelUpRpc( agent, data ) | @@ -57,6 +57,7 @@ function _M.levelUpRpc( agent, data ) | ||
57 | if hero:getProperty("type") == 103 then | 57 | if hero:getProperty("type") == 103 then |
58 | role:finishGuide(7) | 58 | role:finishGuide(7) |
59 | end | 59 | end |
60 | + hero:mylog({desc = "levelUp", int1 = hero:getProperty("level")}) | ||
60 | 61 | ||
61 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) | 62 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) |
62 | SendPacket(actionCodes.Hero_levelUpRpc, '') | 63 | SendPacket(actionCodes.Hero_levelUpRpc, '') |
@@ -84,6 +85,7 @@ function _M.breakRpc( agent, data ) | @@ -84,6 +85,7 @@ function _M.breakRpc( agent, data ) | ||
84 | hero_break_result = getChangeAttrJson(oldAttr, hero:getTotalAttrs()), -- 英雄突破效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} | 85 | hero_break_result = getChangeAttrJson(oldAttr, hero:getTotalAttrs()), -- 英雄突破效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} |
85 | hero_break_level = hero:getMaxLevel(), -- 英雄突破后等级上限 | 86 | hero_break_level = hero:getMaxLevel(), -- 英雄突破后等级上限 |
86 | }) | 87 | }) |
88 | + hero:mylog({desc = "break", int1 = hero:getProperty("breakL")}) | ||
87 | 89 | ||
88 | SendPacket(actionCodes.Hero_breakRpc, '') | 90 | SendPacket(actionCodes.Hero_breakRpc, '') |
89 | return true | 91 | return true |
@@ -107,18 +109,21 @@ function _M.wakeRpc(agent, data) | @@ -107,18 +109,21 @@ function _M.wakeRpc(agent, data) | ||
107 | role:costItems(cost, {log = {desc = "heroWake", int1 = msg.id, int2 = hero:getProperty("type")}}) | 109 | role:costItems(cost, {log = {desc = "heroWake", int1 = msg.id, int2 = hero:getProperty("type")}}) |
108 | 110 | ||
109 | local oldAttr = hero:getTotalAttrs() | 111 | local oldAttr = hero:getTotalAttrs() |
112 | + local oldBattleV = hero:getProperty("battleV") | ||
110 | hero:updateProperty({field = "wakeL", delta = 1}) | 113 | hero:updateProperty({field = "wakeL", delta = 1}) |
111 | 114 | ||
112 | local curLevel = hero:getProperty("wakeL") | 115 | local curLevel = hero:getProperty("wakeL") |
113 | role:checkTaskEnter("Wake", {heroType = typ, wakeL = curLevel}) | 116 | role:checkTaskEnter("Wake", {heroType = typ, wakeL = curLevel}) |
114 | - if curLevel == 4 then -- 解锁cg | 117 | + if curLevel == 3 then -- 解锁cg |
115 | role:checkTaskEnter("WakeCG", {heroType = typ}) | 118 | role:checkTaskEnter("WakeCG", {heroType = typ}) |
116 | end | 119 | end |
120 | + hero:mylog({desc = "wake", int1 = hero:getProperty("wakeL")}) | ||
117 | 121 | ||
118 | role:log("hero_rise", { | 122 | role:log("hero_rise", { |
119 | hero_id = typ, --英雄ID | 123 | hero_id = typ, --英雄ID |
120 | hero_rise_cost = cost, --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} | 124 | hero_rise_cost = cost, --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
121 | hero_rise_score = hero:getProperty("battleV"), --英雄觉醒后评分提升 | 125 | hero_rise_score = hero:getProperty("battleV"), --英雄觉醒后评分提升 |
126 | + hero_rise_scoreget = hero:getProperty("battleV") - oldBattleV, --英雄觉醒后评分提升 | ||
122 | hero_rise_result = getChangeAttrJson(oldAttr, hero:getTotalAttrs()), --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} | 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,10 +200,12 @@ function _M.talentRpc(agent, data) | ||
195 | 200 | ||
196 | role:log("hero_talent", { | 201 | role:log("hero_talent", { |
197 | hero_id = hero:getProperty("type"), --英雄ID | 202 | hero_id = hero:getProperty("type"), --英雄ID |
203 | + hero_talent_id = index, --天赋ID | ||
198 | hero_talent_cost = cost, -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} | 204 | hero_talent_cost = cost, -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
199 | hero_talent_levelbef = oldSkillLv, -- 英雄技能升级前等级 | 205 | hero_talent_levelbef = oldSkillLv, -- 英雄技能升级前等级 |
200 | hero_talent_level = hero:getSkillLevel(1), -- 英雄技能升级后等级 | 206 | hero_talent_level = hero:getSkillLevel(1), -- 英雄技能升级后等级 |
201 | }) | 207 | }) |
208 | + hero:mylog({desc = "talent", int1 = index, int2 = talent:getv(index, 0)}) | ||
202 | 209 | ||
203 | SendPacket(actionCodes.Hero_talentRpc, '') | 210 | SendPacket(actionCodes.Hero_talentRpc, '') |
204 | return true | 211 | return true |
@@ -577,14 +584,16 @@ function _M.referRunesRpc(agent, data) | @@ -577,14 +584,16 @@ function _M.referRunesRpc(agent, data) | ||
577 | local attrChange = getChangeAttrJson(oldAttr, hero:getTotalAttrs()) | 584 | local attrChange = getChangeAttrJson(oldAttr, hero:getTotalAttrs()) |
578 | for runeId, typ in pairs(wear) do | 585 | for runeId, typ in pairs(wear) do |
579 | local ownRune = role.runeBag[runeId] | 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 | end | 597 | end |
589 | 598 | ||
590 | SendPacket(actionCodes.Hero_referRunesRpc, "") | 599 | SendPacket(actionCodes.Hero_referRunesRpc, "") |
@@ -691,6 +700,7 @@ function _M.getResetRewardRpc(agent, data) | @@ -691,6 +700,7 @@ function _M.getResetRewardRpc(agent, data) | ||
691 | equip = "", | 700 | equip = "", |
692 | rune = "", | 701 | rune = "", |
693 | }) | 702 | }) |
703 | + hero:mylog({desc = "resetHero"}) | ||
694 | 704 | ||
695 | for itemId, count in pairs(reward) do | 705 | for itemId, count in pairs(reward) do |
696 | reward[itemId] = math.floor(count * globalCsv.unit_back_discount) | 706 | reward[itemId] = math.floor(count * globalCsv.unit_back_discount) |
@@ -711,7 +721,7 @@ function _M.drawHeroRpc(agent, data) | @@ -711,7 +721,7 @@ function _M.drawHeroRpc(agent, data) | ||
711 | local role = agent.role | 721 | local role = agent.role |
712 | local msg = MsgPack.unpack(data) | 722 | local msg = MsgPack.unpack(data) |
713 | 723 | ||
714 | - if not role:isFuncUnlock(FuncUnlock.GetHero) then return end | 724 | + if not role:isFuncUnlock(FuncUnlock.GetHero) then return 1 end |
715 | local btype = msg.pool -- 1 2 3 卡池类型 | 725 | local btype = msg.pool -- 1 2 3 卡池类型 |
716 | local subType = msg.subType or 1-- 定向卡池需要传 子类型 | 726 | local subType = msg.subType or 1-- 定向卡池需要传 子类型 |
717 | local drawType = msg.type -- 1 单抽 2 十连 | 727 | local drawType = msg.type -- 1 单抽 2 十连 |
@@ -720,10 +730,10 @@ function _M.drawHeroRpc(agent, data) | @@ -720,10 +730,10 @@ function _M.drawHeroRpc(agent, data) | ||
720 | end | 730 | end |
721 | 731 | ||
722 | local buildTypeData = csvdb["build_typeCsv"][btype] | 732 | local buildTypeData = csvdb["build_typeCsv"][btype] |
723 | - if not buildTypeData then return 1 end | 733 | + if not buildTypeData then return 2 end |
724 | 734 | ||
725 | local drawCount = {1, 10} -- 抽取次数 | 735 | local drawCount = {1, 10} -- 抽取次数 |
726 | - if not drawCount[drawType] then return 2 end | 736 | + if not drawCount[drawType] then return 3 end |
727 | 737 | ||
728 | local draw_floor_back_counts = globalCsv.draw_floor_back_counts[btype] | 738 | local draw_floor_back_counts = globalCsv.draw_floor_back_counts[btype] |
729 | local floorHeroCount = role:getProperty("floorHero")[btype] or 0 | 739 | local floorHeroCount = role:getProperty("floorHero")[btype] or 0 |
@@ -747,20 +757,20 @@ function _M.drawHeroRpc(agent, data) | @@ -747,20 +757,20 @@ function _M.drawHeroRpc(agent, data) | ||
747 | end | 757 | end |
748 | end | 758 | end |
749 | if lastCount > 0 then -- 钱不够 | 759 | if lastCount > 0 then -- 钱不够 |
750 | - return 3 | 760 | + return 4 |
751 | end | 761 | end |
752 | 762 | ||
753 | -- 抽取的池子 | 763 | -- 抽取的池子 |
754 | local poolMap = buildTypeData["pool"]:toNumMap() | 764 | local poolMap = buildTypeData["pool"]:toNumMap() |
755 | local poolId = poolMap[subType] | 765 | local poolId = poolMap[subType] |
756 | - if not poolId then return end | 766 | + if not poolId then return 5 end |
757 | 767 | ||
758 | --判断定向卡池是否开启 | 768 | --判断定向卡池是否开启 |
759 | if btype == 1 then | 769 | if btype == 1 then |
760 | if not role:isTimeResetOpen(TimeReset["DrawType" .. subType]) then | 770 | if not role:isTimeResetOpen(TimeReset["DrawType" .. subType]) then |
761 | local unlockPool = role.dailyData:getProperty("unlockPool") | 771 | local unlockPool = role.dailyData:getProperty("unlockPool") |
762 | if not unlockPool[subType] then | 772 | if not unlockPool[subType] then |
763 | - return 1 | 773 | + return 6 |
764 | end | 774 | end |
765 | end | 775 | end |
766 | end | 776 | end |
@@ -772,12 +782,12 @@ function _M.drawHeroRpc(agent, data) | @@ -772,12 +782,12 @@ function _M.drawHeroRpc(agent, data) | ||
772 | end | 782 | end |
773 | 783 | ||
774 | local unitPool = csvdb["build_unitCsv"][poolId] | 784 | local unitPool = csvdb["build_unitCsv"][poolId] |
775 | - if not unitPool then return 4 end | 785 | + if not unitPool then return 7 end |
776 | 786 | ||
777 | -- 开始抽 | 787 | -- 开始抽 |
778 | local resultPool = {} | 788 | local resultPool = {} |
779 | local function fillDrawPool(isFloorBack) | 789 | local function fillDrawPool(isFloorBack) |
780 | - local condition = {"rare", "camp"} | 790 | + local condition = {"rare"} |
781 | local values = {} | 791 | local values = {} |
782 | 792 | ||
783 | 793 | ||
@@ -830,6 +840,7 @@ function _M.drawHeroRpc(agent, data) | @@ -830,6 +840,7 @@ function _M.drawHeroRpc(agent, data) | ||
830 | 840 | ||
831 | local ssrCount = 0 | 841 | local ssrCount = 0 |
832 | local reward = {} | 842 | local reward = {} |
843 | + local logReward = {} | ||
833 | for i = 1, drawCount[drawType] do | 844 | for i = 1, drawCount[drawType] do |
834 | floorHeroCount = floorHeroCount + 1 | 845 | floorHeroCount = floorHeroCount + 1 |
835 | local isFloorBack = draw_floor_back_counts and floorHeroCount >= draw_floor_back_counts | 846 | local isFloorBack = draw_floor_back_counts and floorHeroCount >= draw_floor_back_counts |
@@ -837,7 +848,7 @@ function _M.drawHeroRpc(agent, data) | @@ -837,7 +848,7 @@ function _M.drawHeroRpc(agent, data) | ||
837 | fillDrawPool(isFloorBack) | 848 | fillDrawPool(isFloorBack) |
838 | if not next(resultPool) then | 849 | if not next(resultPool) then |
839 | skynet.error("random pool error, poolId:" .. poolId) | 850 | skynet.error("random pool error, poolId:" .. poolId) |
840 | - return | 851 | + return 8 |
841 | end | 852 | end |
842 | 853 | ||
843 | local itemId = math.randWeight(resultPool, 1) | 854 | local itemId = math.randWeight(resultPool, 1) |
@@ -860,9 +871,11 @@ function _M.drawHeroRpc(agent, data) | @@ -860,9 +871,11 @@ function _M.drawHeroRpc(agent, data) | ||
860 | local heroData = csvdb["unitCsv"][fragId] | 871 | local heroData = csvdb["unitCsv"][fragId] |
861 | local count = globalCsv.draw_unit_tofragment[heroData.rare] | 872 | local count = globalCsv.draw_unit_tofragment[heroData.rare] |
862 | role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) | 873 | role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) |
874 | + logReward[fragId] = (logReward[fragId] or 0) + count | ||
863 | table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) | 875 | table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) |
864 | else | 876 | else |
865 | role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) | 877 | role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) |
878 | + logReward[itemId] = (logReward[itemId] or 0) + 1 | ||
866 | table.insert(reward, {id = itemId, count = 1}) | 879 | table.insert(reward, {id = itemId, count = 1}) |
867 | end | 880 | end |
868 | end | 881 | end |
@@ -873,27 +886,50 @@ function _M.drawHeroRpc(agent, data) | @@ -873,27 +886,50 @@ function _M.drawHeroRpc(agent, data) | ||
873 | role:setProperty("floorHero", floorHero) | 886 | role:setProperty("floorHero", floorHero) |
874 | end | 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 | role:checkTaskEnter("DrawHero", {pool = btype, count = drawCount[drawType]}) | 889 | role:checkTaskEnter("DrawHero", {pool = btype, count = drawCount[drawType]}) |
883 | if ssrCount > 0 then | 890 | if ssrCount > 0 then |
884 | role:checkTaskEnter("DrawSSR", {count = ssrCount}) | 891 | role:checkTaskEnter("DrawSSR", {count = ssrCount}) |
885 | end | 892 | end |
886 | role:finishGuide(11) | 893 | role:finishGuide(11) |
887 | - | 894 | + |
888 | role:log("gacha", { | 895 | role:log("gacha", { |
889 | gacha_id = poolId, -- 卡池ID | 896 | gacha_id = poolId, -- 卡池ID |
890 | gacha_type = btype, -- 卡池类型 | 897 | gacha_type = btype, -- 卡池类型 |
891 | gacha_up = 0, -- 卡池UP角色 | 898 | gacha_up = 0, -- 卡池UP角色 |
892 | gacha_times = drawCount[drawType], -- 抽卡次数 | 899 | gacha_times = drawCount[drawType], -- 抽卡次数 |
893 | - gacha_reward = reward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | 900 | + gacha_reward = logReward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
894 | currency = cost, -- 购买道具消耗的货币 | 901 | currency = cost, -- 购买道具消耗的货币 |
902 | + gacha_cnt = floorHeroCount, | ||
895 | }) | 903 | }) |
896 | SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 | 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 | return true | 933 | return true |
898 | end | 934 | end |
899 | 935 | ||
@@ -922,6 +958,7 @@ function _M.repayHeroRpc(agent, data) | @@ -922,6 +958,7 @@ function _M.repayHeroRpc(agent, data) | ||
922 | role:award({[id] = 1}, {log = {desc = "heroRepay"}}) | 958 | role:award({[id] = 1}, {log = {desc = "heroRepay"}}) |
923 | reward = {id = id, count = 1} | 959 | reward = {id = id, count = 1} |
924 | end | 960 | end |
961 | + role:mylog("hero_action", {desc = "heroRepay", int1=result}) | ||
925 | SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward})) | 962 | SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward})) |
926 | return true | 963 | return true |
927 | end | 964 | end |
@@ -953,7 +990,7 @@ function _M.unlockPoolRpc(agent, data) | @@ -953,7 +990,7 @@ function _M.unlockPoolRpc(agent, data) | ||
953 | role.dailyData:updateProperty({field="unlockPool", value = unlockPool}) | 990 | role.dailyData:updateProperty({field="unlockPool", value = unlockPool}) |
954 | role.dailyData:updateProperty({field="curPool", value = type}) | 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 | SendPacket(actionCodes.Hero_unlockPoolRpc, MsgPack.pack({})) | 994 | SendPacket(actionCodes.Hero_unlockPoolRpc, MsgPack.pack({})) |
958 | return true | 995 | return true |
959 | end | 996 | end |
src/actions/PvpAction.lua
@@ -296,6 +296,9 @@ function _M.startBattleRpc(agent, data) | @@ -296,6 +296,9 @@ function _M.startBattleRpc(agent, data) | ||
296 | _pvpStartBattleCacheC = {idx = idx, key = key, revenge = revenge} | 296 | _pvpStartBattleCacheC = {idx = idx, key = key, revenge = revenge} |
297 | 297 | ||
298 | role:checkTaskEnter("PvpBattle") | 298 | role:checkTaskEnter("PvpBattle") |
299 | + | ||
300 | + | ||
301 | + role:mylog("pvp_action", {desc = "startBattle", short1 = 1, int1 = revenge and 1 or 0}) | ||
299 | end | 302 | end |
300 | 303 | ||
301 | SendPacket(actionCodes.Pvp_startBattleRpc, MsgPack.pack({matchInfo = matchInfo, key = key, result = result, wait = wait})) | 304 | SendPacket(actionCodes.Pvp_startBattleRpc, MsgPack.pack({matchInfo = matchInfo, key = key, result = result, wait = wait})) |
@@ -393,6 +396,7 @@ function _M.endBattleRpc(agent, data) | @@ -393,6 +396,7 @@ function _M.endBattleRpc(agent, data) | ||
393 | reward = reward, | 396 | reward = reward, |
394 | rank = myRank, | 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 | _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 | 401 | _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 |
398 | _pvpRecordInfoCacheC = {} -- 记录刷新了 | 402 | _pvpRecordInfoCacheC = {} -- 记录刷新了 |
@@ -525,6 +529,8 @@ function _M.startBattleHRpc(agent, data) | @@ -525,6 +529,8 @@ function _M.startBattleHRpc(agent, data) | ||
525 | 529 | ||
526 | role:checkTaskEnter("PvpBattle") | 530 | role:checkTaskEnter("PvpBattle") |
527 | 531 | ||
532 | + role:mylog("pvp_action", {desc = "startBattle", short1 = 2, int1 = revenge and 1 or 0}) | ||
533 | + | ||
528 | end | 534 | end |
529 | 535 | ||
530 | SendPacket(actionCodes.Pvp_startBattleHRpc, MsgPack.pack({ | 536 | SendPacket(actionCodes.Pvp_startBattleHRpc, MsgPack.pack({ |
@@ -707,7 +713,8 @@ function _M.endBattleHRpc(agent, data) | @@ -707,7 +713,8 @@ function _M.endBattleHRpc(agent, data) | ||
707 | if isWin then | 713 | if isWin then |
708 | role:checkTaskEnter("PvpWin", {score = myScore}) | 714 | role:checkTaskEnter("PvpWin", {score = myScore}) |
709 | end | 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 | SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ | 718 | SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ |
712 | reward = reward, | 719 | reward = reward, |
713 | change = change, | 720 | change = change, |
@@ -855,6 +862,7 @@ function _M.highDivisionGiftRpc(agent, data) | @@ -855,6 +862,7 @@ function _M.highDivisionGiftRpc(agent, data) | ||
855 | }) | 862 | }) |
856 | 863 | ||
857 | local reward, change = role:award(newReward, {log = {desc = "pvpDivisionH"}}) | 864 | local reward, change = role:award(newReward, {log = {desc = "pvpDivisionH"}}) |
865 | + role:mylog("pvp_action", {desc = "pvpDivisionH"}) | ||
858 | 866 | ||
859 | SendPacket(actionCodes.Pvp_highDivisionGiftRpc, MsgPack.pack(role:packReward(reward, change))) | 867 | SendPacket(actionCodes.Pvp_highDivisionGiftRpc, MsgPack.pack(role:packReward(reward, change))) |
860 | return true | 868 | return true |
@@ -889,6 +897,8 @@ function _M.shopBuyRpc(agent, data) | @@ -889,6 +897,8 @@ function _M.shopBuyRpc(agent, data) | ||
889 | end | 897 | end |
890 | local reward, change = role:award(gift, {log = {desc = "pvpShop", int1 = id, int2 = count}}) | 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 | SendPacket(actionCodes.Pvp_shopBuyRpc, MsgPack.pack(role:packReward(reward, change))) | 902 | SendPacket(actionCodes.Pvp_shopBuyRpc, MsgPack.pack(role:packReward(reward, change))) |
893 | return true | 903 | return true |
894 | end | 904 | end |
@@ -980,6 +990,7 @@ function _M.crossBetRpc(agent, data) | @@ -980,6 +990,7 @@ function _M.crossBetRpc(agent, data) | ||
980 | local result, code = role:setCrossServerPvpBet(msg.idx) | 990 | local result, code = role:setCrossServerPvpBet(msg.idx) |
981 | if not result then return 10 + code end | 991 | if not result then return 10 + code end |
982 | 992 | ||
993 | + role:mylog("pvp_action", {desc = "crossBet"}) | ||
983 | SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result)) | 994 | SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result)) |
984 | return true | 995 | return true |
985 | end | 996 | end |
src/actions/RoleAction.lua
@@ -160,6 +160,7 @@ function _M.loginRpc( agent, data ) | @@ -160,6 +160,7 @@ function _M.loginRpc( agent, data ) | ||
160 | local resetMode = role:updateTimeReset(now) | 160 | local resetMode = role:updateTimeReset(now) |
161 | if not resetMode or not resetMode["CrossDay"] then -- 没有跨天 | 161 | if not resetMode or not resetMode["CrossDay"] then -- 没有跨天 |
162 | role.activity:checkActivityStatus(now, false, false) | 162 | role.activity:checkActivityStatus(now, false, false) |
163 | + role:log("onLogin") | ||
163 | end | 164 | end |
164 | 165 | ||
165 | redisproxy:zadd(FRIEND_RECOMMEND, now, roleId) | 166 | redisproxy:zadd(FRIEND_RECOMMEND, now, roleId) |
@@ -173,7 +174,7 @@ function _M.loginRpc( agent, data ) | @@ -173,7 +174,7 @@ function _M.loginRpc( agent, data ) | ||
173 | response.role = role:data() | 174 | response.role = role:data() |
174 | response.result = "SUCCESS" | 175 | response.result = "SUCCESS" |
175 | response.serverTime = now | 176 | response.serverTime = now |
176 | - response.openTime = getServerOpenTs() | 177 | + --response.openTime = getServerOpenTs() |
177 | 178 | ||
178 | local modules = {} | 179 | local modules = {} |
179 | 180 | ||
@@ -291,8 +292,10 @@ function _M.loginRpc( agent, data ) | @@ -291,8 +292,10 @@ function _M.loginRpc( agent, data ) | ||
291 | role:savePvpHTeam() | 292 | role:savePvpHTeam() |
292 | 293 | ||
293 | local hangPass = role:getProperty("hangPass") | 294 | local hangPass = role:getProperty("hangPass") |
294 | - role:log("onLogin") | ||
295 | - | 295 | + role:mylog("login", {key1 = agent.ip:toArray(false, ":")[1], int1 = hangPass[1] or 0}) |
296 | + if msg.newdevice then | ||
297 | + role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) | ||
298 | + end | ||
296 | return true | 299 | return true |
297 | end | 300 | end |
298 | 301 | ||
@@ -359,7 +362,10 @@ function _M.createRpc(agent, data) | @@ -359,7 +362,10 @@ function _M.createRpc(agent, data) | ||
359 | newRole:log("onCreateAccount") | 362 | newRole:log("onCreateAccount") |
360 | end | 363 | end |
361 | newRole:log("onCreateRole") | 364 | newRole:log("onCreateRole") |
362 | - | 365 | + newRole:mylog("create", {key1 = agent.ip:toArray(false, ":")[1]}) |
366 | + if msg.newdevice then | ||
367 | + newRole:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) | ||
368 | + end | ||
363 | 369 | ||
364 | SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response)) | 370 | SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response)) |
365 | return true | 371 | return true |
@@ -549,17 +555,17 @@ function _M.openTimeBoxRpc(agent, data) | @@ -549,17 +555,17 @@ function _M.openTimeBoxRpc(agent, data) | ||
549 | local quick = msg.quick | 555 | local quick = msg.quick |
550 | if not boxL[slot] then return end | 556 | if not boxL[slot] then return end |
551 | local costKey = 0 | 557 | local costKey = 0 |
552 | - local costTime = skynet.timex() - boxL[slot].time | ||
553 | if boxL[slot].time > skynet.timex() then -- 没开完 | 558 | if boxL[slot].time > skynet.timex() then -- 没开完 |
554 | if not quick then return end | 559 | if not quick then return end |
555 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") | 560 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") |
556 | - local costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] | 561 | + costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] |
557 | if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end | 562 | if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end |
558 | role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}}) | 563 | role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}}) |
559 | end | 564 | end |
560 | local boxId = boxL[slot].id | 565 | local boxId = boxL[slot].id |
561 | local itemData = csvdb["itemCsv"][boxId] | 566 | local itemData = csvdb["itemCsv"][boxId] |
562 | local randomData = csvdb["item_randomCsv"][itemData.id] | 567 | local randomData = csvdb["item_randomCsv"][itemData.id] |
568 | + local costTime = skynet.timex() - (boxL[slot].time - randomData.openTime) | ||
563 | -- 随机奖励 | 569 | -- 随机奖励 |
564 | reward = {} | 570 | reward = {} |
565 | for i = 1, 10 do | 571 | for i = 1, 10 do |
@@ -584,7 +590,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -584,7 +590,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
584 | 590 | ||
585 | boxL[slot] = nil | 591 | boxL[slot] = nil |
586 | reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = boxId}}) | 592 | reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = boxId}}) |
587 | - role:checkTaskEnter("OpenBox", {id = boxId, count=1}) | 593 | + role:checkTaskEnter("OpenBox", {id = boxId, count=1, quality=itemData.quality}) |
588 | 594 | ||
589 | role:log("carriage_dismantle", { | 595 | role:log("carriage_dismantle", { |
590 | item_id = boxId, -- 道具id | 596 | item_id = boxId, -- 道具id |
@@ -673,7 +679,7 @@ function _M.storyBookRewardRpc(agent, data) | @@ -673,7 +679,7 @@ function _M.storyBookRewardRpc(agent, data) | ||
673 | if status == -1 then return end | 679 | if status == -1 then return end |
674 | 680 | ||
675 | if not status or status ~= 1 then | 681 | if not status or status ~= 1 then |
676 | - if storyBookData.unlockType == 1 and role:getProperty("hangInfo").carbonId == tonumber(storyBookData.unlockData) then -- 挂机剧情正在挂机也可以领奖 | 682 | + if storyBookData.unlockType == 1 and (role:getProperty("hangInfo").carbonId == tonumber(storyBookData.unlockData) or storyId == 1 or storyId == 2) then -- 挂机剧情正在挂机也可以领奖 |
677 | else | 683 | else |
678 | return | 684 | return |
679 | end | 685 | end |
@@ -684,11 +690,11 @@ function _M.storyBookRewardRpc(agent, data) | @@ -684,11 +690,11 @@ function _M.storyBookRewardRpc(agent, data) | ||
684 | role:changeUpdates({{ type = "storyB", field = storyId, value = storyStatus[storyId] }}) | 690 | role:changeUpdates({{ type = "storyB", field = storyId, value = storyStatus[storyId] }}) |
685 | local reward, change = role:award(storyBookData.gift, {log = {desc = "storybookReward", int1 = storyId}}) | 691 | local reward, change = role:award(storyBookData.gift, {log = {desc = "storybookReward", int1 = storyId}}) |
686 | 692 | ||
687 | - role:log("carriage_decals", { | 693 | + role:log("carriage_video", { |
688 | carriage_video_type = storyBookData.type, --放映室类型,剧情CG:0, 角色CG:1, 主线剧情:2, 角色剧情:3, 活动剧情:4, 图鉴:5 | 694 | carriage_video_type = storyBookData.type, --放映室类型,剧情CG:0, 角色CG:1, 主线剧情:2, 角色剧情:3, 活动剧情:4, 图鉴:5 |
689 | carriage_video_id = storyId, --放映室片段ID | 695 | carriage_video_id = storyId, --放映室片段ID |
690 | - carriage_video_coinid = reward[ItemId.Gold] and ItemId.Gold or 0, --放映奖励货币类型,无奖励则填写0 | ||
691 | - carriage_video_coinnum = reward[ItemId.Gold] or 0, --放映奖励货币数量,无奖励则填写0 | 696 | + carriage_video_coinid = reward[ItemId.Diamond] and ItemId.Diamond or 0, --放映奖励货币类型,无奖励则填写0 |
697 | + carriage_video_coinnum = reward[ItemId.Diamond] or 0, --放映奖励货币数量,无奖励则填写0 | ||
692 | carriage_video_item = reward, --放映奖励其他物品数量,json格式记录,{'itemid1':10,'itemid2':5,…………..},无奖励则填写0 | 698 | carriage_video_item = reward, --放映奖励其他物品数量,json格式记录,{'itemid1':10,'itemid2':5,…………..},无奖励则填写0 |
693 | }) | 699 | }) |
694 | 700 | ||
@@ -977,7 +983,7 @@ function _M.chatRpc(agent, data) | @@ -977,7 +983,7 @@ function _M.chatRpc(agent, data) | ||
977 | role:log("communication", { | 983 | role:log("communication", { |
978 | publish_type = cmd, --发言类型,1,世界 2私聊 | 984 | publish_type = cmd, --发言类型,1,世界 2私聊 |
979 | publish_status = 0, --发送状态,发送成功:0,发送失败:1,被屏蔽:2,其他:3 | 985 | publish_status = 0, --发送状态,发送成功:0,发送失败:1,被屏蔽:2,其他:3 |
980 | - publish_receive_roleid = msg.roleId, --接收者角色ID | 986 | + publish_receive_roleid = msg.roleId or 0, --接收者角色ID |
981 | publish_text = content, --发言内容 | 987 | publish_text = content, --发言内容 |
982 | }) | 988 | }) |
983 | SendPacket(actionCodes.Role_chatRpc, MsgPack.pack({result = result, waitTime = waitTime})) | 989 | SendPacket(actionCodes.Role_chatRpc, MsgPack.pack({result = result, waitTime = waitTime})) |
@@ -1007,7 +1013,7 @@ function _M.changeSettingRpc(agent, data) | @@ -1007,7 +1013,7 @@ function _M.changeSettingRpc(agent, data) | ||
1007 | local setting = role:getProperty("setting") | 1013 | local setting = role:getProperty("setting") |
1008 | setting[id] = status | 1014 | setting[id] = status |
1009 | role:updateProperty({field = "setting", value = setting}) | 1015 | role:updateProperty({field = "setting", value = setting}) |
1010 | - | 1016 | + role:mylog("role_action", {desc = "changeSetting", int1 = id, int2 = status}) |
1011 | SendPacket(actionCodes.Role_changeSettingRpc, '') | 1017 | SendPacket(actionCodes.Role_changeSettingRpc, '') |
1012 | return true | 1018 | return true |
1013 | end | 1019 | end |
@@ -1045,6 +1051,7 @@ function _M.drawCodeRpc(agent, data) | @@ -1045,6 +1051,7 @@ function _M.drawCodeRpc(agent, data) | ||
1045 | gift_name = "", -- 礼包名称 | 1051 | gift_name = "", -- 礼包名称 |
1046 | gift_reason = 0, -- 礼包发放原因,见发放原因枚举表 | 1052 | gift_reason = 0, -- 礼包发放原因,见发放原因枚举表 |
1047 | }) | 1053 | }) |
1054 | + role:mylog("role_action", {desc = "drawCode", int1 = giftId, key1 = code}) | ||
1048 | SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ | 1055 | SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ |
1049 | result = ret, | 1056 | result = ret, |
1050 | reward = reward, | 1057 | reward = reward, |
@@ -1119,6 +1126,7 @@ function _M.guideRpc(agent, data) | @@ -1119,6 +1126,7 @@ function _M.guideRpc(agent, data) | ||
1119 | if msg.funcType then | 1126 | if msg.funcType then |
1120 | funcGuide = funcGuide:setv(msg.funcType, 1) | 1127 | funcGuide = funcGuide:setv(msg.funcType, 1) |
1121 | role:log("onGuidePoint", {guild_type = 2, guild_id = msg.funcType, guild_point = 0, guild_pass = 0}) | 1128 | role:log("onGuidePoint", {guild_type = 2, guild_id = msg.funcType, guild_point = 0, guild_pass = 0}) |
1129 | + role:mylog("guide", {desc = "guide_weak", int1 = msg.funcType}) | ||
1122 | end | 1130 | end |
1123 | role:updateProperty({field = "funcGuide", value = funcGuide}) | 1131 | role:updateProperty({field = "funcGuide", value = funcGuide}) |
1124 | elseif cmdType == 3 then | 1132 | elseif cmdType == 3 then |
@@ -1128,6 +1136,7 @@ function _M.guideRpc(agent, data) | @@ -1128,6 +1136,7 @@ function _M.guideRpc(agent, data) | ||
1128 | funcGuide = funcGuide:setv(msg.funcType, 1) | 1136 | funcGuide = funcGuide:setv(msg.funcType, 1) |
1129 | role:updateProperty({field = "funcGuide", value = funcGuide}) | 1137 | role:updateProperty({field = "funcGuide", value = funcGuide}) |
1130 | role:log("onGuidePoint", {guild_type = 1, guild_id = msg.funcType, guild_point = 0, guild_pass = 0}) | 1138 | role:log("onGuidePoint", {guild_type = 1, guild_id = msg.funcType, guild_point = 0, guild_pass = 0}) |
1139 | + role:mylog("guide", {desc = "guide_sys", int1 = msg.funcType}) | ||
1131 | end | 1140 | end |
1132 | elseif cmdType == 4 then | 1141 | elseif cmdType == 4 then |
1133 | -- 弹出一个tips(进入功能界面也许要自动弹说明,value要区分1、2) | 1142 | -- 弹出一个tips(进入功能界面也许要自动弹说明,value要区分1、2) |
@@ -1135,6 +1144,7 @@ function _M.guideRpc(agent, data) | @@ -1135,6 +1144,7 @@ function _M.guideRpc(agent, data) | ||
1135 | local value = msg.value or 1 | 1144 | local value = msg.value or 1 |
1136 | for _, funcIdx in pairs(msg.funcType:toArray(true,"=")) do | 1145 | for _, funcIdx in pairs(msg.funcType:toArray(true,"=")) do |
1137 | role:log("onGuidePoint", {guild_type = 3, guild_id = funcIdx, guild_point = 0, guild_pass = 0}) | 1146 | role:log("onGuidePoint", {guild_type = 3, guild_id = funcIdx, guild_point = 0, guild_pass = 0}) |
1147 | + role:mylog("guide", {desc = "guide_tips", int1 = funcIdx}) | ||
1138 | funcGuide = funcGuide:setv(funcIdx, value) | 1148 | funcGuide = funcGuide:setv(funcIdx, value) |
1139 | end | 1149 | end |
1140 | role:updateProperty({field = "funcGuide", value = funcGuide}) | 1150 | role:updateProperty({field = "funcGuide", value = funcGuide}) |
@@ -1207,4 +1217,30 @@ function _M.updateFeedbackInfoRpc(agent, data) | @@ -1207,4 +1217,30 @@ function _M.updateFeedbackInfoRpc(agent, data) | ||
1207 | return true | 1217 | return true |
1208 | end | 1218 | end |
1209 | 1219 | ||
1220 | +function _M.useSelectItemRpc(agent, data) | ||
1221 | + local role = agent.role | ||
1222 | + local msg = MsgPack.unpack(data) | ||
1223 | + local itemId = msg.itemId | ||
1224 | + local subId = msg.subId | ||
1225 | + local count = msg.count | ||
1226 | + if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end | ||
1227 | + local itemData = csvdb["itemCsv"][itemId] | ||
1228 | + if itemData.type ~= ItemType.SelectItemBox then return end | ||
1229 | + local itemMap = itemData.use_effect:toNumMap() | ||
1230 | + local reward, change = {} | ||
1231 | + for k, v in pairs(itemMap) do | ||
1232 | + if k == subId then | ||
1233 | + reward[k] = v * count | ||
1234 | + break | ||
1235 | + end | ||
1236 | + end | ||
1237 | + | ||
1238 | + if next(reward) then | ||
1239 | + reward, change = role:award(reward, {log = {desc = "openItem", int1 = itemId, int2 = count}}) | ||
1240 | + role:costItems({[itemId] = count}, {log = {desc = "openItem"}}) | ||
1241 | + end | ||
1242 | + SendPacket(actionCodes.Role_useSelectItemRpc, MsgPack.pack(role:packReward(reward, change))) | ||
1243 | + return true | ||
1244 | +end | ||
1245 | + | ||
1210 | return _M | 1246 | return _M |
1211 | \ No newline at end of file | 1247 | \ No newline at end of file |
src/actions/StoreAction.lua
@@ -177,7 +177,7 @@ function _M.purchaseOrderResult(agent, data) | @@ -177,7 +177,7 @@ function _M.purchaseOrderResult(agent, data) | ||
177 | item_level = 1, -- 购买的道具等级 | 177 | item_level = 1, -- 购买的道具等级 |
178 | order_cost = dataSet.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' | 178 | order_cost = dataSet.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' |
179 | order_currency = "CNY", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 | 179 | order_currency = "CNY", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 |
180 | - order_type = self.getProperty("rmbC") > 0 and 0 or 1, -- 订单类型,首充记录为1,否则为0 | 180 | + order_type = role:getProperty("rmbC") > 0 and 0 or 1, -- 订单类型,首充记录为1,否则为0 |
181 | order_id = msg.platformOrder, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' | 181 | order_id = msg.platformOrder, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' |
182 | }) | 182 | }) |
183 | 183 | ||
@@ -205,7 +205,7 @@ function _M.shopBuyRpc(agent , data) | @@ -205,7 +205,7 @@ function _M.shopBuyRpc(agent , data) | ||
205 | if not dataSet then return end | 205 | if not dataSet then return end |
206 | 206 | ||
207 | if dataSet.unlock ~= "" then | 207 | if dataSet.unlock ~= "" then |
208 | - if not role:checkHangPass(tonumber(config.unlock)) then | 208 | + if not role:checkHangPass(tonumber(dataSet.unlock)) then |
209 | skynet.error(string.format("shopBuyRpc,user do not finish hang pass, user_id:%d", role:getProperty("id"))) | 209 | skynet.error(string.format("shopBuyRpc,user do not finish hang pass, user_id:%d", role:getProperty("id"))) |
210 | return 1 | 210 | return 1 |
211 | end | 211 | end |
@@ -260,6 +260,7 @@ function _M.shopBuyRpc(agent , data) | @@ -260,6 +260,7 @@ function _M.shopBuyRpc(agent , data) | ||
260 | shop_purchase_current = costCount or 0, -- 购买道具消耗的货币数量 | 260 | shop_purchase_current = costCount or 0, -- 购买道具消耗的货币数量 |
261 | shop_id = dataSet.shop, -- 商店ID | 261 | shop_id = dataSet.shop, -- 商店ID |
262 | }) | 262 | }) |
263 | + role:mylog("role_action", {desc = desc, int1 = id, int2 = count}) | ||
263 | SendPacket(actionCodes.Store_shopBuyRpc, MsgPack.pack({reward = reward})) | 264 | SendPacket(actionCodes.Store_shopBuyRpc, MsgPack.pack({reward = reward})) |
264 | return true | 265 | return true |
265 | end | 266 | end |
@@ -384,14 +385,14 @@ function _M.getExploreCommandRewardRpc(agent, data) | @@ -384,14 +385,14 @@ function _M.getExploreCommandRewardRpc(agent, data) | ||
384 | local id = msg.id -- 探索id | 385 | local id = msg.id -- 探索id |
385 | local subId = msg.subId -- 领取的阶段id | 386 | local subId = msg.subId -- 领取的阶段id |
386 | 387 | ||
387 | - local tab_name = "reward_battlepass_" .. id .. "Csv" | ||
388 | - local config = csvdb[tab_name][id] | 388 | + local tab_name = "reward_levelpass" .. id .. "Csv" |
389 | + local config = csvdb[tab_name][subId] | ||
389 | if not config then return end | 390 | if not config then return end |
390 | 391 | ||
391 | - local bpInfo = role.storeData:getProperty("bpInfo") or {} | 392 | + local bpInfo = role.storeData:getProperty("bpInfo") or {} |
392 | local info = bpInfo[id] or {} | 393 | local info = bpInfo[id] or {} |
393 | local flag = info["flag"] or 0 | 394 | local flag = info["flag"] or 0 |
394 | - if flag == 0 then return 1 end | 395 | + --if flag == 0 then return 1 end |
395 | 396 | ||
396 | local freeRecord = info["fr"] or "" | 397 | local freeRecord = info["fr"] or "" |
397 | local buyRecord = info["br"] or "" | 398 | local buyRecord = info["br"] or "" |
@@ -408,7 +409,7 @@ function _M.getExploreCommandRewardRpc(agent, data) | @@ -408,7 +409,7 @@ function _M.getExploreCommandRewardRpc(agent, data) | ||
408 | return 3 | 409 | return 3 |
409 | end | 410 | end |
410 | 411 | ||
411 | - if not role:checkHangPass(config.carbonId) then | 412 | + if not role:checkHangPass(config.level) then |
412 | return 4 | 413 | return 4 |
413 | end | 414 | end |
414 | 415 | ||
@@ -416,7 +417,7 @@ function _M.getExploreCommandRewardRpc(agent, data) | @@ -416,7 +417,7 @@ function _M.getExploreCommandRewardRpc(agent, data) | ||
416 | if freeFlag == "0" then | 417 | if freeFlag == "0" then |
417 | gift = config.giftFree | 418 | gift = config.giftFree |
418 | 419 | ||
419 | - freeRecord = string.setbit(freeRecord, id) | 420 | + freeRecord = string.setbit(freeRecord, subId) |
420 | info["fr"] = freeRecord | 421 | info["fr"] = freeRecord |
421 | end | 422 | end |
422 | 423 | ||
@@ -426,11 +427,12 @@ function _M.getExploreCommandRewardRpc(agent, data) | @@ -426,11 +427,12 @@ function _M.getExploreCommandRewardRpc(agent, data) | ||
426 | end | 427 | end |
427 | gift = gift .. config.giftLimit | 428 | gift = gift .. config.giftLimit |
428 | 429 | ||
429 | - buyRecord = string.setbit(buyRecord, id) | 430 | + buyRecord = string.setbit(buyRecord, subId) |
430 | info["br"] = buyRecord | 431 | info["br"] = buyRecord |
431 | end | 432 | end |
432 | 433 | ||
433 | - role.storeData:updateProperty({field = "bpInfo", value = info}) | 434 | + bpInfo[id] = info |
435 | + role.storeData:updateProperty({field = "bpInfo", value = bpInfo}) | ||
434 | 436 | ||
435 | local reward, _ = role:award(gift, {log = {desc = "exploreCommand", int1 = id, int2 = subId}}) | 437 | local reward, _ = role:award(gift, {log = {desc = "exploreCommand", int1 = id, int2 = subId}}) |
436 | 438 |
src/actions/TowerAction.lua
@@ -75,7 +75,7 @@ function _M.startBattleRpc(agent, data) | @@ -75,7 +75,7 @@ function _M.startBattleRpc(agent, data) | ||
75 | 75 | ||
76 | role:updateProperty({field = "towerInfo", value = towerInfo}) | 76 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
77 | role:checkTaskEnter("TowerBattle", {level = towerInfo.l}) | 77 | role:checkTaskEnter("TowerBattle", {level = towerInfo.l}) |
78 | - | 78 | + role:mylog("tower_action", {desc = "startBattle", int1 = id}) |
79 | SendPacket(actionCodes.Tower_startBattleRpc, '') | 79 | SendPacket(actionCodes.Tower_startBattleRpc, '') |
80 | return true | 80 | return true |
81 | end | 81 | end |
@@ -128,6 +128,7 @@ function _M.endBattleRpc(agent, data) | @@ -128,6 +128,7 @@ function _M.endBattleRpc(agent, data) | ||
128 | reward = reward, | 128 | reward = reward, |
129 | rank = rank, | 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 | SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward, change = change})) | 133 | SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward, change = change})) |
133 | return true | 134 | return true |
@@ -151,7 +152,7 @@ function _M.bugCountRpc(agent, data) | @@ -151,7 +152,7 @@ function _M.bugCountRpc(agent, data) | ||
151 | towerInfo.c = curCount | 152 | towerInfo.c = curCount |
152 | towerInfo.t = nextTime | 153 | towerInfo.t = nextTime |
153 | role:updateProperty({field = "towerInfo", value = towerInfo}) | 154 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
154 | - | 155 | + role:mylog("tower_action", {desc = "bugCount"}) |
155 | SendPacket(actionCodes.Tower_bugCountRpc, '') | 156 | SendPacket(actionCodes.Tower_bugCountRpc, '') |
156 | return true | 157 | return true |
157 | end | 158 | end |
src/adv/Adv.lua
@@ -24,6 +24,17 @@ function Adv:ctor(owner) | @@ -24,6 +24,17 @@ function Adv:ctor(owner) | ||
24 | self:initByInfo(self.owner:getProperty("advInfo")) | 24 | self:initByInfo(self.owner:getProperty("advInfo")) |
25 | end | 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 | --初始化adv 信息 | 38 | --初始化adv 信息 |
28 | function Adv:initByInfo(advInfo) | 39 | function Adv:initByInfo(advInfo) |
29 | if not next(advInfo) then return end --还没有 开始新地图 | 40 | if not next(advInfo) then return end --还没有 开始新地图 |
@@ -498,18 +509,18 @@ function Adv:awardArtifact(id, params) | @@ -498,18 +509,18 @@ function Adv:awardArtifact(id, params) | ||
498 | self:checkAchievement(Adv.AchievType.GetMWeapon, 1, id) | 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 | if not params.isChoose then | 524 | if not params.isChoose then |
514 | self:pushBackEvent(AdvBackEventType.Artifact, {id = id}) | 525 | self:pushBackEvent(AdvBackEventType.Artifact, {id = id}) |
515 | end | 526 | end |
@@ -598,6 +609,7 @@ function Adv:wearArtifact(slot, id) | @@ -598,6 +609,7 @@ function Adv:wearArtifact(slot, id) | ||
598 | else | 609 | else |
599 | id = nil | 610 | id = nil |
600 | end | 611 | end |
612 | + self:mylog({desc = "wearArtifact", int1 = id}) | ||
601 | 613 | ||
602 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) | 614 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) |
603 | return true | 615 | return true |
@@ -656,6 +668,9 @@ function Adv:artifactLevelUp(id, level) | @@ -656,6 +668,9 @@ function Adv:artifactLevelUp(id, level) | ||
656 | end | 668 | end |
657 | if newLv == advAFGet[id] then return end | 669 | if newLv == advAFGet[id] then return end |
658 | 670 | ||
671 | + self:mylog({desc = "artifactLevelUp", int1 = id, int2 = level}) | ||
672 | + | ||
673 | + | ||
659 | local status = 0 | 674 | local status = 0 |
660 | if curWear[id] then -- 穿着呢 | 675 | if curWear[id] then -- 穿着呢 |
661 | local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] | 676 | local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] |
@@ -700,6 +715,8 @@ function Adv:chooseArtifact(index) | @@ -700,6 +715,8 @@ function Adv:chooseArtifact(index) | ||
700 | if not self.waitArtifact or not self.waitArtifact[index] then return end | 715 | if not self.waitArtifact or not self.waitArtifact[index] then return end |
701 | self:award({[self.waitArtifact[index]] = 1}, {log = {desc = "chooseArtifact"}, isChoose = true}) | 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 | self.waitArtifact = nil | 720 | self.waitArtifact = nil |
704 | 721 | ||
705 | -- 支援效果继续选择 | 722 | -- 支援效果继续选择 |
@@ -796,6 +813,8 @@ function Adv:over(success, rewardRatio, overType) | @@ -796,6 +813,8 @@ function Adv:over(success, rewardRatio, overType) | ||
796 | end | 813 | end |
797 | self:clearAdvUnlockCache() | 814 | self:clearAdvUnlockCache() |
798 | 815 | ||
816 | + self:mylog({desc = "over", short1 = success and 1 or 0, int1 = overType}) | ||
817 | + | ||
799 | local chapterId = self.chapterId | 818 | local chapterId = self.chapterId |
800 | self:clear() | 819 | self:clear() |
801 | self.owner:checkTaskEnter("AdvScore", {score = score}) | 820 | self.owner:checkTaskEnter("AdvScore", {score = score}) |
@@ -899,23 +918,26 @@ function Adv:award(gift, params) | @@ -899,23 +918,26 @@ function Adv:award(gift, params) | ||
899 | items = items:setv(itemId, nums) | 918 | items = items:setv(itemId, nums) |
900 | end | 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 | end | 941 | end |
920 | end | 942 | end |
921 | if items ~= oldItems then | 943 | if items ~= oldItems then |
@@ -1009,6 +1031,7 @@ local function clickOut(self, room, block, params, isExit) | @@ -1009,6 +1031,7 @@ local function clickOut(self, room, block, params, isExit) | ||
1009 | isRelay = true, | 1031 | isRelay = true, |
1010 | }) | 1032 | }) |
1011 | else | 1033 | else |
1034 | + self:mylog({desc = "pass"}) | ||
1012 | self:initByChapter({ | 1035 | self:initByChapter({ |
1013 | chapterId = self.chapterId, | 1036 | chapterId = self.chapterId, |
1014 | level = self.level + 1, | 1037 | level = self.level + 1, |
src/adv/AdvBuff.lua
@@ -434,6 +434,9 @@ function Buff:initNew(release, data) | @@ -434,6 +434,9 @@ function Buff:initNew(release, data) | ||
434 | if self.buffData.effectTime > 0 then | 434 | if self.buffData.effectTime > 0 then |
435 | self.count = self.buffData.effectTime | 435 | self.count = self.buffData.effectTime |
436 | end | 436 | end |
437 | + if self.buffData.mapLock == 1 then | ||
438 | + self.mapId = self.owner.battle.adv:getCurMap().mapId | ||
439 | + end | ||
437 | end | 440 | end |
438 | 441 | ||
439 | function Buff:createAfter() | 442 | function Buff:createAfter() |
@@ -456,6 +459,9 @@ function Buff:initByDB(data) | @@ -456,6 +459,9 @@ function Buff:initByDB(data) | ||
456 | if data.count then | 459 | if data.count then |
457 | self.count = data.count | 460 | self.count = data.count |
458 | end | 461 | end |
462 | + if data.mapId then | ||
463 | + self.mapId = data.mapId | ||
464 | + end | ||
459 | self.layer = data.layer or 1 | 465 | self.layer = data.layer or 1 |
460 | if self._initDB then | 466 | if self._initDB then |
461 | self:_initDB(data) | 467 | self:_initDB(data) |
@@ -464,7 +470,7 @@ end | @@ -464,7 +470,7 @@ end | ||
464 | 470 | ||
465 | 471 | ||
466 | function Buff:afterRound() | 472 | function Buff:afterRound() |
467 | - if self.isDel or self.owner.isDead then return end | 473 | + if self.owner.isDead or self:isHide() then return end |
468 | 474 | ||
469 | -- keepTerm 检查 | 475 | -- keepTerm 检查 |
470 | if not self:checkKeep() then | 476 | if not self:checkKeep() then |
@@ -533,7 +539,7 @@ function Buff:checkKeep() | @@ -533,7 +539,7 @@ function Buff:checkKeep() | ||
533 | end | 539 | end |
534 | checkFunc[5] = function(_, buffId) | 540 | checkFunc[5] = function(_, buffId) |
535 | local buff = self.owner:getBuffById(buffId) | 541 | local buff = self.owner:getBuffById(buffId) |
536 | - if buff and not buff.isDel then | 542 | + if buff then |
537 | return true | 543 | return true |
538 | end | 544 | end |
539 | return false | 545 | return false |
@@ -574,6 +580,18 @@ function Buff:effect() | @@ -574,6 +580,18 @@ function Buff:effect() | ||
574 | return self:_effectValue() | 580 | return self:_effectValue() |
575 | end | 581 | end |
576 | end | 582 | end |
583 | + | ||
584 | +-- 在当前阶段不可用 小透明 < 不会回合遍历 不会查找遍历 可以删除遍历 可以下层遍历 > | ||
585 | +function Buff:isHide() | ||
586 | + if self.isDel then | ||
587 | + return true | ||
588 | + end | ||
589 | + if self.buffData.mapLock == 1 and self.mapId and self.owner.battle.adv:getCurMap().mapId ~= self.mapId then | ||
590 | + return true | ||
591 | + end | ||
592 | + return false | ||
593 | +end | ||
594 | + | ||
577 | --删除buff 时调用 | 595 | --删除buff 时调用 |
578 | function Buff:endBuff() | 596 | function Buff:endBuff() |
579 | if self._endBuff then | 597 | if self._endBuff then |
@@ -678,6 +696,9 @@ function Buff:getDB() | @@ -678,6 +696,9 @@ function Buff:getDB() | ||
678 | if self.count ~= -1 then | 696 | if self.count ~= -1 then |
679 | db.count = self.count | 697 | db.count = self.count |
680 | end | 698 | end |
699 | + if self.mapId then | ||
700 | + db.mapId = self.mapId | ||
701 | + end | ||
681 | db.layer = self.layer | 702 | db.layer = self.layer |
682 | if self.buffData.keepTerm:toArray(true, "=")[1] == 1 then | 703 | if self.buffData.keepTerm:toArray(true, "=")[1] == 1 then |
683 | db.releId = self.releaseId | 704 | db.releId = self.releaseId |
src/adv/AdvMap.lua
@@ -553,7 +553,11 @@ createMap = function(self, mapId, isEnter, isNewRelay) | @@ -553,7 +553,11 @@ createMap = function(self, mapId, isEnter, isNewRelay) | ||
553 | if randomCommon() == false then | 553 | if randomCommon() == false then |
554 | return false | 554 | return false |
555 | end | 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 | end | 561 | end |
558 | 562 | ||
559 | --选择点 | 563 | --选择点 |
src/adv/AdvPassive.lua
@@ -119,6 +119,7 @@ Passive.AFTER_ROUND = 27 --经过 x回合时 | @@ -119,6 +119,7 @@ Passive.AFTER_ROUND = 27 --经过 x回合时 | ||
119 | Passive.GET_BUFF = 28 --获得指定buff | 119 | Passive.GET_BUFF = 28 --获得指定buff |
120 | Passive.OPEN_BLOCK = 29 --翻开格子 | 120 | Passive.OPEN_BLOCK = 29 --翻开格子 |
121 | Passive.OPEN_MONSTER = 30 --翻开怪物 | 121 | Passive.OPEN_MONSTER = 30 --翻开怪物 |
122 | +Passive.PLAYER_BUFF = 31 --玩家获得buff | ||
122 | 123 | ||
123 | 124 | ||
124 | -- 不同的开启条件 | 125 | -- 不同的开启条件 |
@@ -180,6 +181,7 @@ PassiveCondFactory[Passive.GET_BUFF] = function(_Passive) | @@ -180,6 +181,7 @@ PassiveCondFactory[Passive.GET_BUFF] = function(_Passive) | ||
180 | end | 181 | end |
181 | end | 182 | end |
182 | end | 183 | end |
184 | +PassiveCondFactory[Passive.PLAYER_BUFF] = PassiveCondFactory[Passive.GET_BUFF] | ||
183 | 185 | ||
184 | 186 | ||
185 | PassiveCondFactory[Passive.BORN_ONCE] = function(_Passive) | 187 | PassiveCondFactory[Passive.BORN_ONCE] = function(_Passive) |
@@ -265,6 +267,9 @@ function Passive:ctor(owner, data) | @@ -265,6 +267,9 @@ function Passive:ctor(owner, data) | ||
265 | self.round = data.round or 0 --触发剩余回合数 | 267 | self.round = data.round or 0 --触发剩余回合数 |
266 | self.count = data.count or self.passiveData.count --触发剩余次数 | 268 | self.count = data.count or self.passiveData.count --触发剩余次数 |
267 | self.delay = data.delay or self.passiveData.delayRound --触发延迟回合数 | 269 | self.delay = data.delay or self.passiveData.delayRound --触发延迟回合数 |
270 | + if self.passiveData.mapLock == 1 and not self.mapId then | ||
271 | + self.mapId = self.owner.battle.adv:getCurMap().mapId | ||
272 | + end | ||
268 | 273 | ||
269 | self.effects = self.passiveData.effect:toTableArray(true) | 274 | self.effects = self.passiveData.effect:toTableArray(true) |
270 | self.filters = {} | 275 | self.filters = {} |
@@ -301,7 +306,8 @@ function Passive:canEffect(effType, effValue) | @@ -301,7 +306,8 @@ function Passive:canEffect(effType, effValue) | ||
301 | end | 306 | end |
302 | --禁用被动技 | 307 | --禁用被动技 |
303 | local count = self.owner:getDisablePassiveCount() | 308 | local count = self.owner:getDisablePassiveCount() |
304 | - if count and (count == 0 or self.owner:getPassiveIdx(self) <= count) then | 309 | + local idx = self.owner:getPassiveIdx(self) |
310 | + if count and idx and (count == 0 or idx <= count) then | ||
305 | return | 311 | return |
306 | end | 312 | end |
307 | return true | 313 | return true |
@@ -331,7 +337,7 @@ function Passive:effect(triggerPms) | @@ -331,7 +337,7 @@ function Passive:effect(triggerPms) | ||
331 | end | 337 | end |
332 | 338 | ||
333 | function Passive:afterRound() | 339 | function Passive:afterRound() |
334 | - if self.isDel or self.owner.isDead or self.owner.lock then return end | 340 | + if self.isDel or self.owner.isDead or self.owner.lock or self:isHide() then return end |
335 | if self.round > 0 then --回合触发的 | 341 | if self.round > 0 then --回合触发的 |
336 | self.round = self.round - 1 | 342 | self.round = self.round - 1 |
337 | end | 343 | end |
@@ -349,9 +355,20 @@ function Passive:afterLayer() | @@ -349,9 +355,20 @@ function Passive:afterLayer() | ||
349 | end | 355 | end |
350 | end | 356 | end |
351 | 357 | ||
358 | +-- 在当前阶段不可用 小透明 < 不会回合遍历 不会查找遍历 可以删除遍历 可以下层遍历 > | ||
359 | +function Passive:isHide() | ||
360 | + if self.isDel then | ||
361 | + return true | ||
362 | + end | ||
363 | + if self.passiveData.mapLock == 1 and self.mapId and self.owner.battle.adv:getCurMap().mapId ~= self.mapId then | ||
364 | + return true | ||
365 | + end | ||
366 | + return false | ||
367 | +end | ||
368 | + | ||
352 | -- 可以触发 | 369 | -- 可以触发 |
353 | function Passive:canTrigger( ) | 370 | function Passive:canTrigger( ) |
354 | - return self.count > 0 and self.delay <= 0 | 371 | + return self.count > 0 and self.delay <= 0 and not self:isHide() |
355 | end | 372 | end |
356 | 373 | ||
357 | function Passive:trigger(condType, params) --触发检查 | 374 | function Passive:trigger(condType, params) --触发检查 |
@@ -393,6 +410,9 @@ function Passive:getDB() | @@ -393,6 +410,9 @@ function Passive:getDB() | ||
393 | db.round = self.round | 410 | db.round = self.round |
394 | db.count = self.count | 411 | db.count = self.count |
395 | db.delay = self.delay | 412 | db.delay = self.delay |
413 | + if self.mapId then | ||
414 | + db.mapId = self.mapId | ||
415 | + end | ||
396 | return db | 416 | return db |
397 | end | 417 | end |
398 | 418 |
src/adv/AdvPlayer.lua
@@ -115,16 +115,19 @@ end | @@ -115,16 +115,19 @@ end | ||
115 | function BaseObject:getPassiveIdx(passive) | 115 | function BaseObject:getPassiveIdx(passive) |
116 | for idx, passive_ in ipairs(self.passives) do | 116 | for idx, passive_ in ipairs(self.passives) do |
117 | if passive_ == passive then | 117 | if passive_ == passive then |
118 | - return idx | 118 | + if passive.passiveData.dispel ~= 1 then |
119 | + return idx | ||
120 | + end | ||
121 | + return | ||
119 | end | 122 | end |
120 | end | 123 | end |
121 | - return 999 | 124 | + return |
122 | end | 125 | end |
123 | 126 | ||
124 | function BaseObject:getDisablePassiveCount() | 127 | function BaseObject:getDisablePassiveCount() |
125 | local count | 128 | local count |
126 | for _, buff in ipairs(self.buffs) do | 129 | for _, buff in ipairs(self.buffs) do |
127 | - if not buff.isDel and buff:getType() == Buff.DISABLE_BUFF then | 130 | + if not buff:isHide() and buff:getType() == Buff.DISABLE_BUFF then |
128 | if buff:effect() == 0 then | 131 | if buff:effect() == 0 then |
129 | return 0 | 132 | return 0 |
130 | end | 133 | end |
@@ -138,7 +141,7 @@ function BaseObject:addBuff(buffId, releaser) | @@ -138,7 +141,7 @@ function BaseObject:addBuff(buffId, releaser) | ||
138 | local buffData = csvdb["adv_map_buffCsv"][buffId] | 141 | local buffData = csvdb["adv_map_buffCsv"][buffId] |
139 | if not buffData then return end | 142 | if not buffData then return end |
140 | for _, buff in ipairs(self.buffs) do | 143 | for _, buff in ipairs(self.buffs) do |
141 | - if not buff.isDel and (buff:getType() == Buff.CLEAR_BUFF or buff:getType() == Buff.IMMNUE_BUFF) then | 144 | + if not buff:isHide() and (buff:getType() == Buff.CLEAR_BUFF or buff:getType() == Buff.IMMNUE_BUFF) then |
142 | if buff:canEffect(buffId) then | 145 | if buff:canEffect(buffId) then |
143 | buff:effect() | 146 | buff:effect() |
144 | return | 147 | return |
@@ -166,7 +169,7 @@ end | @@ -166,7 +169,7 @@ end | ||
166 | 169 | ||
167 | function BaseObject:getBuffById(bId) | 170 | function BaseObject:getBuffById(bId) |
168 | for idx, buff in ipairs(self.buffs) do | 171 | for idx, buff in ipairs(self.buffs) do |
169 | - if buff.id == bId then | 172 | + if buff.id == bId and not buff:isHide() then |
170 | return buff | 173 | return buff |
171 | end | 174 | end |
172 | end | 175 | end |
@@ -196,7 +199,7 @@ end | @@ -196,7 +199,7 @@ end | ||
196 | 199 | ||
197 | function BaseObject:hadBuff(bType) | 200 | function BaseObject:hadBuff(bType) |
198 | for _, buff in ipairs(self.buffs) do | 201 | for _, buff in ipairs(self.buffs) do |
199 | - if not buff.isDel and buff:getType() == bType then | 202 | + if not buff:isHide() and buff:getType() == bType then |
200 | return buff | 203 | return buff |
201 | end | 204 | end |
202 | end | 205 | end |
@@ -204,7 +207,7 @@ end | @@ -204,7 +207,7 @@ end | ||
204 | 207 | ||
205 | function BaseObject:hadBuffById(bId) | 208 | function BaseObject:hadBuffById(bId) |
206 | for _, buff in ipairs(self.buffs) do | 209 | for _, buff in ipairs(self.buffs) do |
207 | - if not buff.isDel and buff.id == bId then | 210 | + if not buff:isHide() and buff.id == bId then |
208 | return buff | 211 | return buff |
209 | end | 212 | end |
210 | end | 213 | end |
@@ -218,7 +221,7 @@ end | @@ -218,7 +221,7 @@ end | ||
218 | function BaseObject:getCommonBuffEffect(bType, otherCond) | 221 | function BaseObject:getCommonBuffEffect(bType, otherCond) |
219 | local effect, count = {[0] = 0, [1] = 0}, 0 | 222 | local effect, count = {[0] = 0, [1] = 0}, 0 |
220 | for _, buff in ipairs(self.buffs) do | 223 | for _, buff in ipairs(self.buffs) do |
221 | - if not buff.isDel and buff:getType() == bType then | 224 | + if not buff:isHide() and buff:getType() == bType then |
222 | local cType, value, cond = buff:effect() | 225 | local cType, value, cond = buff:effect() |
223 | if cType and (not otherCond or otherCond == cond) then | 226 | if cType and (not otherCond or otherCond == cond) then |
224 | effect[cType] = effect[cType] + value | 227 | effect[cType] = effect[cType] + value |
@@ -233,7 +236,7 @@ end | @@ -233,7 +236,7 @@ end | ||
233 | function BaseObject:getBackHurtBuff() | 236 | function BaseObject:getBackHurtBuff() |
234 | local effect = {[0] = 0, [1] = 0} | 237 | local effect = {[0] = 0, [1] = 0} |
235 | for _, buff in ipairs(self.buffs) do | 238 | for _, buff in ipairs(self.buffs) do |
236 | - if not buff.isDel and buff:getType() == Buff.BACK_HURT then | 239 | + if not buff:isHide() and buff:getType() == Buff.BACK_HURT then |
237 | local cType, value = buff:effect() -- aType 0 全部 1 普通攻击 | 240 | local cType, value = buff:effect() -- aType 0 全部 1 普通攻击 |
238 | if cType then | 241 | if cType then |
239 | effect[cType] = effect[cType] + value | 242 | effect[cType] = effect[cType] + value |
@@ -268,7 +271,7 @@ function BaseObject:getBuffEffectChange(classify) | @@ -268,7 +271,7 @@ function BaseObject:getBuffEffectChange(classify) | ||
268 | end | 271 | end |
269 | local effect = 0 | 272 | local effect = 0 |
270 | for _, buff in ipairs(self.buffs) do | 273 | for _, buff in ipairs(self.buffs) do |
271 | - if not buff.isDel and buff:getType() == Buff.Buff_EFFECT_CHANGE then | 274 | + if not buff:isHide() and buff:getType() == Buff.Buff_EFFECT_CHANGE then |
272 | local cType, value = buff:effect() | 275 | local cType, value = buff:effect() |
273 | if cType and had[cType] then | 276 | if cType and had[cType] then |
274 | effect = effect + value | 277 | effect = effect + value |
@@ -286,7 +289,7 @@ function BaseObject:getAttrBuffChange(attr) | @@ -286,7 +289,7 @@ function BaseObject:getAttrBuffChange(attr) | ||
286 | } | 289 | } |
287 | local effect, count = {[0] = 0, [1] = 0}, 0 | 290 | local effect, count = {[0] = 0, [1] = 0}, 0 |
288 | for _, buff in ipairs(self.buffs) do | 291 | for _, buff in ipairs(self.buffs) do |
289 | - if not buff.isDel and AttrBuff[buff:getType()] then | 292 | + if not buff:isHide() and AttrBuff[buff:getType()] then |
290 | local cType, value, attrName = buff:effect() | 293 | local cType, value, attrName = buff:effect() |
291 | if cType and attr == attrName then | 294 | if cType and attr == attrName then |
292 | effect[cType] = effect[cType] + value | 295 | effect[cType] = effect[cType] + value |
@@ -310,7 +313,7 @@ end | @@ -310,7 +313,7 @@ end | ||
310 | function BaseObject:reSetHpMax() | 313 | function BaseObject:reSetHpMax() |
311 | self.hpMax = self._hpMax | 314 | self.hpMax = self._hpMax |
312 | for _, buff in ipairs(self.buffs) do | 315 | for _, buff in ipairs(self.buffs) do |
313 | - if not buff.isDel and buff:getType() == Buff.HP_MAX_CHANGE then | 316 | + if not buff:isHide() and buff:getType() == Buff.HP_MAX_CHANGE then |
314 | local cv = buff:effect() | 317 | local cv = buff:effect() |
315 | if cv then | 318 | if cv then |
316 | self.hpMax = self.hpMax + cv | 319 | self.hpMax = self.hpMax + cv |
@@ -332,7 +335,7 @@ end | @@ -332,7 +335,7 @@ end | ||
332 | --计算自己伤害减免后的值 | 335 | --计算自己伤害减免后的值 |
333 | function BaseObject:getInjuredValue(value) | 336 | function BaseObject:getInjuredValue(value) |
334 | local injuredChange = self:getInjuredChange() | 337 | local injuredChange = self:getInjuredChange() |
335 | - return math.max(0, (value - self.def + injuredChange[0]) * (1 + injuredChange[1])) | 338 | + return math.max(0, (value + injuredChange[0]) * (1 + injuredChange[1])) |
336 | end | 339 | end |
337 | 340 | ||
338 | --最终伤害 = [ (敌方攻击 - 己方防御) * (1+伤害增加百分比-伤害减少百分比)*(1+受伤增加百分比-受伤减少百分比)+(伤害增加固定值-伤害增加固定值+受伤增加固定值-受伤增加固定值)]*(1+侍宠百分比)-侍宠固定值 | 341 | --最终伤害 = [ (敌方攻击 - 己方防御) * (1+伤害增加百分比-伤害减少百分比)*(1+受伤增加百分比-受伤减少百分比)+(伤害增加固定值-伤害增加固定值+受伤增加固定值-受伤增加固定值)]*(1+侍宠百分比)-侍宠固定值 |
@@ -348,10 +351,11 @@ function BaseObject:hurt(value, releaser, params) | @@ -348,10 +351,11 @@ function BaseObject:hurt(value, releaser, params) | ||
348 | end | 351 | end |
349 | end | 352 | end |
350 | 353 | ||
351 | - if params.hurtType ~= 5 and params.hurtType ~= 6 then | ||
352 | - if not params.hurtType or params.hurtType ~= 4 then | ||
353 | - value = self:getInjuredValue(value) --减伤计算 | 354 | + if params.hurtType ~= 5 then |
355 | + if params.hurtType ~= 6 and params.hurtType ~= 4 then | ||
356 | + value = math.max(0, value - self.def) | ||
354 | end | 357 | end |
358 | + value = self:getInjuredValue(value) --减伤计算 | ||
355 | if value == 0 then return end | 359 | if value == 0 then return end |
356 | 360 | ||
357 | -- 舍身和恃宠 | 361 | -- 舍身和恃宠 |
@@ -664,8 +668,11 @@ end | @@ -664,8 +668,11 @@ end | ||
664 | --战斗结束了扣战斗buff次数 | 668 | --战斗结束了扣战斗buff次数 |
665 | function Player:effectBattleBuff() | 669 | function Player:effectBattleBuff() |
666 | for _, buff in ipairs(self.buffs) do | 670 | for _, buff in ipairs(self.buffs) do |
667 | - if not buff.isDel and (buff:getType() == Buff.BATTLE_BUFF or buff:getType() == Buff.BATTLE_PASSIVE) then | 671 | + if not buff:isHide() and (buff:getType() == Buff.BATTLE_BUFF or buff:getType() == Buff.BATTLE_PASSIVE) then |
668 | buff:effect() | 672 | buff:effect() |
673 | + if not buff.buffData.classify:sismember(7, " ") then -- 神器buff 不会清除 | ||
674 | + buff:uncover() | ||
675 | + end | ||
669 | end | 676 | end |
670 | end | 677 | end |
671 | end | 678 | end |
@@ -691,6 +698,7 @@ function Player:addBuff(buffId, releaser) | @@ -691,6 +698,7 @@ function Player:addBuff(buffId, releaser) | ||
691 | self.battle.player:attrChangeCondBuffCheck(2, buffId) | 698 | self.battle.player:attrChangeCondBuffCheck(2, buffId) |
692 | self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId) | 699 | self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId) |
693 | self.battle.adv:pushBackEvent(AdvBackEventType.Buff, {buffId = buffId}) | 700 | self.battle.adv:pushBackEvent(AdvBackEventType.Buff, {buffId = buffId}) |
701 | + self.battle:triggerPassive(Passive.PLAYER_BUFF, {buffId = buffId}) | ||
694 | end | 702 | end |
695 | return status | 703 | return status |
696 | end | 704 | end |
@@ -698,7 +706,7 @@ end | @@ -698,7 +706,7 @@ end | ||
698 | function Player:attrChangeCondBuffCheck(etype, cond) | 706 | function Player:attrChangeCondBuffCheck(etype, cond) |
699 | local effect = {} | 707 | local effect = {} |
700 | for _, buff in ipairs(self.buffs) do | 708 | for _, buff in ipairs(self.buffs) do |
701 | - if not buff.isDel and (buff:getType() == Buff.ATTR_CHANGE_COND) then | 709 | + if not buff:isHide() and (buff:getType() == Buff.ATTR_CHANGE_COND) then |
702 | local _et, _attr, _co = buff:getEffectBy() | 710 | local _et, _attr, _co = buff:getEffectBy() |
703 | if etype == _et and (not _co or _co == cond) then | 711 | if etype == _et and (not _co or _co == cond) then |
704 | effect[_attr] = 1 | 712 | effect[_attr] = 1 |
src/adv/AdvTask.lua
@@ -132,10 +132,21 @@ function AdvTask.bind(Adv) | @@ -132,10 +132,21 @@ function AdvTask.bind(Adv) | ||
132 | end | 132 | end |
133 | local advEventOpenStatus = self.owner:advEventOpenStatus() | 133 | local advEventOpenStatus = self.owner:advEventOpenStatus() |
134 | local pool = {} | 134 | local pool = {} |
135 | - for id, data in pairs(csvdb["event_questCsv"]) do | ||
136 | - if data.levelchapter == chapterId and (data.unlockType == 0 or (advEventOpenStatus[etype] or {})[data.unlockType]) then | ||
137 | - if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then | ||
138 | - pool[id] = {showup = data.showup} | 135 | + |
136 | + local mapData = self:getCurMap():getMapInfoCsv() | ||
137 | + for _, id in ipairs(mapData.quest:toArray(true, "=")) do | ||
138 | + local data = csvdb["event_questCsv"][taskId] | ||
139 | + if data then | ||
140 | + pool[id] = {showup = data.showup} | ||
141 | + end | ||
142 | + end | ||
143 | + | ||
144 | + if not next(pool) then | ||
145 | + for id, data in pairs(csvdb["event_questCsv"]) do | ||
146 | + if data.levelchapter == chapterId and (data.unlockType == 0 or (advEventOpenStatus[etype] or {})[data.unlockType]) then | ||
147 | + if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then | ||
148 | + pool[id] = {showup = data.showup} | ||
149 | + end | ||
139 | end | 150 | end |
140 | end | 151 | end |
141 | end | 152 | end |
@@ -365,6 +376,7 @@ function AdvTask.bind(Adv) | @@ -365,6 +376,7 @@ function AdvTask.bind(Adv) | ||
365 | else | 376 | else |
366 | if (status or -1) >= data.value1 then | 377 | if (status or -1) >= data.value1 then |
367 | status = -1 | 378 | status = -1 |
379 | + self.owner:mylog("adv_action", {desc = "finishAchiev", short1 = 1, int1 = self.chapterId, int2 = taskId}) | ||
368 | end | 380 | end |
369 | if status and status ~= oldStatus then | 381 | if status and status ~= oldStatus then |
370 | insertChange(self, self.chapterId, taskId, status) | 382 | insertChange(self, self.chapterId, taskId, status) |
src/agent.lua
@@ -285,6 +285,7 @@ function CMD.close() | @@ -285,6 +285,7 @@ function CMD.close() | ||
285 | local role = agentInfo.role | 285 | local role = agentInfo.role |
286 | if not role then return end | 286 | if not role then return end |
287 | role:log("onLogout", {logtime = skynet.timex()-role:getProperty("ltime")}) | 287 | role:log("onLogout", {logtime = skynet.timex()-role:getProperty("ltime")}) |
288 | + role:mylog("logout", {int1 = skynet.timex()-role:getProperty("ltime")}) | ||
288 | role:onOfflineEvent() | 289 | role:onOfflineEvent() |
289 | end | 290 | end |
290 | 291 |
src/models/Activity.lua
1 | local Activity = class("Activity", require("shared.ModelBase")) | 1 | local Activity = class("Activity", require("shared.ModelBase")) |
2 | local string_format = string.format | 2 | local string_format = string.format |
3 | 3 | ||
4 | +-- activity_ctr showType | ||
4 | Activity.ActivityType = { | 5 | Activity.ActivityType = { |
5 | - Sign = 1, -- 签到 | 6 | + SsrUpPoolChange = 1, -- 特定英雄活动,切卡池 |
6 | DoubleDrop = 2, -- 双倍掉落 | 7 | DoubleDrop = 2, -- 双倍掉落 |
7 | - FoodSell = 3, --贩卖周 料理 | ||
8 | - DrawHero = 4, --抽卡周 招募 | ||
9 | - AdvDraw = 5, --拾荒抽周 资助 | ||
10 | - OpenBox = 6, --拆解周 时钟箱 | ||
11 | - PaySignIn = 7, --付费签到 | ||
12 | - | ||
13 | - SsrUpPoolChange = 10, -- 特定英雄活动,切卡池 | 8 | + Sign = 4, -- 签到 |
9 | + ChangeCG = 5, -- 客户端使用,切换抽卡界面 | ||
10 | + PaySignIn = 6, --付费签到 | ||
11 | + ExploreCommand = 7, -- 探索指令 | ||
12 | + PayBack = 8, --返利 | ||
13 | + | ||
14 | + BonusDouble = 9, -- 奖励关卡翻倍 | ||
15 | + CalendaTask = 10, -- 日历任务 | ||
16 | + | ||
17 | + FoodSell = 11, --贩卖周 料理 | ||
18 | + DrawHero = 12, --抽卡周 招募 | ||
19 | + AdvDraw = 13, --拾荒抽周 资助 | ||
20 | + OpenBox = 14, --拆解周 时钟箱 | ||
14 | } | 21 | } |
15 | 22 | ||
16 | 23 | ||
@@ -32,24 +39,27 @@ end | @@ -32,24 +39,27 @@ end | ||
32 | Activity.schema = { | 39 | Activity.schema = { |
33 | actime = {"table", {}}, -- 最近检查某项活动的开始时间 {id = time} | 40 | actime = {"table", {}}, -- 最近检查某项活动的开始时间 {id = time} |
34 | round = {"table", {}}, -- 记录活动到了第几轮 {id = roundnum} | 41 | round = {"table", {}}, -- 记录活动到了第几轮 {id = roundnum} |
35 | - act1 = {"table", {}}, -- {0 = day, 1= -1, 2 = -1} == 签到活动 | ||
36 | - act3 = {"table", {}}, -- {0 = 抽卡次数, 1=1, 2=1} 抽卡周活动 1表示领取过该档位的奖励 | ||
37 | - act4 = {"table", {}}, -- {0 = 贩卖数量, 1=1, 2=1} 贩卖周活动 1表示领取过该档位的奖励 | ||
38 | - act5 = {"table", {}}, -- {0 = 拆解数量, 1=1, 2=1} 拆解周活动 1表示领取过该档位的奖励 | ||
39 | - act6 = {"table", {}}, -- {0 = 拾荒消耗远古金币数量, 1=1, 2=1} 拾荒周活动 1表示领取过该档位的奖励 | ||
40 | - act7 = {"table", {}}, -- {1 = 1, 2 = 1} == 付费签到活动 | 42 | + act4 = {"table", {}}, -- {0 = day, 1= -1, 2 = -1} == 签到活动 |
43 | + act6 = {"table", {}}, -- {1 = 1, 2 = 1} == 付费签到活动 | ||
44 | + act8 = {"number", 0}, -- 充值返利 | ||
45 | + | ||
46 | + act11 = {"table", {}}, -- {0 = 贩卖数量, 1=1, 2=1} 贩卖周活动 1表示领取过该档位的奖励 | ||
47 | + act12 = {"table", {}}, -- {0 = 抽卡次数, 1=1, 2=1} 抽卡周活动 1表示领取过该档位的奖励 | ||
48 | + act13 = {"table", {}}, -- {0 = 拾荒消耗远古金币数量, 1=1, 2=1} 拾荒周活动 1表示领取过该档位的奖励 | ||
49 | + act14 = {"table", {}}, -- {0 = 拆解数量, 1=1, 2=1} 拆解周活动 1表示领取过该档位的奖励 | ||
41 | } | 50 | } |
42 | 51 | ||
43 | function Activity:data() | 52 | function Activity:data() |
44 | return { | 53 | return { |
45 | actime = self:getProperty("actime"), | 54 | actime = self:getProperty("actime"), |
46 | round = self:getProperty("round"), | 55 | round = self:getProperty("round"), |
47 | - act1 = self:getProperty("act1"), | ||
48 | - act3 = self:getProperty("act3"), | ||
49 | act4 = self:getProperty("act4"), | 56 | act4 = self:getProperty("act4"), |
50 | - act5 = self:getProperty("act5"), | ||
51 | act6 = self:getProperty("act6"), | 57 | act6 = self:getProperty("act6"), |
52 | - act7 = self:getProperty("act7"), | 58 | + act8 = self:getProperty("act8"), |
59 | + act11 = self:getProperty("act11"), | ||
60 | + act12 = self:getProperty("act12"), | ||
61 | + act13 = self:getProperty("act13"), | ||
62 | + act14 = self:getProperty("act14"), | ||
53 | } | 63 | } |
54 | end | 64 | end |
55 | 65 | ||
@@ -74,10 +84,9 @@ function Activity:updateProperty(params) | @@ -74,10 +84,9 @@ function Activity:updateProperty(params) | ||
74 | return false | 84 | return false |
75 | end | 85 | end |
76 | 86 | ||
77 | - | ||
78 | -function Activity:isOpenRaw(activityType, now) | ||
79 | - activityType = checkActivityType(activityType) | ||
80 | - local actData = csvdb["activity_ctrlCsv"][activityType] | 87 | +function Activity:isOpenRaw(activityId, now) |
88 | + activityId = checkActivityType(activityId) | ||
89 | + local actData = csvdb["activity_ctrlCsv"][activityId] | ||
81 | if not actData then return end | 90 | if not actData then return end |
82 | 91 | ||
83 | if actData.time == "" then -- 关闭 | 92 | if actData.time == "" then -- 关闭 |
@@ -86,7 +95,7 @@ function Activity:isOpenRaw(activityType, now) | @@ -86,7 +95,7 @@ function Activity:isOpenRaw(activityType, now) | ||
86 | 95 | ||
87 | local st = 0 | 96 | local st = 0 |
88 | local et = 0 | 97 | local et = 0 |
89 | - local now = skynet.timex() | 98 | + --local now = skynet.timex() |
90 | 99 | ||
91 | if actData.ttype == 0 then -- 时间开放 | 100 | if actData.ttype == 0 then -- 时间开放 |
92 | local openTimes = actData.time:toArray(false, "=") | 101 | local openTimes = actData.time:toArray(false, "=") |
@@ -115,7 +124,17 @@ end | @@ -115,7 +124,17 @@ end | ||
115 | -- 缓存开放 | 124 | -- 缓存开放 |
116 | function Activity:isOpen(activityType) | 125 | function Activity:isOpen(activityType) |
117 | activityType = checkActivityType(activityType) | 126 | activityType = checkActivityType(activityType) |
118 | - return self._isOpen[activityType] | 127 | + --return self._isOpen[activityType] |
128 | + local open = false | ||
129 | + for id, data in pairs(csvdb["activity_ctrlCsv"]) do | ||
130 | + if data.showType == activityType then | ||
131 | + open = self._isOpen[data.id] | ||
132 | + if open then | ||
133 | + return true, data.id | ||
134 | + end | ||
135 | + end | ||
136 | + end | ||
137 | + return false | ||
119 | end | 138 | end |
120 | 139 | ||
121 | function Activity:getActData(actType) | 140 | function Activity:getActData(actType) |
@@ -134,22 +153,22 @@ function Activity:checkActivityStatus(now, isCrossDay, notify) | @@ -134,22 +153,22 @@ function Activity:checkActivityStatus(now, isCrossDay, notify) | ||
134 | self._isOpen = {} | 153 | self._isOpen = {} |
135 | local actime = self:getProperty("actime") | 154 | local actime = self:getProperty("actime") |
136 | local change = false | 155 | local change = false |
137 | - for actType, actData in pairs(csvdb["activity_ctrlCsv"]) do | ||
138 | - local isOpen, startTime = self:isOpenRaw(actType, now) | ||
139 | - self._isOpen[actType] = isOpen | 156 | + for actId, actData in pairs(csvdb["activity_ctrlCsv"]) do |
157 | + local isOpen, startTime = self:isOpenRaw(actId, now) | ||
158 | + self._isOpen[actId] = isOpen | ||
140 | 159 | ||
141 | if isOpen then | 160 | if isOpen then |
142 | - if actime[actType] and actime[actType] == startTime then -- 还是之前的状态 开放中 | 161 | + if actime[actId] and actime[actId] == startTime then -- 还是之前的状态 开放中 |
143 | else -- 重置 | 162 | else -- 重置 |
144 | - actime[actType] = startTime | ||
145 | - self:closeActivity(actType, notify, true) | ||
146 | - self:initActivity(actType, isCrossDay, notify) | 163 | + actime[actId] = startTime |
164 | + self:closeActivity(actId, notify, true) | ||
165 | + self:initActivity(actId, isCrossDay, notify) | ||
147 | change = true | 166 | change = true |
148 | end | 167 | end |
149 | else | 168 | else |
150 | - if actime[actType] then | ||
151 | - self:closeActivity(actType, notify) | ||
152 | - actime[actType] = nil | 169 | + if actime[actId] then |
170 | + self:closeActivity(actId, notify) | ||
171 | + actime[actId] = nil | ||
153 | change = true | 172 | change = true |
154 | end | 173 | end |
155 | end | 174 | end |
@@ -199,10 +218,15 @@ function Activity:checkWeeklyAct(actType, notify, count, pool) | @@ -199,10 +218,15 @@ function Activity:checkWeeklyAct(actType, notify, count, pool) | ||
199 | local info = actInfoMap[actType] | 218 | local info = actInfoMap[actType] |
200 | if not info then return end | 219 | if not info then return end |
201 | 220 | ||
221 | + local open, actId = self:isOpen(actType) | ||
222 | + if not open then | ||
223 | + return | ||
224 | + end | ||
225 | + | ||
202 | local curData = self:getActData(actType) | 226 | local curData = self:getActData(actType) |
203 | local roundData = self:getProperty("round") | 227 | local roundData = self:getProperty("round") |
204 | local curRound = roundData[actType] or 0 | 228 | local curRound = roundData[actType] or 0 |
205 | - local ctrlData = csvdb["activity_ctrlCsv"][actType] | 229 | + local ctrlData = csvdb["activity_ctrlCsv"][actId] |
206 | if not ctrlData then return end | 230 | if not ctrlData then return end |
207 | if curRound >= ctrlData.condition then | 231 | if curRound >= ctrlData.condition then |
208 | return | 232 | return |
@@ -260,7 +284,6 @@ activityFunc[Activity.ActivityType.DrawHero] = { | @@ -260,7 +284,6 @@ activityFunc[Activity.ActivityType.DrawHero] = { | ||
260 | -- ["close"] = function(self, actType, notify) | 284 | -- ["close"] = function(self, actType, notify) |
261 | -- end, | 285 | -- end, |
262 | ["crossDay"] = function(self, actType, notify) | 286 | ["crossDay"] = function(self, actType, notify) |
263 | - print("cross day draw card") | ||
264 | self.owner:sendMail(MailId.ActDrawCard) | 287 | self.owner:sendMail(MailId.ActDrawCard) |
265 | end, | 288 | end, |
266 | } | 289 | } |
@@ -278,7 +301,6 @@ activityFunc[Activity.ActivityType.FoodSell] = { | @@ -278,7 +301,6 @@ activityFunc[Activity.ActivityType.FoodSell] = { | ||
278 | -- ["close"] = function(self, actType, notify) | 301 | -- ["close"] = function(self, actType, notify) |
279 | -- end, | 302 | -- end, |
280 | ["crossDay"] = function(self, actType, notify) | 303 | ["crossDay"] = function(self, actType, notify) |
281 | - print("cross day sell food") | ||
282 | self.owner:sendMail(MailId.ActSellFood) | 304 | self.owner:sendMail(MailId.ActSellFood) |
283 | end, | 305 | end, |
284 | } | 306 | } |
@@ -313,7 +335,6 @@ activityFunc[Activity.ActivityType.OpenBox] = { | @@ -313,7 +335,6 @@ activityFunc[Activity.ActivityType.OpenBox] = { | ||
313 | -- ["close"] = function(self, actType, notify) | 335 | -- ["close"] = function(self, actType, notify) |
314 | -- end, | 336 | -- end, |
315 | ["crossDay"] = function(self, actType, notify) | 337 | ["crossDay"] = function(self, actType, notify) |
316 | - print("cross day open box") | ||
317 | self.owner:sendMail(MailId.ActOpenBox) | 338 | self.owner:sendMail(MailId.ActOpenBox) |
318 | end, | 339 | end, |
319 | } | 340 | } |
@@ -327,13 +348,38 @@ activityFunc[Activity.ActivityType.PaySignIn] = { | @@ -327,13 +348,38 @@ activityFunc[Activity.ActivityType.PaySignIn] = { | ||
327 | -- end, | 348 | -- end, |
328 | } | 349 | } |
329 | 350 | ||
330 | -function Activity:initActivity(actType, isCrossDay, notify) | 351 | +-- 充值反馈 |
352 | +activityFunc[Activity.ActivityType.PayBack] = { | ||
353 | + ["check"] = function(self, actType, notify, twd) -- 检查 | ||
354 | + local oldVal = self:getActData(actType) or 0 | ||
355 | + local newVal = oldVal + twd | ||
356 | + local gift, checkPoint = self.owner:getPaybackReward(oldVal, newVal) | ||
357 | + if gift ~= "" then | ||
358 | + local strCp = table.concat(checkPoint ,"、") | ||
359 | + self.owner:sendMail(MailId.PayBackAward, nil, gift, {newVal, strCp}) | ||
360 | + end | ||
361 | + self:updateActData(actType, newVal, not notify) | ||
362 | + end, | ||
363 | + ["init"] = function(self, actType, isCrossDay, notify) | ||
364 | + self:updateActData(actType, {}, not notify) | ||
365 | + end, | ||
366 | + -- ["close"] = function(self, actType, notify) | ||
367 | + -- end, | ||
368 | +} | ||
369 | + | ||
370 | +function Activity:initActivity(actId, isCrossDay, notify) | ||
371 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
372 | + if not actData then return end | ||
373 | + local actType = actData.showType | ||
331 | if activityFunc[actType] and activityFunc[actType]['close'] then | 374 | if activityFunc[actType] and activityFunc[actType]['close'] then |
332 | activityFunc[actType]["init"](self, actType, isCrossDay, notify) | 375 | activityFunc[actType]["init"](self, actType, isCrossDay, notify) |
333 | end | 376 | end |
334 | end | 377 | end |
335 | 378 | ||
336 | -function Activity:closeActivity(actType, notify, notUpdateAct) | 379 | +function Activity:closeActivity(actId, notify, notUpdateAct) |
380 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
381 | + if not actData then return end | ||
382 | + local actType = actData.showType | ||
337 | if activityFunc[actType] and activityFunc[actType]['close'] then | 383 | if activityFunc[actType] and activityFunc[actType]['close'] then |
338 | activityFunc[actType]["close"](self, actType, notify) | 384 | activityFunc[actType]["close"](self, actType, notify) |
339 | end | 385 | end |
@@ -343,8 +389,10 @@ function Activity:closeActivity(actType, notify, notUpdateAct) | @@ -343,8 +389,10 @@ function Activity:closeActivity(actType, notify, notUpdateAct) | ||
343 | end | 389 | end |
344 | 390 | ||
345 | function Activity:refreshDailyData(notify) | 391 | function Activity:refreshDailyData(notify) |
346 | - for actType, status in pairs(self._isOpen) do | ||
347 | - if status then | 392 | + for actId, status in pairs(self._isOpen) do |
393 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
394 | + if status and actData then | ||
395 | + local actType = actData.showType | ||
348 | if activityFunc[actType] and activityFunc[actType]['crossDay'] then | 396 | if activityFunc[actType] and activityFunc[actType]['crossDay'] then |
349 | activityFunc[actType]["crossDay"](self, actType, notify) | 397 | activityFunc[actType]["crossDay"](self, actType, notify) |
350 | end | 398 | end |
@@ -380,10 +428,12 @@ end | @@ -380,10 +428,12 @@ end | ||
380 | 428 | ||
381 | -- 获取活动卡池id | 429 | -- 获取活动卡池id |
382 | function Activity:getActivityPool(mainType, subType) | 430 | function Activity:getActivityPool(mainType, subType) |
383 | - if not self:isOpen(Activity.ActivityType.SsrUpPoolChange) then | 431 | + local open, actId = self:isOpen(Activity.ActivityType.SsrUpPoolChange) |
432 | + if not open then | ||
433 | + --if not self:isOpen(Activity.ActivityType.SsrUpPoolChange) then | ||
384 | return 0 | 434 | return 0 |
385 | end | 435 | end |
386 | - local actData = csvdb["activity_ctrlCsv"][Activity.ActivityType.SsrUpPoolChange] | 436 | + local actData = csvdb["activity_ctrlCsv"][actId] |
387 | if not actData then return 0 end | 437 | if not actData then return 0 end |
388 | 438 | ||
389 | local poolMap = actData.condition2:toMap(true, "=") | 439 | local poolMap = actData.condition2:toMap(true, "=") |
@@ -407,9 +457,9 @@ function Activity:getPaySignReward() | @@ -407,9 +457,9 @@ function Activity:getPaySignReward() | ||
407 | 457 | ||
408 | local diffDay = diffFromOpen() + 1 | 458 | local diffDay = diffFromOpen() + 1 |
409 | 459 | ||
410 | - local curData = self.activity:getActData("PaySignIn") | 460 | + local curData = self:getActData("PaySignIn") |
411 | local reward, change = {} | 461 | local reward, change = {} |
412 | - for day, csvData in ipairs(csvdb["pay_signInCsv"]) do | 462 | + for day, csvData in pairs(csvdb["pay_signInCsv"]) do |
413 | if day <= diffDay then | 463 | if day <= diffDay then |
414 | if not curData[day] then | 464 | if not curData[day] then |
415 | curData[day] = 1 | 465 | curData[day] = 1 |
src/models/Email.lua
@@ -49,7 +49,7 @@ function Email:data() | @@ -49,7 +49,7 @@ function Email:data() | ||
49 | if emailData then | 49 | if emailData then |
50 | -- 如果内容是直接插入到数据库 | 50 | -- 如果内容是直接插入到数据库 |
51 | if content == "" and emailData.body ~= "" then | 51 | if content == "" and emailData.body ~= "" then |
52 | - content = io.readfile("src/" .. emailData.body) | 52 | + content = io.readfile("src/" .. emailData.body) or "" |
53 | content = content:format(table.unpack(contentPms)) | 53 | content = content:format(table.unpack(contentPms)) |
54 | end | 54 | end |
55 | 55 |
src/models/HeroPlugin.lua
@@ -3,7 +3,7 @@ local HeroPlugin = {} | @@ -3,7 +3,7 @@ local HeroPlugin = {} | ||
3 | 3 | ||
4 | function HeroPlugin.bind(Hero) | 4 | function HeroPlugin.bind(Hero) |
5 | 5 | ||
6 | - function Hero:log(contents) | 6 | + function Hero:mylog(contents) |
7 | contents = contents or {} | 7 | contents = contents or {} |
8 | if contents["cint1"] or contents["cint2"] or contents["cint3"] then | 8 | if contents["cint1"] or contents["cint2"] or contents["cint3"] then |
9 | print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback()) | 9 | print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback()) |
@@ -11,7 +11,7 @@ function HeroPlugin.bind(Hero) | @@ -11,7 +11,7 @@ function HeroPlugin.bind(Hero) | ||
11 | contents["cint1"] = self:getProperty("id") | 11 | contents["cint1"] = self:getProperty("id") |
12 | contents["cint2"] = self:getProperty("type") | 12 | contents["cint2"] = self:getProperty("type") |
13 | 13 | ||
14 | - self.owner:log("hero_action", contents) | 14 | + self.owner:mylog("hero_action", contents) |
15 | end | 15 | end |
16 | 16 | ||
17 | function Hero:getMaxLevel() | 17 | function Hero:getMaxLevel() |
src/models/Role.lua
@@ -29,6 +29,13 @@ function Role:ctor( properties ) | @@ -29,6 +29,13 @@ function Role:ctor( properties ) | ||
29 | self.activity = nil | 29 | self.activity = nil |
30 | self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节 | 30 | self.advElChapter = tonum(redisproxy:hget("adv_season", "chapter"), globalCsv.adv_endless_default_chapter) -- 无尽模式记录的赛季对应章节 |
31 | self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳 | 31 | self.advOverTime = tonum(redisproxy:hget("adv_season", "overTime")) -- 无尽模式关闭时间戳 |
32 | + if self.advOverTime == 0 then | ||
33 | + local now = skynet.timex() | ||
34 | + if math.floor(now / (3600 * 24 * 7)) % 2 == 1 then | ||
35 | + self.advOverTime = 3600 * 24 * 7 | ||
36 | + end | ||
37 | + self.advOverTime = self.advOverTime + specMonday(now) + 3600 * 24 * 6 | ||
38 | + end | ||
32 | self.sendMailFlag = false --发送邮件标识 | 39 | self.sendMailFlag = false --发送邮件标识 |
33 | end | 40 | end |
34 | 41 | ||
@@ -149,6 +156,7 @@ Role.schema = { | @@ -149,6 +156,7 @@ Role.schema = { | ||
149 | battlePoint = {"number", 0}, -- 赛季卡使用的活跃点 | 156 | battlePoint = {"number", 0}, -- 赛季卡使用的活跃点 |
150 | 157 | ||
151 | rmbC = {"number", 0}, -- 人民币重置额 | 158 | rmbC = {"number", 0}, -- 人民币重置额 |
159 | + twdC = {"number", 0}, -- 台币总充值金额 | ||
152 | 160 | ||
153 | emailSync = {"number", 0}, -- 已经同步到的邮件Id | 161 | emailSync = {"number", 0}, -- 已经同步到的邮件Id |
154 | 162 | ||
@@ -373,6 +381,7 @@ function Role:data() | @@ -373,6 +381,7 @@ function Role:data() | ||
373 | battlePoint = self:getProperty("battlePoint"), | 381 | battlePoint = self:getProperty("battlePoint"), |
374 | 382 | ||
375 | rmbC = self:getProperty("rmbC"), | 383 | rmbC = self:getProperty("rmbC"), |
384 | + twdC = self:getProperty("twdC"), | ||
376 | repayHero = self:getProperty("repayHero"), | 385 | repayHero = self:getProperty("repayHero"), |
377 | newerDraw = self:getProperty("newerDraw"), | 386 | newerDraw = self:getProperty("newerDraw"), |
378 | floorHero = self:getProperty("floorHero"), | 387 | floorHero = self:getProperty("floorHero"), |
@@ -384,7 +393,8 @@ function Role:data() | @@ -384,7 +393,8 @@ function Role:data() | ||
384 | chatline = self:getProperty("chatline"), | 393 | chatline = self:getProperty("chatline"), |
385 | 394 | ||
386 | downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励 | 395 | downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励 |
387 | - feedback = self:getProperty("feedback") | 396 | + feedback = self:getProperty("feedback"), |
397 | + ctime = self:getProperty("ctime"), | ||
388 | } | 398 | } |
389 | end | 399 | end |
390 | 400 |
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 | 100 购买/兑换行为 | 5 | 100 购买/兑换行为 |
@@ -40,6 +41,7 @@ local ItemReason = { | @@ -40,6 +41,7 @@ local ItemReason = { | ||
40 | towerCount = 126, -- 电波塔次数 | 41 | towerCount = 126, -- 电波塔次数 |
41 | freeGift = 127, -- 免费礼包 | 42 | freeGift = 127, -- 免费礼包 |
42 | exploreCommand = 128, -- 探索指令 | 43 | exploreCommand = 128, -- 探索指令 |
44 | + drawHeroExtraReward = 129, -- 抽卡阶段奖励 | ||
43 | 45 | ||
44 | 46 | ||
45 | advHang = 301, -- 拾荒挂机 | 47 | advHang = 301, -- 拾荒挂机 |
@@ -60,6 +62,7 @@ local ItemReason = { | @@ -60,6 +62,7 @@ local ItemReason = { | ||
60 | finishTask = 403, -- 任务 | 62 | finishTask = 403, -- 任务 |
61 | taskActive = 404, -- 完成活跃任务 | 63 | taskActive = 404, -- 完成活跃任务 |
62 | advMainTask = 405, -- 拾荒主线 | 64 | advMainTask = 405, -- 拾荒主线 |
65 | + chatline = 406, --查看chatline | ||
63 | 66 | ||
64 | finishAchive = 601, -- 完成成就 | 67 | finishAchive = 601, -- 完成成就 |
65 | advAchiev = 602, -- 拾荒成就 | 68 | advAchiev = 602, -- 拾荒成就 |
@@ -90,7 +93,8 @@ local ItemReason = { | @@ -90,7 +93,8 @@ local ItemReason = { | ||
90 | dinerBuildUp = 1108, -- 建筑升级 | 93 | dinerBuildUp = 1108, -- 建筑升级 |
91 | removeSell = 1109, -- 移除售卖 | 94 | removeSell = 1109, -- 移除售卖 |
92 | dinerSell = 1110, -- 餐饮售卖 | 95 | dinerSell = 1110, -- 餐饮售卖 |
93 | - | 96 | + dinerShop = 1111, -- 餐厅商店 |
97 | + dinerSellQ = 1112, -- 餐厅快速 | ||
94 | -- 英雄 | 98 | -- 英雄 |
95 | heroLevelUp = 1201, -- 英雄升级 | 99 | heroLevelUp = 1201, -- 英雄升级 |
96 | heroBreak = 1202, -- 英雄突破 | 100 | heroBreak = 1202, -- 英雄突破 |
@@ -102,6 +106,13 @@ local ItemReason = { | @@ -102,6 +106,13 @@ local ItemReason = { | ||
102 | unlockPool = 1208, -- 解锁英雄定向抽卡池 | 106 | unlockPool = 1208, -- 解锁英雄定向抽卡池 |
103 | downloadCv = 1209, -- 下载 cv包奖励 | 107 | downloadCv = 1209, -- 下载 cv包奖励 |
104 | refer = 1210, -- 穿戴 | 108 | refer = 1210, -- 穿戴 |
109 | + | ||
110 | + -- pvp | ||
111 | + pvpCHead = 1301, -- pvp 跨服竞技场头像 | ||
112 | + | ||
113 | + --adv | ||
114 | + chooseEvent = 1351, -- 冒险选择 | ||
115 | + clickTrader = 1352, -- 冒险商店 | ||
105 | } | 116 | } |
106 | 117 | ||
107 | 118 | ||
@@ -197,10 +208,9 @@ local MethodType = { | @@ -197,10 +208,9 @@ local MethodType = { | ||
197 | mission_strength = true, -- 消耗的体力或次数 | 208 | mission_strength = true, -- 消耗的体力或次数 |
198 | mission_score = true, -- 本局分数,PVP玩法记录为对战后积分,无得分的填0 | 209 | mission_score = true, -- 本局分数,PVP玩法记录为对战后积分,无得分的填0 |
199 | mission_cleartype = true, -- 1正常通关;2代理拾荒 | 210 | mission_cleartype = true, -- 1正常通关;2代理拾荒 |
200 | - mission_rank = true, -- 对战后排名,适用于PVP玩法和电波塔,其他玩法留空 | 211 | + mission_rank = "auto", -- 对战后排名,适用于PVP玩法和电波塔,其他玩法留空 |
201 | misson_monsterkill = "json", -- 击杀怪物ID和数量,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | 212 | misson_monsterkill = "json", -- 击杀怪物ID和数量,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
202 | misson_teamskill = "json", -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..} | 213 | misson_teamskill = "json", -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..} |
203 | - misson_teambond = "json", -- 编队羁绊和羁绊等级,json格式记录,{"bondid1":1,"bondid2":2,………..} | ||
204 | }, | 214 | }, |
205 | residence_reward = { --玩家挂机或排名奖励 | 215 | residence_reward = { --玩家挂机或排名奖励 |
206 | mission_threadid = true, --大关卡ID | 216 | mission_threadid = true, --大关卡ID |
@@ -214,6 +224,7 @@ local MethodType = { | @@ -214,6 +224,7 @@ local MethodType = { | ||
214 | hero_id = true, --英雄ID | 224 | hero_id = true, --英雄ID |
215 | hero_rise_cost = "json", --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} | 225 | hero_rise_cost = "json", --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
216 | hero_rise_score = true, --英雄觉醒后评分提升 | 226 | hero_rise_score = true, --英雄觉醒后评分提升 |
227 | + hero_rise_scoreget = true, -- 提升的评分 | ||
217 | hero_rise_result = "json", --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} | 228 | hero_rise_result = "json", --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} |
218 | }, | 229 | }, |
219 | hero_upgrade = { --英雄升级 | 230 | hero_upgrade = { --英雄升级 |
@@ -235,6 +246,7 @@ local MethodType = { | @@ -235,6 +246,7 @@ local MethodType = { | ||
235 | hero_talent_cost = "json", -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} | 246 | hero_talent_cost = "json", -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
236 | hero_talent_levelbef = true, -- 英雄技能升级前等级 | 247 | hero_talent_levelbef = true, -- 英雄技能升级前等级 |
237 | hero_talent_level = true, -- 英雄技能升级后等级 | 248 | hero_talent_level = true, -- 英雄技能升级后等级 |
249 | + hero_talent_id = true, -- 天赋id | ||
238 | }, | 250 | }, |
239 | hero_jewel = { --英雄铭文 | 251 | hero_jewel = { --英雄铭文 |
240 | hero_id = true, -- 英雄ID | 252 | hero_id = true, -- 英雄ID |
@@ -266,6 +278,7 @@ local MethodType = { | @@ -266,6 +278,7 @@ local MethodType = { | ||
266 | gacha_times = true, -- 抽卡次数 | 278 | gacha_times = true, -- 抽卡次数 |
267 | gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | 279 | gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
268 | currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} | 280 | currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
281 | + gacha_cnt = true, -- 保底计数 | ||
269 | }, | 282 | }, |
270 | equip_wear = { --装备穿戴与卸载 | 283 | equip_wear = { --装备穿戴与卸载 |
271 | hero_id = true, --英雄ID | 284 | hero_id = true, --英雄ID |
@@ -283,7 +296,7 @@ local MethodType = { | @@ -283,7 +296,7 @@ local MethodType = { | ||
283 | equip_upgrade_amount = true, -- 升级获取的装备数量 | 296 | equip_upgrade_amount = true, -- 升级获取的装备数量 |
284 | equip_upgrade_usedid = true, -- 升级消耗的装备ID | 297 | equip_upgrade_usedid = true, -- 升级消耗的装备ID |
285 | equip_upgrade_cost = true, -- 升级操作消耗装备数量 | 298 | equip_upgrade_cost = true, -- 升级操作消耗装备数量 |
286 | - equip_upgrade_current = true, -- 升级操作消耗货币数量 | 299 | + equip_upgrade_current = "json", -- 升级操作消耗货币数量 |
287 | }, | 300 | }, |
288 | carriage_dismantle = { --物资拆解 | 301 | carriage_dismantle = { --物资拆解 |
289 | item_id = true, -- 道具id | 302 | item_id = true, -- 道具id |
@@ -354,7 +367,6 @@ local MethodType = { | @@ -354,7 +367,6 @@ local MethodType = { | ||
354 | --]] | 367 | --]] |
355 | friend_opt = { --好友操作 | 368 | friend_opt = { --好友操作 |
356 | friend_opt_type = true, -- 好友操作类型,见枚举表中 好友操作类型枚举表 | 369 | friend_opt_type = true, -- 好友操作类型,见枚举表中 好友操作类型枚举表 |
357 | - friend_accountid = true, -- 好友账户id | ||
358 | friend_roleid = true, -- 好友账户下的角色id | 370 | friend_roleid = true, -- 好友账户下的角色id |
359 | friend_cnt = true, -- 操作后好友数量 | 371 | friend_cnt = true, -- 操作后好友数量 |
360 | }, | 372 | }, |
@@ -463,6 +475,178 @@ local function getBaseLog(self) | @@ -463,6 +475,178 @@ local function getBaseLog(self) | ||
463 | end | 475 | end |
464 | 476 | ||
465 | 477 | ||
478 | +-- logType | ||
479 | +local LogType = { | ||
480 | + create = "common", | ||
481 | + login = "common", | ||
482 | + logout = "common", | ||
483 | + guide = "common", | ||
484 | + | ||
485 | + in_item = "common", | ||
486 | + out_item = "common", | ||
487 | + in_diamond = "common", | ||
488 | + out_diamond = "common", | ||
489 | + in_hero = "common", | ||
490 | + out_hero = "common", | ||
491 | + in_equip = "common", | ||
492 | + out_equip = "common", | ||
493 | + in_rune = "common", | ||
494 | + out_rune = "common", | ||
495 | + player_exp = "common", | ||
496 | + func_open = "common", | ||
497 | + in_adv = "common", | ||
498 | + out_adv = "common", | ||
499 | + in_artifact = "common", | ||
500 | + | ||
501 | + mail_action = "common", | ||
502 | + role_action = "common", | ||
503 | + hang_action = "common", | ||
504 | + hero_action = "common", | ||
505 | + adv_action = "common", | ||
506 | + rune_action = "common", | ||
507 | + pvp_action = "common", | ||
508 | + diner_action = "common", | ||
509 | + tower_action = "common", | ||
510 | + gm_action = "common", | ||
511 | + act_action = "common", | ||
512 | +} | ||
513 | + | ||
514 | +-- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* | ||
515 | +local Mapping = { | ||
516 | + -- 预留一些数据格式 担心integer 范围不够用 将 通用的int* 全部换为long | ||
517 | + common = { | ||
518 | + desc = "keyword",--索引的短字符串 | ||
519 | + ucode = "keyword",--关联日志对应ucode | ||
520 | + key1 = "keyword", --可索引的短字符串 | ||
521 | + key2 = "keyword", --可索引的短字符串 | ||
522 | + -- 几乎不用的长文本 | ||
523 | + text1 = "text", --长字符串不索引的类型 | ||
524 | + -- 五个不同类型的数字 基本上满足数量要求 尽量从低到高用 | ||
525 | + short1 = "short", | ||
526 | + int1 = "long", | ||
527 | + int2 = "long", | ||
528 | + long1 = "long", | ||
529 | + float1 = "float", | ||
530 | + | ||
531 | + -- 底层使用的 一些参数 | ||
532 | + cint1 = "long", | ||
533 | + cint2 = "long", | ||
534 | + cint3 = "long", | ||
535 | + } | ||
536 | +} | ||
537 | + | ||
538 | +-- 所有的日志都包括的部分 role 里面的信息 -- mapping 信息在 gamelog-role | ||
539 | +local commonRoleField = { | ||
540 | + name = "keyword", | ||
541 | + id = "integer", | ||
542 | + uid = "keyword", | ||
543 | + sid = "short", | ||
544 | + device = "keyword", | ||
545 | + ctime = "integer", | ||
546 | + ltime = "integer", | ||
547 | + level = "short", | ||
548 | + rmbC = "integer", | ||
549 | +} | ||
550 | + | ||
551 | +local function checkType(logType, field, value, ctype) | ||
552 | + local typecheckfunc = { | ||
553 | + keyword = function() | ||
554 | + --长度不超过256 | ||
555 | + if type(value) ~= "string" then | ||
556 | + value = tostring(value) | ||
557 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [keyword], value : %s", logType, field, value)) | ||
558 | + else | ||
559 | + if #value > 256 then | ||
560 | + printError(string.format("LOG ERROR: logType [%s] field [%s] [keyword] type to long. value : %s", logType, field, value)) | ||
561 | + end | ||
562 | + end | ||
563 | + return value | ||
564 | + end, | ||
565 | + text = function() | ||
566 | + if type(value) ~= "string" then | ||
567 | + value = tostring(value) | ||
568 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [text], value : %s", logType, field, value)) | ||
569 | + end | ||
570 | + return value | ||
571 | + end, | ||
572 | + integer = function() | ||
573 | + if type(value) ~= "number" then | ||
574 | + value = tonumber(value) | ||
575 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], value : %s", logType, field, value)) | ||
576 | + end | ||
577 | + if value then | ||
578 | + if math.type(value) ~= "integer" then | ||
579 | + local oldValue = value | ||
580 | + value = math.floor(value) | ||
581 | + if value ~= oldValue then | ||
582 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], is float, value : %s", logType, field, value)) | ||
583 | + end | ||
584 | + end | ||
585 | + if -2147483648 > value or value > 2147483647 then | ||
586 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], too big, value : %s", logType, field, value)) | ||
587 | + value = nil | ||
588 | + end | ||
589 | + end | ||
590 | + return value | ||
591 | + end, | ||
592 | + short = function() | ||
593 | + if type(value) ~= "number" then | ||
594 | + value = tonumber(value) | ||
595 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], value : %s", logType, field, value)) | ||
596 | + end | ||
597 | + if value then | ||
598 | + if math.type(value) ~= "integer" then | ||
599 | + local oldValue = value | ||
600 | + value = math.floor(value) | ||
601 | + if value ~= oldValue then | ||
602 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], is float, value : %s", logType, field, value)) | ||
603 | + end | ||
604 | + end | ||
605 | + | ||
606 | + if -32768 > value or value > 32768 then | ||
607 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], too big, value : %s", logType, field, value)) | ||
608 | + value = nil | ||
609 | + end | ||
610 | + end | ||
611 | + return value | ||
612 | + end, | ||
613 | + long = function() | ||
614 | + if type(value) ~= "number" then | ||
615 | + value = tonumber(value) | ||
616 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], value : %s", logType, field, value)) | ||
617 | + end | ||
618 | + if value then | ||
619 | + if math.type(value) ~= "integer" then | ||
620 | + local oldValue = value | ||
621 | + value = math.floor(value) | ||
622 | + if type(value) ~= "integer" then | ||
623 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], too big, value : %s", logType, field, value)) | ||
624 | + value = nil | ||
625 | + elseif value ~= oldValue then | ||
626 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], is float, value : %s", logType, field, value)) | ||
627 | + end | ||
628 | + end | ||
629 | + end | ||
630 | + return value | ||
631 | + end, | ||
632 | + float = function() | ||
633 | + if type(value) ~= "number" then | ||
634 | + value = tonumber(value) | ||
635 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [float], value : %s", logType, field, value)) | ||
636 | + end | ||
637 | + return value | ||
638 | + end, | ||
639 | + } | ||
640 | + | ||
641 | + if typecheckfunc[ctype] then | ||
642 | + return typecheckfunc[ctype]() | ||
643 | + else | ||
644 | + printError(string.format("LOG ERROR: logType [%s] field [%s] have a new type [%s] need add check.", logType, field, ctype)) | ||
645 | + return nil | ||
646 | + end | ||
647 | +end | ||
648 | + | ||
649 | + | ||
466 | 650 | ||
467 | local RoleLog = {} | 651 | local RoleLog = {} |
468 | function RoleLog.bind(Role) | 652 | function RoleLog.bind(Role) |
@@ -490,14 +674,15 @@ function RoleLog.bind(Role) | @@ -490,14 +674,15 @@ function RoleLog.bind(Role) | ||
490 | for field, tag in pairs(schema) do | 674 | for field, tag in pairs(schema) do |
491 | if not contents[field] then | 675 | if not contents[field] then |
492 | if tag == "ucode" then | 676 | if tag == "ucode" then |
493 | - contents[field] = self:getActionUcode() | 677 | + doc[field] = self:getActionUcode() |
678 | + elseif tag == "auto" then | ||
494 | else | 679 | else |
495 | printError(string.format("LOG ERROR: logType [%s] lose field [%s].", logType, field)) | 680 | printError(string.format("LOG ERROR: logType [%s] lose field [%s].", logType, field)) |
496 | end | 681 | end |
497 | end | 682 | end |
498 | end | 683 | end |
499 | if not logd then return end | 684 | if not logd then return end |
500 | - pcall(skynet.send, logd, "lua", "log", doc) | 685 | + pcall(skynet.send, logd, "lua", "log", doc, "bi") |
501 | end | 686 | end |
502 | 687 | ||
503 | function Role:logItems(itemId, before, after, log) | 688 | function Role:logItems(itemId, before, after, log) |
@@ -522,12 +707,44 @@ function RoleLog.bind(Role) | @@ -522,12 +707,44 @@ function RoleLog.bind(Role) | ||
522 | action_type = after - before > 0 and 1 or 0, -- 变化类型(玩家获取:1,玩家消耗:0) | 707 | action_type = after - before > 0 and 1 or 0, -- 变化类型(玩家获取:1,玩家消耗:0) |
523 | item_before = before, -- 道具变化前的数量 | 708 | item_before = before, -- 道具变化前的数量 |
524 | item_after = after, -- 道具变化后的数量 | 709 | item_after = after, -- 道具变化后的数量 |
525 | - item_reason = reasonType, -- 道具流动一级原因,如抽卡、装备强化、副本掉落,可参考道具动作类型枚举表 | 710 | + item_reason = reasonType or 0, -- 道具流动一级原因,如抽卡、装备强化、副本掉落,可参考道具动作类型枚举表 |
526 | item_subreason = subreason, -- 道具流动二级原因,抽卡:卡池ID,装备强化:装备ID,副本掉落:副本ID | 711 | item_subreason = subreason, -- 道具流动二级原因,抽卡:卡池ID,装备强化:装备ID,副本掉落:副本ID |
527 | item_other = other, -- 其他(可包含阶数,强化等级,随机属性) | 712 | item_other = other, -- 其他(可包含阶数,强化等级,随机属性) |
528 | }) | 713 | }) |
529 | end | 714 | end |
530 | 715 | ||
716 | + function Role:mylog(logType, contents) | ||
717 | + contents = contents or {} | ||
718 | + local _logType = LogType[logType] | ||
719 | + if not _logType then | ||
720 | + printError(string.format("LOG ERROR: new logType [%s] need Add Maping.", logType)) | ||
721 | + return | ||
722 | + end | ||
723 | + local doc = {} | ||
724 | + for field, ctype in pairs(commonRoleField) do | ||
725 | + if contents[field] then | ||
726 | + printError(string.format("LOG ERROR: logType [%s] had field [%s] overwrite default.", logType, field)) | ||
727 | + end | ||
728 | + doc[field] = checkType("commonRoleField", field, self:getProperty(field), ctype) | ||
729 | + end | ||
730 | + | ||
731 | + local mapping = Mapping[_logType] | ||
732 | + if mapping["ucode"] and not contents["ucode"] then | ||
733 | + contents["ucode"] = self:getActionUcode() | ||
734 | + end | ||
735 | + for field, value in pairs(contents) do | ||
736 | + local ftype = mapping[field] | ||
737 | + if ftype then | ||
738 | + doc[field] = checkType(logType, field, value, ftype) | ||
739 | + else | ||
740 | + printError(string.format("LOG ERROR: logType [%s] have new field [%s] no type in mapping.", logType, field)) | ||
741 | + end | ||
742 | + end | ||
743 | + doc["@type"] = logType | ||
744 | + if not logd then return end | ||
745 | + pcall(skynet.send, logd, "lua", "log", doc, "log") | ||
746 | + end | ||
747 | + | ||
531 | 748 | ||
532 | function Role:startActionUcode() | 749 | function Role:startActionUcode() |
533 | if not self._uniqueCount then | 750 | if not self._uniqueCount then |
@@ -548,5 +765,6 @@ function RoleLog.bind(Role) | @@ -548,5 +765,6 @@ function RoleLog.bind(Role) | ||
548 | end | 765 | end |
549 | 766 | ||
550 | 767 | ||
768 | + | ||
551 | end | 769 | end |
552 | return RoleLog | 770 | return RoleLog |
553 | \ No newline at end of file | 771 | \ No newline at end of file |
src/models/RolePlugin.lua
@@ -51,6 +51,7 @@ function RolePlugin.bind(Role) | @@ -51,6 +51,7 @@ function RolePlugin.bind(Role) | ||
51 | end | 51 | end |
52 | 52 | ||
53 | local function _award(self, itemId, count, params) | 53 | local function _award(self, itemId, count, params) |
54 | + local count = math.floor(count) | ||
54 | local pms = clone(params) | 55 | local pms = clone(params) |
55 | local itemData = csvdb["itemCsv"][itemId] | 56 | local itemData = csvdb["itemCsv"][itemId] |
56 | if not itemData then -- 加一层保护 | 57 | if not itemData then -- 加一层保护 |
@@ -202,7 +203,7 @@ function RolePlugin.bind(Role) | @@ -202,7 +203,7 @@ function RolePlugin.bind(Role) | ||
202 | function Role:changeHead(id, notNotify) | 203 | function Role:changeHead(id, notNotify) |
203 | self:updateProperty({field = "headId" ,value = id, notNotify = notNotify}) | 204 | self:updateProperty({field = "headId" ,value = id, notNotify = notNotify}) |
204 | self:changeCrossServerPvpSelfInfo("headId") | 205 | self:changeCrossServerPvpSelfInfo("headId") |
205 | - self:log("role_action", {desc = "changeHead", int1 = id}) | 206 | + self:mylog("role_action", {desc = "changeHead", int1 = id}) |
206 | end | 207 | end |
207 | 208 | ||
208 | function Role:addPlayExp(addExp, params) | 209 | function Role:addPlayExp(addExp, params) |
@@ -229,13 +230,28 @@ function RolePlugin.bind(Role) | @@ -229,13 +230,28 @@ function RolePlugin.bind(Role) | ||
229 | self:log("setLevel", { | 230 | self:log("setLevel", { |
230 | level_before = oldLevel, | 231 | level_before = oldLevel, |
231 | level_changemain = log.desc, | 232 | level_changemain = log.desc, |
232 | - level_changedetail = log.sub or "", | 233 | + level_changedetail = log.int1 or 0, |
233 | level_reward = {}, | 234 | level_reward = {}, |
234 | }) | 235 | }) |
235 | else | 236 | else |
236 | print("addPlayExp no log ", debug.traceback()) | 237 | print("addPlayExp no log ", debug.traceback()) |
237 | end | 238 | end |
239 | + end | ||
240 | + | ||
241 | + if params.log then | ||
242 | + local log = clone(params.log) | ||
243 | + if log["cint1"] or log["cint2"] then | ||
244 | + print("addPlayExp error log have cint1 or cint2 or cint3", debug.traceback()) | ||
245 | + end | ||
238 | 246 | ||
247 | + | ||
248 | + log["cint1"] = addExp | ||
249 | + log["cint2"] = newExp | ||
250 | + log["cint3"] = level | ||
251 | + | ||
252 | + self:mylog("player_exp", log) | ||
253 | + else | ||
254 | + print("addPlayExp no log ", debug.traceback()) | ||
239 | end | 255 | end |
240 | 256 | ||
241 | self:updateProperties({level = level, exp = newExp}) | 257 | self:updateProperties({level = level, exp = newExp}) |
@@ -244,6 +260,7 @@ function RolePlugin.bind(Role) | @@ -244,6 +260,7 @@ function RolePlugin.bind(Role) | ||
244 | 260 | ||
245 | function Role:addItem(params) | 261 | function Role:addItem(params) |
246 | params = params or {} | 262 | params = params or {} |
263 | + params.count = math.floor(params.count or 0) | ||
247 | if params.itemId == ItemId.Diamond then | 264 | if params.itemId == ItemId.Diamond then |
248 | self:gainDiamond(params) | 265 | self:gainDiamond(params) |
249 | return | 266 | return |
@@ -259,6 +276,21 @@ function RolePlugin.bind(Role) | @@ -259,6 +276,21 @@ function RolePlugin.bind(Role) | ||
259 | end | 276 | end |
260 | 277 | ||
261 | self:logItems(params.itemId, origin, nums, params.log) | 278 | self:logItems(params.itemId, origin, nums, params.log) |
279 | + if params.log then | ||
280 | + local log = clone(params.log) | ||
281 | + if log["cint1"] or log["cint2"] then | ||
282 | + print("addItem error log have cint1 or cint2 ", debug.traceback()) | ||
283 | + end | ||
284 | + log["cint1"] = params.itemId | ||
285 | + log["cint2"] = math.abs(params.count) | ||
286 | + if params.count <= 0 then | ||
287 | + self:mylog("out_item", log) | ||
288 | + else | ||
289 | + self:mylog("in_item", log) | ||
290 | + end | ||
291 | + else | ||
292 | + print("addItem no log ", debug.traceback()) | ||
293 | + end | ||
262 | 294 | ||
263 | self:setProperty("items", items) | 295 | self:setProperty("items", items) |
264 | if not params.notNotify then | 296 | if not params.notNotify then |
@@ -269,7 +301,7 @@ function RolePlugin.bind(Role) | @@ -269,7 +301,7 @@ function RolePlugin.bind(Role) | ||
269 | function Role:checkItemEnough(itemCountT) | 301 | function Role:checkItemEnough(itemCountT) |
270 | local less = {} | 302 | local less = {} |
271 | if not next(itemCountT) then | 303 | if not next(itemCountT) then |
272 | - return false, less | 304 | + return true, less |
273 | end | 305 | end |
274 | for itemId, count in pairs(itemCountT) do | 306 | for itemId, count in pairs(itemCountT) do |
275 | if count <= 0 then | 307 | if count <= 0 then |
@@ -329,11 +361,22 @@ function RolePlugin.bind(Role) | @@ -329,11 +361,22 @@ function RolePlugin.bind(Role) | ||
329 | end | 361 | end |
330 | 362 | ||
331 | self:logItems(ItemId.Diamond, origin, count, params.log) | 363 | self:logItems(ItemId.Diamond, origin, count, params.log) |
364 | + if params.log then | ||
365 | + local log = clone(params.log) | ||
366 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
367 | + print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
368 | + end | ||
369 | + log["cint1"] = origin | ||
370 | + log["cint2"] = count | ||
371 | + self:mylog("in_diamond", log) | ||
372 | + else | ||
373 | + print("gainDiamond no log ", debug.traceback()) | ||
374 | + end | ||
375 | + | ||
332 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) | 376 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) |
333 | return true | 377 | return true |
334 | end | 378 | end |
335 | 379 | ||
336 | - | ||
337 | function Role:costDiamond(params) | 380 | function Role:costDiamond(params) |
338 | if not params or type(params) ~= "table" then return false end | 381 | if not params or type(params) ~= "table" then return false end |
339 | local count = tonum(params.count) | 382 | local count = tonum(params.count) |
@@ -368,6 +411,17 @@ function RolePlugin.bind(Role) | @@ -368,6 +411,17 @@ function RolePlugin.bind(Role) | ||
368 | 411 | ||
369 | 412 | ||
370 | self:logItems(ItemId.Diamond, origin, count, params.log) | 413 | self:logItems(ItemId.Diamond, origin, count, params.log) |
414 | + if params.log then | ||
415 | + local log = clone(params.log) | ||
416 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
417 | + print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
418 | + end | ||
419 | + log["cint1"] = origin | ||
420 | + log["cint2"] = count | ||
421 | + self:mylog("out_diamond", log) | ||
422 | + else | ||
423 | + print("costDiamond no log ", debug.traceback()) | ||
424 | + end | ||
371 | 425 | ||
372 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) | 426 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) |
373 | return true | 427 | return true |
@@ -390,7 +444,9 @@ function RolePlugin.bind(Role) | @@ -390,7 +444,9 @@ function RolePlugin.bind(Role) | ||
390 | type= heroType, | 444 | type= heroType, |
391 | wakeL = globalCsv.unit_wake_initLevel[unitData.rare], | 445 | wakeL = globalCsv.unit_wake_initLevel[unitData.rare], |
392 | } | 446 | } |
393 | - | 447 | + if heroInfo.wakeL == 3 then |
448 | + self:checkTaskEnter("WakeCG", {heroType = heroType}) | ||
449 | + end | ||
394 | local newHero = require("models.Hero").new(heroInfo) | 450 | local newHero = require("models.Hero").new(heroInfo) |
395 | newHero:create() | 451 | newHero:create() |
396 | newHero.owner = self | 452 | newHero.owner = self |
@@ -406,6 +462,17 @@ function RolePlugin.bind(Role) | @@ -406,6 +462,17 @@ function RolePlugin.bind(Role) | ||
406 | 462 | ||
407 | self:logItems(heroType + ItemStartId.Hero, 0, 1, params.log) | 463 | self:logItems(heroType + ItemStartId.Hero, 0, 1, params.log) |
408 | 464 | ||
465 | + if params.log then | ||
466 | + local log = clone(params.log) | ||
467 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
468 | + print("addHero error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
469 | + end | ||
470 | + log["cint1"] = heroId | ||
471 | + log["cint2"] = heroType | ||
472 | + self:mylog("in_hero", log) | ||
473 | + else | ||
474 | + print("addHero no log ", debug.traceback()) | ||
475 | + end | ||
409 | return true, newHero | 476 | return true, newHero |
410 | end | 477 | end |
411 | 478 | ||
@@ -516,6 +583,22 @@ function RolePlugin.bind(Role) | @@ -516,6 +583,22 @@ function RolePlugin.bind(Role) | ||
516 | self:setProperty("equips", equips) | 583 | self:setProperty("equips", equips) |
517 | 584 | ||
518 | self:logItems(equipCsv.id, oldCount, curCount, pms.log) | 585 | self:logItems(equipCsv.id, oldCount, curCount, pms.log) |
586 | + if pms.log then | ||
587 | + local log = clone(pms.log) | ||
588 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
589 | + print("addEquip error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
590 | + end | ||
591 | + log["cint1"] = equipType | ||
592 | + log["cint2"] = equipLv | ||
593 | + log["cint3"] = math.abs(count) | ||
594 | + if count < 0 then | ||
595 | + self:mylog("out_equip", log) | ||
596 | + else | ||
597 | + self:mylog("in_equip", log) | ||
598 | + end | ||
599 | + else | ||
600 | + print("addEquip no log ", debug.traceback()) | ||
601 | + end | ||
519 | 602 | ||
520 | if not pms.notNotify then | 603 | if not pms.notNotify then |
521 | self:changeUpdates({{type = "equips", field = {equipType, equipLv}, value = curCount, isOnlyToC = true}}) -- 通知客户端 | 604 | self:changeUpdates({{type = "equips", field = {equipType, equipLv}, value = curCount, isOnlyToC = true}}) -- 通知客户端 |
@@ -576,6 +659,20 @@ function RolePlugin.bind(Role) | @@ -576,6 +659,20 @@ function RolePlugin.bind(Role) | ||
576 | self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) | 659 | self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) |
577 | 660 | ||
578 | self:logItems(params.id, 0, 1, params.log) | 661 | self:logItems(params.id, 0, 1, params.log) |
662 | + if params.log then | ||
663 | + local log = clone(params.log) | ||
664 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
665 | + print("addRune error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
666 | + end | ||
667 | + | ||
668 | + log["cint1"] = runeUid | ||
669 | + log["cint2"] = params.type | ||
670 | + log["cint3"] = params.id | ||
671 | + | ||
672 | + self:mylog("in_rune", log) | ||
673 | + else | ||
674 | + print("addRune no log ", debug.traceback()) | ||
675 | + end | ||
579 | 676 | ||
580 | return 0, newRune | 677 | return 0, newRune |
581 | else | 678 | else |
@@ -592,6 +689,20 @@ function RolePlugin.bind(Role) | @@ -592,6 +689,20 @@ function RolePlugin.bind(Role) | ||
592 | if rune and rune:getProperty("refer") == 0 then | 689 | if rune and rune:getProperty("refer") == 0 then |
593 | 690 | ||
594 | self:logItems(rune:getProperty("id"), 1, 0, params.log) | 691 | self:logItems(rune:getProperty("id"), 1, 0, params.log) |
692 | + if params.log then | ||
693 | + local log = clone(params.log) | ||
694 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
695 | + print("delRunes error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
696 | + end | ||
697 | + | ||
698 | + log["cint1"] = runeId | ||
699 | + log["cint2"] = rune:getProperty("type") | ||
700 | + log["cint3"] = rune:getProperty("id") | ||
701 | + | ||
702 | + self:mylog("out_rune", log) | ||
703 | + else | ||
704 | + print("delRunes no log ", debug.traceback()) | ||
705 | + end | ||
595 | 706 | ||
596 | self.runeBag[runeId] = nil | 707 | self.runeBag[runeId] = nil |
597 | table.insert(bDel, runeId) | 708 | table.insert(bDel, runeId) |
@@ -652,7 +763,7 @@ function RolePlugin.bind(Role) | @@ -652,7 +763,7 @@ function RolePlugin.bind(Role) | ||
652 | end | 763 | end |
653 | if heartWarning < 50 and heartWarning % 5 == 0 then | 764 | if heartWarning < 50 and heartWarning % 5 == 0 then |
654 | self:sendGmMsg("server_accountBanned_warning") | 765 | self:sendGmMsg("server_accountBanned_warning") |
655 | - self:log("role_action",{desc = "heartWarning", int1 = heartWarning}) | 766 | + self:mylog("role_action",{desc = "heartWarning", int1 = heartWarning}) |
656 | end | 767 | end |
657 | end | 768 | end |
658 | 769 | ||
@@ -665,11 +776,11 @@ function RolePlugin.bind(Role) | @@ -665,11 +776,11 @@ function RolePlugin.bind(Role) | ||
665 | self:setProperty("banType", 0) | 776 | self:setProperty("banType", 0) |
666 | self:setProperty("heartWarning", 0) | 777 | self:setProperty("heartWarning", 0) |
667 | 778 | ||
668 | - self:log("role_action", {desc = "ban_rm"}) | 779 | + self:mylog("role_action", {desc = "ban_rm"}) |
669 | else | 780 | else |
670 | self:setProperty("banTime", now + 86400 * time) | 781 | self:setProperty("banTime", now + 86400 * time) |
671 | self:setProperty("banType", banType) | 782 | self:setProperty("banType", banType) |
672 | - self:log("role_action", {desc = "ban", int1 = time, int2 = banType}) | 783 | + self:mylog("role_action", {desc = "ban", int1 = time, int2 = banType}) |
673 | end | 784 | end |
674 | end | 785 | end |
675 | 786 | ||
@@ -838,6 +949,19 @@ function RolePlugin.bind(Role) | @@ -838,6 +949,19 @@ function RolePlugin.bind(Role) | ||
838 | count = count or 1 | 949 | count = count or 1 |
839 | 950 | ||
840 | self:logItems(func, 0, count, params.log) | 951 | self:logItems(func, 0, count, params.log) |
952 | + if params.log then | ||
953 | + local log = clone(params.log) | ||
954 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
955 | + print("funcOpen error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
956 | + end | ||
957 | + | ||
958 | + log["cint1"] = func | ||
959 | + log["cint2"] = count | ||
960 | + | ||
961 | + self:mylog("func_open", log) | ||
962 | + else | ||
963 | + print("funcOpen no log ", debug.traceback()) | ||
964 | + end | ||
841 | 965 | ||
842 | if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then | 966 | if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then |
843 | local unlockData = csvdb["unlockCsv"][func] | 967 | local unlockData = csvdb["unlockCsv"][func] |
@@ -1393,7 +1517,10 @@ function RolePlugin.bind(Role) | @@ -1393,7 +1517,10 @@ function RolePlugin.bind(Role) | ||
1393 | 1517 | ||
1394 | local order_type = self:getProperty("rmbC") > 0 and 0 or 1 | 1518 | local order_type = self:getProperty("rmbC") > 0 and 0 or 1 |
1395 | local status, reward = self:recharge({ | 1519 | local status, reward = self:recharge({ |
1396 | - id = rechargeId | 1520 | + id = rechargeId, |
1521 | + transactionId = params.transactionId, | ||
1522 | + pay_time = params.pay_time, | ||
1523 | + order = partnerOrderStr, | ||
1397 | }) | 1524 | }) |
1398 | orderObject:setProperty("finishTime", skynet.time()) | 1525 | orderObject:setProperty("finishTime", skynet.time()) |
1399 | orderObject:setProperty("status", "finish") | 1526 | orderObject:setProperty("status", "finish") |
@@ -1413,7 +1540,7 @@ function RolePlugin.bind(Role) | @@ -1413,7 +1540,7 @@ function RolePlugin.bind(Role) | ||
1413 | item_number = 1, -- 购买的道具数量 | 1540 | item_number = 1, -- 购买的道具数量 |
1414 | item_level = 1, -- 购买的道具等级 | 1541 | item_level = 1, -- 购买的道具等级 |
1415 | order_cost = rechargeData.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' | 1542 | order_cost = rechargeData.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' |
1416 | - order_currency = "TWD", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 | 1543 | + order_currency = "CNY", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 |
1417 | order_type = order_type, -- 订单类型,首充记录为1,否则为0 | 1544 | order_type = order_type, -- 订单类型,首充记录为1,否则为0 |
1418 | order_id = params.transactionId, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' | 1545 | order_id = params.transactionId, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' |
1419 | }) | 1546 | }) |
@@ -1451,12 +1578,9 @@ function RolePlugin.bind(Role) | @@ -1451,12 +1578,9 @@ function RolePlugin.bind(Role) | ||
1451 | self:gainDiamond({count = diamondCount, isRecharge = true, log = {desc = "recharge", int1 = id}}) | 1578 | self:gainDiamond({count = diamondCount, isRecharge = true, log = {desc = "recharge", int1 = id}}) |
1452 | elseif rechargeData.shop == 2 then --通行证商店 | 1579 | elseif rechargeData.shop == 2 then --通行证商店 |
1453 | reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) | 1580 | reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) |
1454 | - self.storeData:onBuyCard(rechargeData.type, rechargeData.time) | 1581 | + self.storeData:onBuyCard(rechargeData.type, rechargeData.time, rechargeData.id) |
1455 | elseif rechargeData.shop == 3 then -- 礼包商店 | 1582 | elseif rechargeData.shop == 3 then -- 礼包商店 |
1456 | reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) | 1583 | 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 | else | 1584 | else |
1461 | skynet.error("invalid recharge shop type " .. id) | 1585 | skynet.error("invalid recharge shop type " .. id) |
1462 | return 3 | 1586 | return 3 |
@@ -1466,9 +1590,14 @@ function RolePlugin.bind(Role) | @@ -1466,9 +1590,14 @@ function RolePlugin.bind(Role) | ||
1466 | reward[ItemId.Diamond] = (reward[ItemId.Diamond] or 0) + diamondCount | 1590 | reward[ItemId.Diamond] = (reward[ItemId.Diamond] or 0) + diamondCount |
1467 | end | 1591 | end |
1468 | 1592 | ||
1593 | + self:checkTaskEnter("Pay", {rmb = rechargeData.rmb, twd = rechargeData.twd}) | ||
1594 | + | ||
1469 | -- 累充 | 1595 | -- 累充 |
1470 | local rmb = rechargeData.rmb | 1596 | local rmb = rechargeData.rmb |
1471 | self:updateProperty({field = "rmbC", delta = rmb}) | 1597 | self:updateProperty({field = "rmbC", delta = rmb}) |
1598 | + self:updateProperty({field = "twdC", delta = rechargeData.twd}) | ||
1599 | + | ||
1600 | + self:mylog("role_action", {desc = "recharge", int1 = id, int2 = rmb, key1 = params.transactionId, key2 = params.order, long1 = tonum(params.pay_time, 0)}) | ||
1472 | 1601 | ||
1473 | return nil, reward | 1602 | return nil, reward |
1474 | end | 1603 | end |
@@ -1516,6 +1645,7 @@ function RolePlugin.bind(Role) | @@ -1516,6 +1645,7 @@ function RolePlugin.bind(Role) | ||
1516 | end | 1645 | end |
1517 | self:updateProperty({field = "funcGuide", value = funcGuide}) | 1646 | self:updateProperty({field = "funcGuide", value = funcGuide}) |
1518 | self:log("onGuidePoint", {guild_type = 0, guild_id = master, guild_point = slave, guild_pass = 0}) | 1647 | self:log("onGuidePoint", {guild_type = 0, guild_id = master, guild_point = slave, guild_pass = 0}) |
1648 | + self:mylog("guide", {desc = "guide_new",int1 = master*1000+slave}) | ||
1519 | 1649 | ||
1520 | newerGuide = string.format("%d=%d",master,slave) | 1650 | newerGuide = string.format("%d=%d",master,slave) |
1521 | self:updateProperty({field = "newerGuide", value = newerGuide}) | 1651 | self:updateProperty({field = "newerGuide", value = newerGuide}) |
@@ -1535,6 +1665,84 @@ function RolePlugin.bind(Role) | @@ -1535,6 +1665,84 @@ function RolePlugin.bind(Role) | ||
1535 | self:updateProperty({field = "newerGuide", value = "9999=1"}) | 1665 | self:updateProperty({field = "newerGuide", value = "9999=1"}) |
1536 | end | 1666 | end |
1537 | end | 1667 | end |
1668 | + | ||
1669 | + -- 抽卡阶段奖励 | ||
1670 | + function Role:getDrawCardExtraReward(oldVal, newVal) | ||
1671 | + local reward = nil | ||
1672 | + local maxCount = 0 | ||
1673 | + for k, v in pairs(csvdb["build_extraRewardCsv"]) do | ||
1674 | + if oldVal < k and newVal >= k then | ||
1675 | + reward = v["reward"] or "" | ||
1676 | + end | ||
1677 | + maxCount = k > maxCount and k or maxCount | ||
1678 | + end | ||
1679 | + | ||
1680 | + return reward, (newVal >= maxCount and newVal - maxCount or newVal) | ||
1681 | + end | ||
1682 | + | ||
1683 | + -- 获取下一个挂机关卡id | ||
1684 | + function Role:getNextCarbonId(curId) | ||
1685 | + local diff = math.floor(curId / 10000) | ||
1686 | + local chapterId = math.floor((curId / 100) % 100) | ||
1687 | + local subId = curId % 100 | ||
1688 | + local nextId = curId + 1 | ||
1689 | + local function makeCarbonId(diff, chapterId, subId) | ||
1690 | + return diff * 10000 + chapterId * 100 + subId | ||
1691 | + end | ||
1692 | + if not csvdb["idle_battleCsv"][nextId] then | ||
1693 | + nextId = makeCarbonId(diff, chapterId + 1, 1) | ||
1694 | + if not csvdb["idle_battleCsv"][nextId] then | ||
1695 | + nextId = makeCarbonId(diff + 1, 1, 1) | ||
1696 | + if not csvdb["idle_battleCsv"][nextId] then | ||
1697 | + nextId = 0 | ||
1698 | + end | ||
1699 | + end | ||
1700 | + end | ||
1701 | + | ||
1702 | + return nextId | ||
1703 | + end | ||
1704 | + | ||
1705 | + -- 根据累计充值金额计算奖励档位 | ||
1706 | + function Role:getPaybackReward(oldVal, newVal) | ||
1707 | + local maxVal, diff, extraReward = 0, 0, "" | ||
1708 | + local gift = "" | ||
1709 | + local checkPoint = {} | ||
1710 | + for k, v in pairs(csvdb["rebateCsv"]) do | ||
1711 | + if k > maxVal then | ||
1712 | + maxVal = k | ||
1713 | + end | ||
1714 | + if v.isLoop > diff then | ||
1715 | + diff = v.isLoop | ||
1716 | + extraReward = v.reward | ||
1717 | + end | ||
1718 | + if oldVal < k and newVal > k then | ||
1719 | + gift = gift .. v.reward .. " " | ||
1720 | + | ||
1721 | + table.insert(checkPoint, k) | ||
1722 | + end | ||
1723 | + end | ||
1724 | + if newVal > maxVal then | ||
1725 | + local cnt = 0 | ||
1726 | + local oldCheckPoint = 0 | ||
1727 | + if oldVal < maxVal then | ||
1728 | + cnt = math.floor((newVal - maxVal) / diff) | ||
1729 | + oldCheckPoint = maxVal | ||
1730 | + else | ||
1731 | + cnt = math.floor((newVal - maxVal) / diff) - math.floor((oldVal - maxVal) / diff) | ||
1732 | + oldCheckPoint = maxVal + math.floor((oldVal - maxVal) / diff) * diff | ||
1733 | + end | ||
1734 | + for i = 1, cnt do | ||
1735 | + gift = gift .. extraReward .. " " | ||
1736 | + | ||
1737 | + table.insert(checkPoint, oldCheckPoint + i * diff) | ||
1738 | + end | ||
1739 | + end | ||
1740 | + table.sort(checkPoint, function(a, b) | ||
1741 | + return a < b | ||
1742 | + end) | ||
1743 | + return gift, checkPoint | ||
1744 | + end | ||
1745 | + | ||
1538 | end | 1746 | end |
1539 | 1747 | ||
1540 | return RolePlugin | 1748 | return RolePlugin |
1541 | \ No newline at end of file | 1749 | \ No newline at end of file |
src/models/RoleTask.lua
@@ -12,6 +12,9 @@ local TaskType = { | @@ -12,6 +12,9 @@ local TaskType = { | ||
12 | WakeCG = 7, -- 觉醒到解锁CG - heroType | 12 | WakeCG = 7, -- 觉醒到解锁CG - heroType |
13 | HeroTalent = 8, -- 天赋升级 - heroType alv | 13 | HeroTalent = 8, -- 天赋升级 - heroType alv |
14 | DrawSSR = 9, -- 抽到SSR - count | 14 | DrawSSR = 9, -- 抽到SSR - count |
15 | + HeroLvlCollect = 10, -- 英雄等级收集进度 | ||
16 | + HeroQualityCollect = 11, -- 英雄品质收集进度 | ||
17 | + HeroStarCollect = 12, -- 英雄星级收集进度 | ||
15 | 18 | ||
16 | --装备相关 | 19 | --装备相关 |
17 | AddEquip = 101, -- 获得装备 - equipId rarity | 20 | AddEquip = 101, -- 获得装备 - equipId rarity |
@@ -44,6 +47,7 @@ local TaskType = { | @@ -44,6 +47,7 @@ local TaskType = { | ||
44 | AdvStartSelf = 409, -- 手动冒险 - id | 47 | AdvStartSelf = 409, -- 手动冒险 - id |
45 | AdvScore = 410, -- 冒险分数 - score | 48 | AdvScore = 410, -- 冒险分数 - score |
46 | AdvDraw = 411, -- 冒险资助 - count ptype | 49 | AdvDraw = 411, -- 冒险资助 - count ptype |
50 | + AdvHang = 412, -- 代理拾荒次数 | ||
47 | 51 | ||
48 | --爬塔相关 | 52 | --爬塔相关 |
49 | TowerPass = 501, -- 爬塔通关 - level | 53 | TowerPass = 501, -- 爬塔通关 - level |
@@ -60,6 +64,7 @@ local TaskType = { | @@ -60,6 +64,7 @@ local TaskType = { | ||
60 | DinerPopular = 608, -- 人气值 - count | 64 | DinerPopular = 608, -- 人气值 - count |
61 | DinerLevelUp = 609, -- 餐厅升级 - level type | 65 | DinerLevelUp = 609, -- 餐厅升级 - level type |
62 | DinerTalentUp = 610, -- 天赋升级 - type level | 66 | DinerTalentUp = 610, -- 天赋升级 - type level |
67 | + VillageApply = 611, -- 餐厅委托个数 | ||
63 | 68 | ||
64 | -- 车厢相关 | 69 | -- 车厢相关 |
65 | PotionMake = 701, -- 营养剂制作 - id count | 70 | PotionMake = 701, -- 营养剂制作 - id count |
@@ -77,7 +82,13 @@ local TaskType = { | @@ -77,7 +82,13 @@ local TaskType = { | ||
77 | GetFriendP = 803, -- 获得友情点 - count | 82 | GetFriendP = 803, -- 获得友情点 - count |
78 | 83 | ||
79 | -- 角色相关 | 84 | -- 角色相关 |
80 | - RoleLevelUp = 901, -- 角色升级 - curlevel | 85 | + RoleLevelUp = 851, -- 角色升级 - curlevel |
86 | + RuneQualityCollect = 852, -- 铭文品质收集进度 | ||
87 | + | ||
88 | + -- 其他相关 | ||
89 | + SignIn = 901, -- 签到 | ||
90 | + Pay = 902, -- 充值 | ||
91 | + ShopAll = 903, -- 在任意商店购买 | ||
81 | 92 | ||
82 | --功能未实现 todo | 93 | --功能未实现 todo |
83 | AdvShop = 1002, -- 冒险商城 | 94 | AdvShop = 1002, -- 冒险商城 |
@@ -87,8 +98,6 @@ local TaskType = { | @@ -87,8 +98,6 @@ local TaskType = { | ||
87 | BindPhone = 1008, -- 绑定手机 | 98 | BindPhone = 1008, -- 绑定手机 |
88 | WeChat = 1009, -- 关注微信 | 99 | WeChat = 1009, -- 关注微信 |
89 | WeBlog = 1010, -- 关注微博 | 100 | WeBlog = 1010, -- 关注微博 |
90 | - SignIn = 1011, -- 签到 | ||
91 | - ShopAll = 1013, -- 在任意商店购买 | ||
92 | } | 101 | } |
93 | 102 | ||
94 | local function f(field, func) | 103 | local function f(field, func) |
@@ -216,6 +225,7 @@ local ActivityListener = { | @@ -216,6 +225,7 @@ local ActivityListener = { | ||
216 | [TaskType.FoodSell] = {{Activity.ActivityType.FoodSell, f("count")}}, | 225 | [TaskType.FoodSell] = {{Activity.ActivityType.FoodSell, f("count")}}, |
217 | [TaskType.AdvDraw] = {{Activity.ActivityType.AdvDraw, f("count")}}, | 226 | [TaskType.AdvDraw] = {{Activity.ActivityType.AdvDraw, f("count")}}, |
218 | [TaskType.OpenBox] = {{Activity.ActivityType.OpenBox, f("count")}}, | 227 | [TaskType.OpenBox] = {{Activity.ActivityType.OpenBox, f("count")}}, |
228 | + [TaskType.Pay] = {{Activity.ActivityType.PayBack, f("twd")}}, | ||
219 | } | 229 | } |
220 | } | 230 | } |
221 | 231 | ||
@@ -228,6 +238,32 @@ local StoreListener = { | @@ -228,6 +238,32 @@ local StoreListener = { | ||
228 | } | 238 | } |
229 | } | 239 | } |
230 | 240 | ||
241 | +local CalendaTaskListener = { | ||
242 | + func = "checkCalendaTask", | ||
243 | + listen = { | ||
244 | + [TaskType.DrawHero] = {{1, 1, f("count")}}, | ||
245 | + [TaskType.BonusPass]= {{2, 1}}, | ||
246 | + [TaskType.AdvPass]= {{3, 1}}, | ||
247 | + [TaskType.DinerLevelUp]= {{4, 2, f("level")}}, | ||
248 | + [TaskType.HeroLvlCollect]= {{5, 3}}, -- x名y级英雄 | ||
249 | + [TaskType.AdvHang]= {{6, 1}}, ---- | ||
250 | + [TaskType.HeroQualityCollect]= {{7, 3}}, | ||
251 | + [TaskType.OverOderTask]= {{8, 1}}, | ||
252 | + [TaskType.VillageApply]= {{9, 1}}, | ||
253 | + [TaskType.PvpWin]= {{10, 2, f("score")}}, | ||
254 | + [TaskType.DinerPopular]= {{11, 2, f("count")}}, | ||
255 | + [TaskType.RoleLevelUp]= {{12, 2, f("level")}}, | ||
256 | + [TaskType.TowerPass]= {{13, 2, f("level")}}, | ||
257 | + [TaskType.HeroTalent]= {{14, 1}}, | ||
258 | + [TaskType.HangPass]= {{15, 2, f("id")}}, | ||
259 | + [TaskType.HeroStarCollect]= {{16, 3}}, | ||
260 | + [TaskType.FoodSell]= {{17, 1, f("count")}}, | ||
261 | + [TaskType.HangGet]= {{18, 3, f("reward")}}, | ||
262 | + [TaskType.RuneQualityCollect]= {{19, 3, f("id")}}, | ||
263 | + [TaskType.OpenBox]= {{20, 3, f("count"), f("quality")}}, | ||
264 | + } | ||
265 | +} | ||
266 | + | ||
231 | 267 | ||
232 | local TaskListeners = { | 268 | local TaskListeners = { |
233 | StoryListener, | 269 | StoryListener, |
@@ -550,6 +586,33 @@ function RoleTask.bind(Role) | @@ -550,6 +586,33 @@ function RoleTask.bind(Role) | ||
550 | self.storeData:OnTriggerLimitTimePack(triggerType, param) | 586 | self.storeData:OnTriggerLimitTimePack(triggerType, param) |
551 | end | 587 | end |
552 | 588 | ||
589 | + function Role:checkCalendaTask(notNotify, mainType, subType, param1, param2) | ||
590 | + local open, actId = self.activity:isOpen("CalendaTask") | ||
591 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
592 | + if not actData then return end | ||
593 | + if not open then return end | ||
594 | + | ||
595 | + local change = false | ||
596 | + local calTask = self:getProperty("calTask") or {} | ||
597 | + param1 = param1 or 1 | ||
598 | + | ||
599 | + local cid = actData.condition | ||
600 | + for k, taskList in pairs(csvdb["activity_taskCsv"]) do | ||
601 | + if k == cid then | ||
602 | + for id, cfg in pairs(taskList) do | ||
603 | + if cfg.type == mainType then | ||
604 | + if subType == 1 then -- 增加数值 | ||
605 | + calTask[id] = (calTask[id] or 0) + param1 | ||
606 | + elseif subType == 2 then -- 直接赋值 | ||
607 | + calTask[id] = param1 | ||
608 | + elseif subType == 3 then -- 自定义类型 | ||
609 | + end | ||
610 | + end | ||
611 | + end | ||
612 | + end | ||
613 | + end | ||
614 | + end | ||
615 | + | ||
553 | end | 616 | end |
554 | 617 | ||
555 | return RoleTask | 618 | return RoleTask |
556 | \ No newline at end of file | 619 | \ No newline at end of file |
src/models/RoleTimeReset.lua
@@ -20,6 +20,7 @@ ResetFunc["CrossDay"] = function(self, notify, response, now) | @@ -20,6 +20,7 @@ ResetFunc["CrossDay"] = function(self, notify, response, now) | ||
20 | 20 | ||
21 | response.dTask = {} | 21 | response.dTask = {} |
22 | response.advSup = self:getProperty("advSup") | 22 | response.advSup = self:getProperty("advSup") |
23 | + self:log("onLogin") | ||
23 | end | 24 | end |
24 | 25 | ||
25 | ResetFunc["CrossWeek"] = function(self, notify, response) | 26 | ResetFunc["CrossWeek"] = function(self, notify, response) |
@@ -34,7 +35,6 @@ end | @@ -34,7 +35,6 @@ end | ||
34 | ResetFunc["CrossMonth"] = function(self, notify, response) | 35 | ResetFunc["CrossMonth"] = function(self, notify, response) |
35 | local ltime = self:getProperty("ltime") | 36 | local ltime = self:getProperty("ltime") |
36 | if isCrossMonth(ltime, skynet.timex()) then | 37 | if isCrossMonth(ltime, skynet.timex()) then |
37 | - print("cross month") | ||
38 | self.storeData:resetStoreReored(3) --商店跨月重置 time_reset表关联id | 38 | self.storeData:resetStoreReored(3) --商店跨月重置 time_reset表关联id |
39 | end | 39 | end |
40 | end | 40 | end |
src/models/Rune.lua
@@ -26,16 +26,16 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) | @@ -26,16 +26,16 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) | ||
26 | self:notifyUpdateProperties(datas) | 26 | self:notifyUpdateProperties(datas) |
27 | end | 27 | end |
28 | 28 | ||
29 | -function Rune:log(contents) | ||
30 | - -- contents = contents or {} | ||
31 | - -- if contents["cint1"] or contents["cint2"] or contents["cint3"] then | ||
32 | - -- print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
33 | - -- end | ||
34 | - -- contents["cint1"] = self:getProperty("uid") | ||
35 | - -- contents["cint2"] = self:getProperty("type") | ||
36 | - -- contents["cint3"] = self:getProperty("id") | 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 | end | 39 | end |
40 | 40 | ||
41 | function Rune:notifyUpdateProperties(params) | 41 | function Rune:notifyUpdateProperties(params) |
src/models/Store.lua
@@ -163,7 +163,7 @@ function Store:getGearExchangeCoef() | @@ -163,7 +163,7 @@ function Store:getGearExchangeCoef() | ||
163 | end | 163 | end |
164 | 164 | ||
165 | -- 购买通行证 | 165 | -- 购买通行证 |
166 | -function Store:onBuyCard(type, duration) | 166 | +function Store:onBuyCard(type, duration, id) |
167 | local timeNow = skynet.timex() | 167 | local timeNow = skynet.timex() |
168 | if type == CardType.NormalMonthCard then | 168 | if type == CardType.NormalMonthCard then |
169 | if self:isMonthCardExpire() then | 169 | if self:isMonthCardExpire() then |
@@ -189,9 +189,10 @@ function Store:onBuyCard(type, duration) | @@ -189,9 +189,10 @@ function Store:onBuyCard(type, duration) | ||
189 | self:updateProperty({field = "growFund", value = 1}) | 189 | self:updateProperty({field = "growFund", value = 1}) |
190 | elseif type == CardType.BattleCard then | 190 | elseif type == CardType.BattleCard then |
191 | self:updateProperty({field = "battleCard", value = 1}) | 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 | local bpInfo = self:getProperty("bpInfo") or {} | 196 | local bpInfo = self:getProperty("bpInfo") or {} |
196 | local info = bpInfo[index] or {} | 197 | local info = bpInfo[index] or {} |
197 | info["flag"] = 1 | 198 | info["flag"] = 1 |
@@ -365,6 +366,7 @@ function Store:onBuyPaySignCard(dur) | @@ -365,6 +366,7 @@ function Store:onBuyPaySignCard(dur) | ||
365 | return | 366 | return |
366 | end | 367 | end |
367 | actGoodsFlag[goodsIndex] = 1 | 368 | actGoodsFlag[goodsIndex] = 1 |
369 | + self:updateProperty({field = "actGoodsFlag", value = actGoodsFlag}) | ||
368 | -- 发钱 | 370 | -- 发钱 |
369 | local change | 371 | local change |
370 | local reward, curData = self.owner.activity:getPaySignReward() | 372 | local reward, curData = self.owner.activity:getPaySignReward() |
@@ -375,13 +377,11 @@ function Store:onBuyPaySignCard(dur) | @@ -375,13 +377,11 @@ function Store:onBuyPaySignCard(dur) | ||
375 | 377 | ||
376 | self.owner:log("activity", { | 378 | self.owner:log("activity", { |
377 | activity_id = 0, -- 活动ID(或活动指定任务的ID) | 379 | activity_id = 0, -- 活动ID(或活动指定任务的ID) |
378 | - activity_type = self.onwer.activity.ActivityType.PaySignIn, -- 活动类型,见活动类型枚举表 | 380 | + activity_type = self.owner.activity.ActivityType.PaySignIn, -- 活动类型,见活动类型枚举表 |
379 | activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} | 381 | activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} |
380 | }) | 382 | }) |
381 | 383 | ||
382 | SendPacket(actionCodes.Activity_actPaySignRewardNtf, MsgPack.pack(self.owner:packReward(reward, change))) | 384 | SendPacket(actionCodes.Activity_actPaySignRewardNtf, MsgPack.pack(self.owner:packReward(reward, change))) |
383 | - | ||
384 | - self.owner:updateProperty({field = "actGoodsFlag", value = actGoodsFlag}) | ||
385 | end | 385 | end |
386 | 386 | ||
387 | function Store:checkPaySignReward() | 387 | function Store:checkPaySignReward() |
src/services/agent_ctrl.lua
@@ -128,7 +128,7 @@ function _M:check_agent_status() | @@ -128,7 +128,7 @@ function _M:check_agent_status() | ||
128 | next_log_time = now + 60 | 128 | next_log_time = now + 60 |
129 | local count = table_nums(self.u2f) | 129 | local count = table_nums(self.u2f) |
130 | datacenter.set("onlineCount", count) | 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 | end | 132 | end |
133 | end | 133 | end |
134 | 134 |
src/services/chated.lua
@@ -5,6 +5,8 @@ local crab = require "crab.c" | @@ -5,6 +5,8 @@ local crab = require "crab.c" | ||
5 | local table_insert = table.insert | 5 | local table_insert = table.insert |
6 | local table_unpack = table.unpack | 6 | local table_unpack = table.unpack |
7 | local mode, id, dict = ... | 7 | local mode, id, dict = ... |
8 | +local hideCode = utf8.codepoint("*") | ||
9 | + | ||
8 | 10 | ||
9 | local function toutf8(name) | 11 | local function toutf8(name) |
10 | local t = {} | 12 | local t = {} |
@@ -14,6 +16,16 @@ local function toutf8(name) | @@ -14,6 +16,16 @@ local function toutf8(name) | ||
14 | return t | 16 | return t |
15 | end | 17 | end |
16 | 18 | ||
19 | +local function fix(a, b) | ||
20 | + for i, v in pairs(a) do | ||
21 | + if b[i] == hideCode then | ||
22 | + a[i] = hideCode | ||
23 | + end | ||
24 | + end | ||
25 | + return utf8.char(table_unpack(a)) | ||
26 | +end | ||
27 | + | ||
28 | + | ||
17 | if mode == "sub" then | 29 | if mode == "sub" then |
18 | local CMD = {} | 30 | local CMD = {} |
19 | dict = tonumber(dict) | 31 | dict = tonumber(dict) |
@@ -23,8 +35,9 @@ if mode == "sub" then | @@ -23,8 +35,9 @@ if mode == "sub" then | ||
23 | return false | 35 | return false |
24 | end | 36 | end |
25 | local utftb = toutf8(name) | 37 | local utftb = toutf8(name) |
26 | - if crab.filter(dict, utftb) then | ||
27 | - return false, utf8.char(table_unpack(utftb)) | 38 | + local utftbU = toutf8(string.upper(name)) |
39 | + if crab.filter(dict, utftbU) then | ||
40 | + return false, fix(utftb, utftbU) | ||
28 | end | 41 | end |
29 | return true | 42 | return true |
30 | end | 43 | end |
@@ -45,7 +58,7 @@ else | @@ -45,7 +58,7 @@ else | ||
45 | 58 | ||
46 | local words = {} | 59 | local words = {} |
47 | for _, data in ipairs(forbidNames) do | 60 | for _, data in ipairs(forbidNames) do |
48 | - local ok, utftb = pcall(toutf8, data.name) | 61 | + local ok, utftb = pcall(toutf8, string.upper(data.name)) |
49 | if ok then table.insert(words, utftb) end | 62 | if ok then table.insert(words, utftb) end |
50 | end | 63 | end |
51 | local d = crab.open(words) | 64 | local d = crab.open(words) |
@@ -0,0 +1,145 @@ | @@ -0,0 +1,145 @@ | ||
1 | + | ||
2 | +local skynet = require "skynet" | ||
3 | +local socketdriver = require "skynet.socketdriver" | ||
4 | +local serverId = tonumber(skynet.getenv("servId")) | ||
5 | + | ||
6 | +require "shared.init" | ||
7 | +require "skynet.manager" | ||
8 | + | ||
9 | +local table_insert = table.insert | ||
10 | +local pairs = pairs | ||
11 | +local ipairs = ipairs | ||
12 | +local string_format = string.format | ||
13 | + | ||
14 | +local logHandle = { | ||
15 | + log = { | ||
16 | + host = "127.0.0.1", | ||
17 | + port = 13003, | ||
18 | + handle = function(doc, address, msg) | ||
19 | + -- 注入字段 | ||
20 | + local now = skynet.timex() | ||
21 | + doc["time"] = now | ||
22 | + doc["timestamp"] = now | ||
23 | + doc["instance_id"] = serverId | ||
24 | + doc["game_name"] = "wasteland" | ||
25 | + doc["env"] = "cb" | ||
26 | + doc["app_name"] = "gs" | ||
27 | + doc["app_id"] = "game.wasteland.gs" | ||
28 | + --FATAL、ERROR、WARN、INFO、DEBUG | ||
29 | + doc["level"] = "ERROR" | ||
30 | + doc["log"] = msg | ||
31 | + doc["address"] = string_format(":%08x", address) | ||
32 | + end | ||
33 | + }, | ||
34 | +} | ||
35 | + | ||
36 | +local connect_relation = {} | ||
37 | +local function getConInfo(fd) | ||
38 | + return logHandle[connect_relation[fd] or ""] | ||
39 | +end | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | +local socket_message = {} | ||
44 | +-- read skynet_socket.h for these macro | ||
45 | +-- SKYNET_SOCKET_TYPE_DATA = 1 | ||
46 | +socket_message[1] = function(id, size, data) | ||
47 | + skynet.error(string.format("LOG SOCKET: data: ", skynet.tostring(data, size))) | ||
48 | + socketdriver.drop(data, size) | ||
49 | +end | ||
50 | + | ||
51 | +-- SKYNET_SOCKET_TYPE_CONNECT = 2 | ||
52 | +socket_message[2] = function(id, _ , addr) | ||
53 | + local cur = getConInfo(id) | ||
54 | + skynet.error("LOG SOCKET: connect: ", addr) | ||
55 | + cur.connected = true | ||
56 | + cur.connecting = false | ||
57 | +end | ||
58 | + | ||
59 | +-- SKYNET_SOCKET_TYPE_CLOSE = 3 | ||
60 | +socket_message[3] = function(id) | ||
61 | + skynet.error("LOG SOCKET: closed") | ||
62 | + local cur = getConInfo(id) | ||
63 | + if not cur then return end | ||
64 | + cur.connected = false | ||
65 | + cur.connecting = false | ||
66 | + connect_relation[id] = nil | ||
67 | +end | ||
68 | + | ||
69 | +-- SKYNET_SOCKET_TYPE_ERROR = 5 | ||
70 | +socket_message[5] = function(id, _, err) | ||
71 | + skynet.error("LOG SOCKET: error: ", err) | ||
72 | + local cur = getConInfo(id) | ||
73 | + if not cur then return end | ||
74 | + cur.connected = false | ||
75 | + cur.connecting = false | ||
76 | + connect_relation[id] = nil | ||
77 | +end | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | +local function open() | ||
82 | + for logTo, data in pairs(logHandle) do | ||
83 | + if not data.connecting and not data.connected then | ||
84 | + data.connecting = true | ||
85 | + data.fd = socketdriver.connect(data.host, data.port) | ||
86 | + connect_relation[data.fd] = logTo | ||
87 | + end | ||
88 | + end | ||
89 | +end | ||
90 | + | ||
91 | +local function log(address, msg, logTo) | ||
92 | + logTo = logTo or "log" | ||
93 | + -- print(string.format(":%08x(%.2f): %s", address, skynet.time(), msg)) | ||
94 | + local cur = logHandle[logTo] | ||
95 | + if not cur then | ||
96 | + print("error log to ", logTo) | ||
97 | + end | ||
98 | + local doc = {} | ||
99 | + if cur.handle then | ||
100 | + cur.handle(doc, address, msg) | ||
101 | + end | ||
102 | + if cur.connected and cur.fd then | ||
103 | + socketdriver.send(cur.fd, json.encode(doc) .. "\n") | ||
104 | + else | ||
105 | + -- 断线会丢失一部分日志 | ||
106 | + if not cur.connecting then | ||
107 | + open() -- 连一下 | ||
108 | + end | ||
109 | + end | ||
110 | +end | ||
111 | + | ||
112 | + | ||
113 | +skynet.register_protocol { | ||
114 | + name = "socket", | ||
115 | + id = skynet.PTYPE_SOCKET, -- PTYPE_SOCKET = 6 | ||
116 | + unpack = socketdriver.unpack, | ||
117 | + dispatch = function (_, _, t, ...) | ||
118 | + if socket_message[t] then | ||
119 | + socket_message[t](...) | ||
120 | + end | ||
121 | + end | ||
122 | +} | ||
123 | + | ||
124 | +-- register protocol text before skynet.start would be better. | ||
125 | +skynet.register_protocol { | ||
126 | + name = "text", | ||
127 | + id = skynet.PTYPE_TEXT, | ||
128 | + unpack = skynet.tostring, | ||
129 | + dispatch = function(_, address, msg) | ||
130 | + log(address, msg) | ||
131 | + end | ||
132 | +} | ||
133 | + | ||
134 | +skynet.register_protocol { | ||
135 | + name = "SYSTEM", | ||
136 | + id = skynet.PTYPE_SYSTEM, | ||
137 | + unpack = function(...) return ... end, | ||
138 | + dispatch = function() | ||
139 | + -- reopen signal | ||
140 | + print("SIGHUP") | ||
141 | + end | ||
142 | +} | ||
143 | + | ||
144 | +open() | ||
145 | +skynet.start(function()end) |
src/services/logd.lua
@@ -13,8 +13,37 @@ local pairs = pairs | @@ -13,8 +13,37 @@ local pairs = pairs | ||
13 | local ipairs = ipairs | 13 | local ipairs = ipairs |
14 | local string_format = string.format | 14 | local string_format = string.format |
15 | 15 | ||
16 | +local logId = 0 | ||
16 | local CMD, cs = {} | 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 | local socket_message = {} | 49 | local socket_message = {} |
@@ -27,20 +56,30 @@ end | @@ -27,20 +56,30 @@ end | ||
27 | 56 | ||
28 | -- SKYNET_SOCKET_TYPE_CONNECT = 2 | 57 | -- SKYNET_SOCKET_TYPE_CONNECT = 2 |
29 | socket_message[2] = function(id, _ , addr) | 58 | socket_message[2] = function(id, _ , addr) |
59 | + local cur = getConInfo(id) | ||
30 | skynet.error("LOG SOCKET: connect: ", addr) | 60 | skynet.error("LOG SOCKET: connect: ", addr) |
31 | - connecting = false | 61 | + cur.connected = true |
62 | + cur.connecting = false | ||
32 | end | 63 | end |
33 | 64 | ||
34 | -- SKYNET_SOCKET_TYPE_CLOSE = 3 | 65 | -- SKYNET_SOCKET_TYPE_CLOSE = 3 |
35 | socket_message[3] = function(id) | 66 | socket_message[3] = function(id) |
36 | skynet.error("LOG SOCKET: closed") | 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 | end | 73 | end |
39 | 74 | ||
40 | -- SKYNET_SOCKET_TYPE_ERROR = 5 | 75 | -- SKYNET_SOCKET_TYPE_ERROR = 5 |
41 | socket_message[5] = function(id, _, err) | 76 | socket_message[5] = function(id, _, err) |
42 | skynet.error("LOG SOCKET: error: ", err) | 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 | end | 83 | end |
45 | 84 | ||
46 | 85 | ||
@@ -55,18 +94,33 @@ skynet.register_protocol { | @@ -55,18 +94,33 @@ skynet.register_protocol { | ||
55 | end | 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 | end | 112 | end |
64 | end | 113 | end |
65 | end | 114 | end |
66 | 115 | ||
67 | function CMD.open() | 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 | end | 124 | end |
71 | 125 | ||
72 | local function __init__() | 126 | local function __init__() |
@@ -75,8 +129,8 @@ local function __init__() | @@ -75,8 +129,8 @@ local function __init__() | ||
75 | if command == "open" then | 129 | if command == "open" then |
76 | skynet.ret(skynet.pack(f(...))) | 130 | skynet.ret(skynet.pack(f(...))) |
77 | else | 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 | end | 134 | end |
81 | end) | 135 | end) |
82 | cs = queue() | 136 | cs = queue() |
src/services/named.lua
@@ -5,6 +5,8 @@ local crab = require "crab.c" | @@ -5,6 +5,8 @@ local crab = require "crab.c" | ||
5 | local table_insert = table.insert | 5 | local table_insert = table.insert |
6 | local table_unpack = table.unpack | 6 | local table_unpack = table.unpack |
7 | local mode, id, dict = ... | 7 | local mode, id, dict = ... |
8 | +local hideCode = utf8.codepoint("*") | ||
9 | + | ||
8 | 10 | ||
9 | local function toutf8(name) | 11 | local function toutf8(name) |
10 | local t = {} | 12 | local t = {} |
@@ -14,6 +16,16 @@ local function toutf8(name) | @@ -14,6 +16,16 @@ local function toutf8(name) | ||
14 | return t | 16 | return t |
15 | end | 17 | end |
16 | 18 | ||
19 | +local function fix(a, b) | ||
20 | + for i, v in pairs(a) do | ||
21 | + if b[i] == hideCode then | ||
22 | + a[i] = hideCode | ||
23 | + end | ||
24 | + end | ||
25 | + return utf8.char(table_unpack(a)) | ||
26 | +end | ||
27 | + | ||
28 | + | ||
17 | if mode == "sub" then | 29 | if mode == "sub" then |
18 | local CMD = {} | 30 | local CMD = {} |
19 | dict = tonumber(dict) | 31 | dict = tonumber(dict) |
@@ -23,8 +35,9 @@ if mode == "sub" then | @@ -23,8 +35,9 @@ if mode == "sub" then | ||
23 | return false | 35 | return false |
24 | end | 36 | end |
25 | local utftb = toutf8(name) | 37 | local utftb = toutf8(name) |
26 | - if crab.filter(dict, utftb) then | ||
27 | - return false, utf8.char(table_unpack(utftb)) | 38 | + local utftbU = toutf8(string.upper(name)) |
39 | + if crab.filter(dict, utftbU) then | ||
40 | + return false, fix(utftb, utftbU) | ||
28 | end | 41 | end |
29 | return true | 42 | return true |
30 | end | 43 | end |
@@ -45,7 +58,7 @@ else | @@ -45,7 +58,7 @@ else | ||
45 | 58 | ||
46 | local words = {} | 59 | local words = {} |
47 | for _, data in ipairs(forbidNames) do | 60 | for _, data in ipairs(forbidNames) do |
48 | - local ok, utftb = pcall(toutf8, data.name) | 61 | + local ok, utftb = pcall(toutf8, string.upper(data.name)) |
49 | if ok then table.insert(words, utftb) end | 62 | if ok then table.insert(words, utftb) end |
50 | end | 63 | end |
51 | local d = crab.open(words) | 64 | local d = crab.open(words) |
src/services/redisd.lua
@@ -24,5 +24,8 @@ skynet.start(function() | @@ -24,5 +24,8 @@ skynet.start(function() | ||
24 | skynet.ret(skynet.pack(db[string.lower(cmd)](db, ...))) | 24 | skynet.ret(skynet.pack(db[string.lower(cmd)](db, ...))) |
25 | end | 25 | end |
26 | end) | 26 | end) |
27 | + skynet.info_func(function() | ||
28 | + skynet.ret(skynet.pack(skynet.call(skynet.self(), "debug", "STAT"))) | ||
29 | + end) | ||
27 | skynet.register ".redis" | 30 | skynet.register ".redis" |
28 | end) | 31 | end) |
29 | \ No newline at end of file | 32 | \ No newline at end of file |
src/utils/CommonFunc.lua
@@ -155,7 +155,7 @@ function diffFromOpen() | @@ -155,7 +155,7 @@ function diffFromOpen() | ||
155 | hour = RESET_TIME, | 155 | hour = RESET_TIME, |
156 | } | 156 | } |
157 | if now < openTime then | 157 | if now < openTime then |
158 | - return 0 | 158 | + return -1 |
159 | end | 159 | end |
160 | 160 | ||
161 | return math.floor((now - openTime) / DAY_SEC) | 161 | return math.floor((now - openTime) / DAY_SEC) |
@@ -219,7 +219,7 @@ function specMonday(now) | @@ -219,7 +219,7 @@ function specMonday(now) | ||
219 | local wday = (tm.wday + 6) % 7 | 219 | local wday = (tm.wday + 6) % 7 |
220 | if wday == 0 then wday = 7 end | 220 | if wday == 0 then wday = 7 end |
221 | 221 | ||
222 | - local time = os.time({year = tm.year, month = tm.month, day = tm.day}) | 222 | + local time = os.time({year = tm.year, month = tm.month, day = tm.day, hour = RESET_TIME}) |
223 | return time - (wday - 1) * 86400 | 223 | return time - (wday - 1) * 86400 |
224 | end | 224 | end |
225 | 225 |