Commit 05660bf7b7a0722137d91ebaec5c89b4e03d2e52
Merge branch 'develop' into tr/cb
* develop: (25 commits) error 探索指令bug, 充值返利活动 挂机打完困难20101才设定完成引导22 挂机编队完成的时候服务器主动保存下一步引导,防止极端意外 探索指令调试完成 日志bug 修改每日礼包检测开启bug log缺失 ucode nokey 修改引导, 抽卡阶段奖励修改 gm增加跳过引导的命令 guide skip 自己的日志 自动挂机下一关 去除日志 拾荒引导拾取探险点后服务器设置当前引导步骤,而不是客户端指定 付费签到,抽卡阶段奖励,探索指令 自选箱子协议 保底日志 quest 增加定制 bug ...
Showing
32 changed files
with
1256 additions
and
128 deletions
Show diff stats
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,6 +275,8 @@ CardType = { | @@ -274,6 +275,8 @@ CardType = { | ||
274 | PrivilegeCard = 3, --特权卡 | 275 | PrivilegeCard = 3, --特权卡 |
275 | GrowFund = 4, --成长助力 | 276 | GrowFund = 4, --成长助力 |
276 | BattleCard = 5, --赛季卡 | 277 | BattleCard = 5, --赛季卡 |
278 | + PaySignCard = 6, -- 付费签到卡 | ||
279 | + BattlePassCard = 7, -- 探索指令 | ||
277 | } | 280 | } |
278 | 281 | ||
279 | HeroQuality = { | 282 | HeroQuality = { |
@@ -290,6 +293,8 @@ MailId = { | @@ -290,6 +293,8 @@ MailId = { | ||
290 | SuperMonthCardEx = 204, | 293 | SuperMonthCardEx = 204, |
291 | BattleCardAward = 210, | 294 | BattleCardAward = 210, |
292 | 295 | ||
296 | + PaySignAward = 222, | ||
297 | + | ||
293 | ActSellFood = 231, | 298 | ActSellFood = 231, |
294 | ActDrawCard = 232, | 299 | ActDrawCard = 232, |
295 | ActAdvDraw = 233, | 300 | ActAdvDraw = 233, |
src/ProtocolCode.lua
@@ -45,6 +45,8 @@ actionCodes = { | @@ -45,6 +45,8 @@ actionCodes = { | ||
45 | Role_getRandomNameRpc = 130, | 45 | Role_getRandomNameRpc = 130, |
46 | Role_goldBuyRpc = 131, | 46 | Role_goldBuyRpc = 131, |
47 | Role_getDownloadCvRewardRpc = 132, | 47 | Role_getDownloadCvRewardRpc = 132, |
48 | + Role_updateFeedbackInfoRpc = 133, | ||
49 | + Role_useSelectItemRpc = 134, -- 使用多选一礼包 | ||
48 | 50 | ||
49 | Adv_startAdvRpc = 151, | 51 | Adv_startAdvRpc = 151, |
50 | Adv_startHangRpc = 152, | 52 | Adv_startHangRpc = 152, |
@@ -91,6 +93,7 @@ actionCodes = { | @@ -91,6 +93,7 @@ actionCodes = { | ||
91 | Hero_repayHeroRpc = 221, | 93 | Hero_repayHeroRpc = 221, |
92 | Hero_unlockPoolRpc = 222, | 94 | Hero_unlockPoolRpc = 222, |
93 | Hero_changeCrown = 223, | 95 | Hero_changeCrown = 223, |
96 | + Hero_drawHeroExtraRewardNtf = 224, | ||
94 | 97 | ||
95 | Hang_startRpc = 251, | 98 | Hang_startRpc = 251, |
96 | Hang_checkRpc = 252, | 99 | Hang_checkRpc = 252, |
@@ -191,6 +194,7 @@ actionCodes = { | @@ -191,6 +194,7 @@ actionCodes = { | ||
191 | Store_getFreeChestRpc = 560, | 194 | Store_getFreeChestRpc = 560, |
192 | Store_getGrowFundRewardRpc = 561, --成长助力奖励 | 195 | Store_getGrowFundRewardRpc = 561, --成长助力奖励 |
193 | Store_getBattlePassRewardRpc = 562, --赛季卡奖励 | 196 | Store_getBattlePassRewardRpc = 562, --赛季卡奖励 |
197 | + Store_getExploreCommandRewardRpc = 563, --探索指令 | ||
194 | 198 | ||
195 | 199 | ||
196 | Email_listRpc = 600, | 200 | Email_listRpc = 600, |
@@ -203,6 +207,7 @@ actionCodes = { | @@ -203,6 +207,7 @@ actionCodes = { | ||
203 | Activity_signRpc = 651, | 207 | Activity_signRpc = 651, |
204 | Activity_sudokuRewardRpc = 652, | 208 | Activity_sudokuRewardRpc = 652, |
205 | Activity_actSignRpc = 653, | 209 | Activity_actSignRpc = 653, |
210 | + Activity_actPaySignRewardNtf = 654, | ||
206 | } | 211 | } |
207 | 212 | ||
208 | rpcResponseBegin = 10000 | 213 | rpcResponseBegin = 10000 |
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 |
@@ -178,5 +179,46 @@ function _M.actSignRpc(agent, data) | @@ -178,5 +179,46 @@ function _M.actSignRpc(agent, data) | ||
178 | end | 179 | end |
179 | 180 | ||
180 | 181 | ||
182 | +function _M.actPaySignRpc(agent, data) | ||
183 | + local role = agent.role | ||
184 | + local msg = MsgPack.unpack(data) | ||
185 | + local actGoodsFlag = role.storeData:getProperty("actGoodsFlag") | ||
186 | + local index = GetActGoodsIndex("paySignIn") | ||
187 | + local flag = actGoodsFlag[index] or 0 | ||
188 | + if flag == 0 then return 1 end | ||
189 | + | ||
190 | + if not role.activity:isOpen("PaySignIn") then return 2 end | ||
191 | + | ||
192 | + local diffDay = diffFromOpen() + 1 | ||
193 | + | ||
194 | + local curData = role.activity:getActData("PaySignIn") | ||
195 | + local reward, change = {} | ||
196 | + for day, csvData in ipairs(csvdb["pay_signInCsv"]) do | ||
197 | + if day <= diffDay then | ||
198 | + if not curData[day] then | ||
199 | + curData[day] = 1 | ||
200 | + -- 奖励 | ||
201 | + for itemId, count in pairs(csvData.reward:toNumMap()) do | ||
202 | + reward[itemId] = (reward[itemId] or 0) + count | ||
203 | + end | ||
204 | + end | ||
205 | + else | ||
206 | + break | ||
207 | + end | ||
208 | + end | ||
209 | + if next(reward) then | ||
210 | + role.activity:updateActData("PaySignIn", curData) | ||
211 | + reward, change = role:award(reward, {log = {desc = "actPaySign"}}) | ||
212 | + end | ||
213 | + | ||
214 | + role:log("activity", { | ||
215 | + activity_id = curData[0], -- 活动ID(或活动指定任务的ID) | ||
216 | + activity_type = role.activity.ActivityType.PaySignIn, -- 活动类型,见活动类型枚举表 | ||
217 | + activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} | ||
218 | + }) | ||
219 | + | ||
220 | + SendPacket(actionCodes.Activity_actPaySignRpc, MsgPack.pack(role:packReward(reward, change))) | ||
221 | + return true | ||
222 | +end | ||
181 | 223 | ||
182 | return _M | 224 | return _M |
183 | \ No newline at end of file | 225 | \ No newline at end of file |
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 |
@@ -614,10 +626,12 @@ function _M.exitAdvRpc(agent, data) | @@ -614,10 +626,12 @@ function _M.exitAdvRpc(agent, data) | ||
614 | local role = agent.role | 626 | local role = agent.role |
615 | -- local msg = MsgPack.unpack(data) | 627 | -- local msg = MsgPack.unpack(data) |
616 | if not isCanContinue(role) then return end | 628 | if not isCanContinue(role) then return end |
629 | + -- 冒险中途退出的时候要把引导步骤设定到成就引导 | ||
617 | if not role:checkOverGuide(57) then | 630 | if not role:checkOverGuide(57) then |
618 | role:saveGuide(57,1,true) | 631 | role:saveGuide(57,1,true) |
619 | end | 632 | end |
620 | local adv = role:getAdvData() | 633 | local adv = role:getAdvData() |
634 | + adv:mylog({desc = "exit"}) | ||
621 | local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标 | 635 | local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标 |
622 | SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()})) | 636 | SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()})) |
623 | return true | 637 | return true |
@@ -688,7 +702,7 @@ function _M.endBattleRpc(agent, data) | @@ -688,7 +702,7 @@ function _M.endBattleRpc(agent, data) | ||
688 | role:saveGuide(61,1,true) | 702 | role:saveGuide(61,1,true) |
689 | end | 703 | end |
690 | end | 704 | end |
691 | - | 705 | + adv:mylog({desc = "endBattle"}) |
692 | local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) | 706 | local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) |
693 | 707 | ||
694 | if not status then return end | 708 | if not status then return end |
@@ -771,7 +785,9 @@ function _M.wheelSurfRpc(agent, data) | @@ -771,7 +785,9 @@ function _M.wheelSurfRpc(agent, data) | ||
771 | end | 785 | end |
772 | role:award(reward, {log = {desc = "advWheelSurf", int1 = ptype}}) | 786 | role:award(reward, {log = {desc = "advWheelSurf", int1 = ptype}}) |
773 | role:finishGuide(58) | 787 | role:finishGuide(58) |
788 | + | ||
774 | 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}) | ||
775 | 791 | ||
776 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) | 792 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) |
777 | return true | 793 | return true |
@@ -800,6 +816,7 @@ function _M.repayWheelSurfRpc(agent, data) | @@ -800,6 +816,7 @@ function _M.repayWheelSurfRpc(agent, data) | ||
800 | local gift = drawData["pool3"]:randWeight(true) | 816 | local gift = drawData["pool3"]:randWeight(true) |
801 | local reward, change = {[gift[1]] = gift[2]} | 817 | local reward, change = {[gift[1]] = gift[2]} |
802 | 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}) | ||
803 | 820 | ||
804 | SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack(role:packReward(reward, change))) | 821 | SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack(role:packReward(reward, change))) |
805 | return true | 822 | return true |
@@ -823,6 +840,8 @@ function _M.finishAchievRpc(agent, data) | @@ -823,6 +840,8 @@ function _M.finishAchievRpc(agent, data) | ||
823 | if not status then return end | 840 | if not status then return end |
824 | adv:updateAchievement() | 841 | adv:updateAchievement() |
825 | role:finishGuide(57) | 842 | role:finishGuide(57) |
843 | + role:mylog("adv_action", {desc = "finishAchiev", short1 = ctype, int1 = chapterId, int2 = taskId}) | ||
844 | + | ||
826 | SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack(role:packReward(reward, change))) | 845 | SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack(role:packReward(reward, change))) |
827 | return true | 846 | return true |
828 | end | 847 | end |
@@ -878,6 +897,7 @@ function _M.refreshSupportRpc(agent, data) | @@ -878,6 +897,7 @@ function _M.refreshSupportRpc(agent, data) | ||
878 | end | 897 | end |
879 | 898 | ||
880 | role:advRandomSupportEffect() | 899 | role:advRandomSupportEffect() |
900 | + role:mylog("adv_action", {desc = "advSupRe", short1 = cr < al and 0 or 1}) | ||
881 | 901 | ||
882 | SendPacket(actionCodes.Adv_refreshSupportRpc, '') | 902 | SendPacket(actionCodes.Adv_refreshSupportRpc, '') |
883 | 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,7 @@ function _M.entrustRpc(agent , data) | @@ -880,6 +900,7 @@ 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}) | ||
883 | 904 | ||
884 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward, change = change})) | 905 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward, change = change})) |
885 | return true | 906 | return true |
@@ -916,6 +937,7 @@ function _M.collectRpc(agent , data) | @@ -916,6 +937,7 @@ function _M.collectRpc(agent , data) | ||
916 | restaurant_collect_rwd = reward, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….} | 937 | restaurant_collect_rwd = reward, -- 订单完成奖励,json格式记录,{"itemid1":123,"itemid2":12,……….} |
917 | restaurant_collect_plan = count, -- 收集进度,即解锁顾客,数字表示 | 938 | restaurant_collect_plan = count, -- 收集进度,即解锁顾客,数字表示 |
918 | }) | 939 | }) |
940 | + role:mylog("diner_action", {desc = "collect", int1 = id}) | ||
919 | 941 | ||
920 | SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward, change = change})) | 942 | SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward, change = change})) |
921 | return true | 943 | return true |
@@ -945,6 +967,8 @@ function _M.comboRewardRpc(agent , data) | @@ -945,6 +967,8 @@ function _M.comboRewardRpc(agent , data) | ||
945 | 967 | ||
946 | role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 | 968 | role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 |
947 | 969 | ||
970 | + role:mylog("diner_action", {desc = "combo", int1 = id}) | ||
971 | + | ||
948 | SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward, change = change})) | 972 | SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward, change = change})) |
949 | return true | 973 | return true |
950 | end | 974 | 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
@@ -446,18 +446,33 @@ function _M.email(role, pms) | @@ -446,18 +446,33 @@ function _M.email(role, pms) | ||
446 | return "成功" | 446 | return "成功" |
447 | end | 447 | end |
448 | 448 | ||
449 | -table.insert(helpDes, {"清除引导", "cguide", "0全/1强/2弱"}) | ||
450 | -function _M.cguide(role, pms) | ||
451 | - local id = tonum(pms.pm1, 0) | ||
452 | - if id == 0 then | ||
453 | - role:updateProperties({ | ||
454 | - newerGuide = "1=1", | ||
455 | - funcGuide = "", | ||
456 | - }, notNotify) | ||
457 | - elseif id == 1 then | ||
458 | - role:updateProperty({field = "newerGuide", value = "1=1"}) | ||
459 | - elseif id == 2 then | ||
460 | - role:updateProperty({field = "funcGuide", value = ""}) | 449 | +table.insert(helpDes, {"引导", "guide", "skip/reset"}) |
450 | +function _M.guide(role, pms) | ||
451 | + local cmd = pms.pm1 or "un" | ||
452 | + if cmd == "SKIP" then | ||
453 | + role:updateProperty({field = "newerGuide", value = "9999=1"}) | ||
454 | + local str = "" | ||
455 | + for _, set in pairs(csvdb["guide_mainCsv"]) do | ||
456 | + str = str:setv(set[1].major * 1000,1) | ||
457 | + for _,data in ipairs(set) do | ||
458 | + if data["break"] ~= 0 then | ||
459 | + str = str:setv(data.major * 1000 + data.minor,1) | ||
460 | + end | ||
461 | + end | ||
462 | + end | ||
463 | + role:updateProperty({field = "funcGuide", value = str}) | ||
464 | + elseif cmd == "RESET" then | ||
465 | + local id = tonum(pms.pm2, 0) | ||
466 | + if id == 0 then | ||
467 | + role:updateProperties({ | ||
468 | + newerGuide = "1=1", | ||
469 | + funcGuide = "", | ||
470 | + }, notNotify) | ||
471 | + elseif id == 1 then | ||
472 | + role:updateProperty({field = "newerGuide", value = "1=1"}) | ||
473 | + elseif id == 2 then | ||
474 | + role:updateProperty({field = "funcGuide", value = ""}) | ||
475 | + end | ||
461 | end | 476 | end |
462 | 477 | ||
463 | return "成功" | 478 | return "成功" |
@@ -472,7 +487,7 @@ function _M.test(role, pms) | @@ -472,7 +487,7 @@ function _M.test(role, pms) | ||
472 | local id = tonum(pms.pm1, 0) | 487 | local id = tonum(pms.pm1, 0) |
473 | --local hero = require ("actions.HeroAction") | 488 | --local hero = require ("actions.HeroAction") |
474 | --hero.unlockPoolRpc({role = role}, MsgPack.pack({type = id})) | 489 | --hero.unlockPoolRpc({role = role}, MsgPack.pack({type = id})) |
475 | - role.storeData:onBattleCardReset() | 490 | + print(role:getPaybackReward(0, 10000)) |
476 | return "成功" | 491 | return "成功" |
477 | end | 492 | end |
478 | 493 |
src/actions/HangAction.lua
@@ -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,15 @@ function _M.endBattleRpc(agent, data) | @@ -270,8 +271,15 @@ 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 | + print(hangInfo.bossTime) | ||
282 | + end | ||
275 | end | 283 | end |
276 | role:updateProperty({field = "hangInfo", value = hangInfo}) | 284 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
277 | 285 | ||
@@ -324,6 +332,7 @@ function _M.roleFormatRpc(agent , data) | @@ -324,6 +332,7 @@ function _M.roleFormatRpc(agent , data) | ||
324 | hangTeam.leader = msg.leader | 332 | hangTeam.leader = msg.leader |
325 | hangTeam.supports = supports | 333 | hangTeam.supports = supports |
326 | role:saveHangTeam(hangTeam) | 334 | role:saveHangTeam(hangTeam) |
335 | + role:saveGuide(5,8) | ||
327 | SendPacket(actionCodes.Hang_roleFormatRpc, '') | 336 | SendPacket(actionCodes.Hang_roleFormatRpc, '') |
328 | return true | 337 | return true |
329 | end | 338 | end |
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,6 +109,7 @@ function _M.wakeRpc(agent, data) | @@ -107,6 +109,7 @@ 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") |
@@ -114,11 +117,13 @@ function _M.wakeRpc(agent, data) | @@ -114,11 +117,13 @@ function _M.wakeRpc(agent, data) | ||
114 | if curLevel == 4 then -- 解锁cg | 117 | if curLevel == 4 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 |
@@ -499,7 +506,7 @@ function _M.referEquipsRpc(agent, data) | @@ -499,7 +506,7 @@ function _M.referEquipsRpc(agent, data) | ||
499 | local curAttr = hero:getTotalAttrs() | 506 | local curAttr = hero:getTotalAttrs() |
500 | local attrChange = getChangeAttrJson(oldAttr, curAttr) | 507 | local attrChange = getChangeAttrJson(oldAttr, curAttr) |
501 | for typ, data in pairs(wear) do | 508 | for typ, data in pairs(wear) do |
502 | - role:log("hero_jewel", { | 509 | + role:log("equip_wear", { |
503 | hero_id = hero:getProperty("type"), --英雄ID | 510 | hero_id = hero:getProperty("type"), --英雄ID |
504 | equip_id = data.id, --装备ID | 511 | equip_id = data.id, --装备ID |
505 | equip_wear_action = data.act, --装备操作类型:装备:0,卸载:1 | 512 | equip_wear_action = data.act, --装备操作类型:装备:0,卸载:1 |
@@ -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, "") |
@@ -671,9 +680,27 @@ function _M.getResetRewardRpc(agent, data) | @@ -671,9 +680,27 @@ function _M.getResetRewardRpc(agent, data) | ||
671 | end | 680 | end |
672 | end | 681 | end |
673 | 682 | ||
674 | - hero:updateProperty({field = "level", value = level}) | ||
675 | - hero:updateProperty({field = "breakL", value = breakL}) | ||
676 | - hero:updateProperty({field = "talent", value = ""}) | 683 | + local equip = hero:getProperty("equip") |
684 | + for k, v in pairs(equip:toNumMap()) do | ||
685 | + role:addEquip(k, v, 1, {log = {desc = "resetHero", int1 = msg.id, int2 = hero:getProperty("type")}}) | ||
686 | + end | ||
687 | + | ||
688 | + local rune = hero:getProperty("rune") | ||
689 | + for _, id in pairs(rune:toNumMap()) do | ||
690 | + local curRune = role.runeBag[id] | ||
691 | + if curRune then | ||
692 | + curRune:updateProperty({field = "refer", value = 0}) | ||
693 | + end | ||
694 | + end | ||
695 | + | ||
696 | + hero:updateProperties({ | ||
697 | + level = level, | ||
698 | + breakL = breakL, | ||
699 | + talent = "", | ||
700 | + equip = "", | ||
701 | + rune = "", | ||
702 | + }) | ||
703 | + hero:mylog({desc = "resetHero"}) | ||
677 | 704 | ||
678 | for itemId, count in pairs(reward) do | 705 | for itemId, count in pairs(reward) do |
679 | reward[itemId] = math.floor(count * globalCsv.unit_back_discount) | 706 | reward[itemId] = math.floor(count * globalCsv.unit_back_discount) |
@@ -682,7 +709,7 @@ function _M.getResetRewardRpc(agent, data) | @@ -682,7 +709,7 @@ function _M.getResetRewardRpc(agent, data) | ||
682 | reward, change = role:award(reward, {log = {desc = "resetHero", int1 = msg.id, int2 = hero:getProperty("type")}}) | 709 | reward, change = role:award(reward, {log = {desc = "resetHero", int1 = msg.id, int2 = hero:getProperty("type")}}) |
683 | 710 | ||
684 | role:log("hero_recycle", { | 711 | role:log("hero_recycle", { |
685 | - hero_recycle_list = hero:getProperty("type"), -- 回收的英雄id列表,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | 712 | + hero_recycle_list = {[hero:getProperty("type")] = 1}, -- 回收的英雄id列表,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
686 | hero_recycle_reward = reward, -- 回收后获得的奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | 713 | hero_recycle_reward = reward, -- 回收后获得的奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
687 | hero_recycle_cnt = 1, -- 总回收英雄量 | 714 | hero_recycle_cnt = 1, -- 总回收英雄量 |
688 | }) | 715 | }) |
@@ -813,6 +840,7 @@ function _M.drawHeroRpc(agent, data) | @@ -813,6 +840,7 @@ function _M.drawHeroRpc(agent, data) | ||
813 | 840 | ||
814 | local ssrCount = 0 | 841 | local ssrCount = 0 |
815 | local reward = {} | 842 | local reward = {} |
843 | + local logReward = {} | ||
816 | for i = 1, drawCount[drawType] do | 844 | for i = 1, drawCount[drawType] do |
817 | floorHeroCount = floorHeroCount + 1 | 845 | floorHeroCount = floorHeroCount + 1 |
818 | 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 |
@@ -843,9 +871,11 @@ function _M.drawHeroRpc(agent, data) | @@ -843,9 +871,11 @@ function _M.drawHeroRpc(agent, data) | ||
843 | local heroData = csvdb["unitCsv"][fragId] | 871 | local heroData = csvdb["unitCsv"][fragId] |
844 | local count = globalCsv.draw_unit_tofragment[heroData.rare] | 872 | local count = globalCsv.draw_unit_tofragment[heroData.rare] |
845 | 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 | ||
846 | table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) | 875 | table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) |
847 | else | 876 | else |
848 | 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 | ||
849 | table.insert(reward, {id = itemId, count = 1}) | 879 | table.insert(reward, {id = itemId, count = 1}) |
850 | end | 880 | end |
851 | end | 881 | end |
@@ -856,27 +886,50 @@ function _M.drawHeroRpc(agent, data) | @@ -856,27 +886,50 @@ function _M.drawHeroRpc(agent, data) | ||
856 | role:setProperty("floorHero", floorHero) | 886 | role:setProperty("floorHero", floorHero) |
857 | end | 887 | end |
858 | 888 | ||
859 | - if btype == 1 or btype == 2 then | ||
860 | - local repayHero = role:getProperty("repayHero") or 0 | ||
861 | - repayHero = repayHero + drawCount[drawType] | ||
862 | - role:updateProperty({field = "repayHero", value = repayHero}) | ||
863 | - end | ||
864 | - | ||
865 | role:checkTaskEnter("DrawHero", {pool = btype, count = drawCount[drawType]}) | 889 | role:checkTaskEnter("DrawHero", {pool = btype, count = drawCount[drawType]}) |
866 | if ssrCount > 0 then | 890 | if ssrCount > 0 then |
867 | role:checkTaskEnter("DrawSSR", {count = ssrCount}) | 891 | role:checkTaskEnter("DrawSSR", {count = ssrCount}) |
868 | end | 892 | end |
869 | role:finishGuide(11) | 893 | role:finishGuide(11) |
870 | - | 894 | + |
871 | role:log("gacha", { | 895 | role:log("gacha", { |
872 | gacha_id = poolId, -- 卡池ID | 896 | gacha_id = poolId, -- 卡池ID |
873 | gacha_type = btype, -- 卡池类型 | 897 | gacha_type = btype, -- 卡池类型 |
874 | gacha_up = 0, -- 卡池UP角色 | 898 | gacha_up = 0, -- 卡池UP角色 |
875 | gacha_times = drawCount[drawType], -- 抽卡次数 | 899 | gacha_times = drawCount[drawType], -- 抽卡次数 |
876 | - gacha_reward = reward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | 900 | + gacha_reward = logReward, -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
877 | currency = cost, -- 购买道具消耗的货币 | 901 | currency = cost, -- 购买道具消耗的货币 |
902 | + gacha_cnt = floorHeroCount, | ||
878 | }) | 903 | }) |
879 | 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 | ||
880 | return true | 933 | return true |
881 | end | 934 | end |
882 | 935 | ||
@@ -905,6 +958,7 @@ function _M.repayHeroRpc(agent, data) | @@ -905,6 +958,7 @@ function _M.repayHeroRpc(agent, data) | ||
905 | role:award({[id] = 1}, {log = {desc = "heroRepay"}}) | 958 | role:award({[id] = 1}, {log = {desc = "heroRepay"}}) |
906 | reward = {id = id, count = 1} | 959 | reward = {id = id, count = 1} |
907 | end | 960 | end |
961 | + role:mylog("hero_action", {desc = "heroRepay", int1=result}) | ||
908 | SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward})) | 962 | SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward})) |
909 | return true | 963 | return true |
910 | end | 964 | end |
@@ -936,7 +990,7 @@ function _M.unlockPoolRpc(agent, data) | @@ -936,7 +990,7 @@ function _M.unlockPoolRpc(agent, data) | ||
936 | role.dailyData:updateProperty({field="unlockPool", value = unlockPool}) | 990 | role.dailyData:updateProperty({field="unlockPool", value = unlockPool}) |
937 | role.dailyData:updateProperty({field="curPool", value = type}) | 991 | role.dailyData:updateProperty({field="curPool", value = type}) |
938 | 992 | ||
939 | - --role:log("hero_action", {desc = "unlockPool", int1=type}) | 993 | + role:mylog("hero_action", {desc = "unlockPool", int1=type}) |
940 | SendPacket(actionCodes.Hero_unlockPoolRpc, MsgPack.pack({})) | 994 | SendPacket(actionCodes.Hero_unlockPoolRpc, MsgPack.pack({})) |
941 | return true | 995 | return true |
942 | 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
@@ -173,6 +173,7 @@ function _M.loginRpc( agent, data ) | @@ -173,6 +173,7 @@ function _M.loginRpc( agent, data ) | ||
173 | response.role = role:data() | 173 | response.role = role:data() |
174 | response.result = "SUCCESS" | 174 | response.result = "SUCCESS" |
175 | response.serverTime = now | 175 | response.serverTime = now |
176 | + --response.openTime = getServerOpenTs() | ||
176 | 177 | ||
177 | local modules = {} | 178 | local modules = {} |
178 | 179 | ||
@@ -548,7 +549,6 @@ function _M.openTimeBoxRpc(agent, data) | @@ -548,7 +549,6 @@ function _M.openTimeBoxRpc(agent, data) | ||
548 | local quick = msg.quick | 549 | local quick = msg.quick |
549 | if not boxL[slot] then return end | 550 | if not boxL[slot] then return end |
550 | local costKey = 0 | 551 | local costKey = 0 |
551 | - local costTime = skynet.timex() - boxL[slot].time | ||
552 | if boxL[slot].time > skynet.timex() then -- 没开完 | 552 | if boxL[slot].time > skynet.timex() then -- 没开完 |
553 | if not quick then return end | 553 | if not quick then return end |
554 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") | 554 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") |
@@ -559,6 +559,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -559,6 +559,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
559 | local boxId = boxL[slot].id | 559 | local boxId = boxL[slot].id |
560 | local itemData = csvdb["itemCsv"][boxId] | 560 | local itemData = csvdb["itemCsv"][boxId] |
561 | local randomData = csvdb["item_randomCsv"][itemData.id] | 561 | local randomData = csvdb["item_randomCsv"][itemData.id] |
562 | + local costTime = skynet.timex() - (boxL[slot].time - randomData.openTime) | ||
562 | -- 随机奖励 | 563 | -- 随机奖励 |
563 | reward = {} | 564 | reward = {} |
564 | for i = 1, 10 do | 565 | for i = 1, 10 do |
@@ -683,7 +684,7 @@ function _M.storyBookRewardRpc(agent, data) | @@ -683,7 +684,7 @@ function _M.storyBookRewardRpc(agent, data) | ||
683 | role:changeUpdates({{ type = "storyB", field = storyId, value = storyStatus[storyId] }}) | 684 | role:changeUpdates({{ type = "storyB", field = storyId, value = storyStatus[storyId] }}) |
684 | local reward, change = role:award(storyBookData.gift, {log = {desc = "storybookReward", int1 = storyId}}) | 685 | local reward, change = role:award(storyBookData.gift, {log = {desc = "storybookReward", int1 = storyId}}) |
685 | 686 | ||
686 | - role:log("carriage_decals", { | 687 | + role:log("carriage_video", { |
687 | carriage_video_type = storyBookData.type, --放映室类型,剧情CG:0, 角色CG:1, 主线剧情:2, 角色剧情:3, 活动剧情:4, 图鉴:5 | 688 | carriage_video_type = storyBookData.type, --放映室类型,剧情CG:0, 角色CG:1, 主线剧情:2, 角色剧情:3, 活动剧情:4, 图鉴:5 |
688 | carriage_video_id = storyId, --放映室片段ID | 689 | carriage_video_id = storyId, --放映室片段ID |
689 | carriage_video_coinid = reward[ItemId.Gold] and ItemId.Gold or 0, --放映奖励货币类型,无奖励则填写0 | 690 | carriage_video_coinid = reward[ItemId.Gold] and ItemId.Gold or 0, --放映奖励货币类型,无奖励则填写0 |
@@ -1194,4 +1195,42 @@ function _M.getDownloadCvRewardRpc(agent, data) | @@ -1194,4 +1195,42 @@ function _M.getDownloadCvRewardRpc(agent, data) | ||
1194 | return true | 1195 | return true |
1195 | end | 1196 | end |
1196 | 1197 | ||
1198 | +function _M.updateFeedbackInfoRpc(agent, data) | ||
1199 | + local role = agent.role | ||
1200 | + local info = role:getProperty("feedback") or {} | ||
1201 | + local msg = MsgPack.unpack(data) | ||
1202 | + info["flag"] = msg.flag | ||
1203 | + info["count"] = msg.count | ||
1204 | + info["ts"] = skynet.timex() | ||
1205 | + role:updateProperty({field="feedback", value=info}) | ||
1206 | + SendPacket(actionCodes.Role_updateFeedbackInfoRpc, MsgPack.pack({})) | ||
1207 | + return true | ||
1208 | +end | ||
1209 | + | ||
1210 | +function _M.useSelectItemRpc(agent, data) | ||
1211 | + local role = agent.role | ||
1212 | + local msg = MsgPack.unpack(data) | ||
1213 | + local itemId = msg.itemId | ||
1214 | + local subId = msg.subId | ||
1215 | + local count = msg.count | ||
1216 | + if math.illegalNum(count, 1, role:getItemCount(itemId)) then return end | ||
1217 | + local itemData = csvdb["itemCsv"][itemId] | ||
1218 | + if itemData.type ~= ItemType.SelectItemBox then return end | ||
1219 | + local itemMap = itemData.use_effect:toNumMap() | ||
1220 | + local reward, change = {} | ||
1221 | + for k, v in pairs(itemMap) do | ||
1222 | + if k == subId then | ||
1223 | + reward[k] = v * count | ||
1224 | + break | ||
1225 | + end | ||
1226 | + end | ||
1227 | + | ||
1228 | + if next(reward) then | ||
1229 | + reward, change = role:award(reward, {log = {desc = "openItem", int1 = itemId, int2 = count}}) | ||
1230 | + role:costItems({[itemId] = count}, {log = {desc = "openItem"}}) | ||
1231 | + end | ||
1232 | + SendPacket(actionCodes.Role_useSelectItemRpc, MsgPack.pack(role:packReward(reward, change))) | ||
1233 | + return true | ||
1234 | +end | ||
1235 | + | ||
1197 | return _M | 1236 | return _M |
1198 | \ No newline at end of file | 1237 | \ 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 |
@@ -322,6 +323,7 @@ function _M.getGrowFundRewardRpc(agent, data) | @@ -322,6 +323,7 @@ function _M.getGrowFundRewardRpc(agent, data) | ||
322 | return true | 323 | return true |
323 | end | 324 | end |
324 | 325 | ||
326 | +-- 赛季卡 | ||
325 | function _M.getBattlePassRewardRpc(agent, data) | 327 | function _M.getBattlePassRewardRpc(agent, data) |
326 | local role = agent.role | 328 | local role = agent.role |
327 | local msg = MsgPack.unpack(data) | 329 | local msg = MsgPack.unpack(data) |
@@ -376,4 +378,66 @@ function _M.getBattlePassRewardRpc(agent, data) | @@ -376,4 +378,66 @@ function _M.getBattlePassRewardRpc(agent, data) | ||
376 | return true | 378 | return true |
377 | end | 379 | end |
378 | 380 | ||
381 | +-- 探索指令奖励 | ||
382 | +function _M.getExploreCommandRewardRpc(agent, data) | ||
383 | + local role = agent.role | ||
384 | + local msg = MsgPack.unpack(data) | ||
385 | + local id = msg.id -- 探索id | ||
386 | + local subId = msg.subId -- 领取的阶段id | ||
387 | + | ||
388 | + local tab_name = "reward_levelpass" .. id .. "Csv" | ||
389 | + local config = csvdb[tab_name][subId] | ||
390 | + if not config then return end | ||
391 | + | ||
392 | + local bpInfo = role.storeData:getProperty("bpInfo") or {} | ||
393 | + local info = bpInfo[id] or {} | ||
394 | + local flag = info["flag"] or 0 | ||
395 | + --if flag == 0 then return 1 end | ||
396 | + | ||
397 | + local freeRecord = info["fr"] or "" | ||
398 | + local buyRecord = info["br"] or "" | ||
399 | + | ||
400 | + local freeFlag = string.char(string.getbit(freeRecord, subId)) | ||
401 | + local limitFlag = string.char(string.getbit(buyRecord, subId)) | ||
402 | + | ||
403 | + if freeFlag == "1" and limitFlag == "1" then | ||
404 | + skynet.error("user already get explore command reward") | ||
405 | + return 2 | ||
406 | + end | ||
407 | + | ||
408 | + if flag == 1 and limitFlag == "1" then | ||
409 | + return 3 | ||
410 | + end | ||
411 | + | ||
412 | + if not role:checkHangPass(config.level) then | ||
413 | + return 4 | ||
414 | + end | ||
415 | + | ||
416 | + local gift = "" | ||
417 | + if freeFlag == "0" then | ||
418 | + gift = config.giftFree | ||
419 | + | ||
420 | + freeRecord = string.setbit(freeRecord, subId) | ||
421 | + info["fr"] = freeRecord | ||
422 | + end | ||
423 | + | ||
424 | + if flag == 1 and limitFlag == "0" then | ||
425 | + if gift ~= "" then | ||
426 | + gift = gift .. " " | ||
427 | + end | ||
428 | + gift = gift .. config.giftLimit | ||
429 | + | ||
430 | + buyRecord = string.setbit(buyRecord, subId) | ||
431 | + info["br"] = buyRecord | ||
432 | + end | ||
433 | + | ||
434 | + bpInfo[id] = info | ||
435 | + role.storeData:updateProperty({field = "bpInfo", value = bpInfo}) | ||
436 | + | ||
437 | + local reward, _ = role:award(gift, {log = {desc = "exploreCommand", int1 = id, int2 = subId}}) | ||
438 | + | ||
439 | + SendPacket(actionCodes.Store_getExploreCommandRewardRpc, MsgPack.pack({reward = reward})) | ||
440 | + return true | ||
441 | +end | ||
442 | + | ||
379 | return _M | 443 | return _M |
380 | \ No newline at end of file | 444 | \ No newline at end of file |
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 | -- 支援效果继续选择 |
@@ -789,9 +806,15 @@ function Adv:over(success, rewardRatio, overType) | @@ -789,9 +806,15 @@ function Adv:over(success, rewardRatio, overType) | ||
789 | red:hset(RANK_ADV_INFO, roleId, MsgPack.pack(curInfo)) | 806 | red:hset(RANK_ADV_INFO, roleId, MsgPack.pack(curInfo)) |
790 | end) | 807 | end) |
791 | end | 808 | end |
809 | + -- 通关的时候要把引导步骤设定到成就引导 | ||
810 | + if not self.owner:checkOverGuide(57) then | ||
811 | + self.owner:saveGuide(57,1,true) | ||
812 | + end | ||
792 | end | 813 | end |
793 | self:clearAdvUnlockCache() | 814 | self:clearAdvUnlockCache() |
794 | 815 | ||
816 | + self:mylog({desc = "over", short1 = success and 1 or 0, int1 = overType}) | ||
817 | + | ||
795 | local chapterId = self.chapterId | 818 | local chapterId = self.chapterId |
796 | self:clear() | 819 | self:clear() |
797 | self.owner:checkTaskEnter("AdvScore", {score = score}) | 820 | self.owner:checkTaskEnter("AdvScore", {score = score}) |
@@ -895,23 +918,26 @@ function Adv:award(gift, params) | @@ -895,23 +918,26 @@ function Adv:award(gift, params) | ||
895 | items = items:setv(itemId, nums) | 918 | items = items:setv(itemId, nums) |
896 | end | 919 | end |
897 | 920 | ||
898 | - -- if params.log then | ||
899 | - -- local log = clone(params.log) | ||
900 | - -- if log["cint1"] or log["cint2"] or log["cint3"] or log["long1"] then | ||
901 | - -- print("addAdvItem error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
902 | - -- end | ||
903 | - -- log["cint1"] = itemId | ||
904 | - -- log["cint2"] = math.abs(count) | ||
905 | - -- log["cint3"] = self.chapterId | ||
906 | - -- log["long1"] = self.level | ||
907 | - -- if count >= 0 then | ||
908 | - -- self.owner:log("in_adv", log) | ||
909 | - -- else | ||
910 | - -- self.owner:log("out_adv", log) | ||
911 | - -- end | ||
912 | - -- else | ||
913 | - -- print("addAdvItem no log ", debug.traceback()) | ||
914 | - -- 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 | ||
915 | end | 941 | end |
916 | end | 942 | end |
917 | if items ~= oldItems then | 943 | if items ~= oldItems then |
@@ -1005,6 +1031,7 @@ local function clickOut(self, room, block, params, isExit) | @@ -1005,6 +1031,7 @@ local function clickOut(self, room, block, params, isExit) | ||
1005 | isRelay = true, | 1031 | isRelay = true, |
1006 | }) | 1032 | }) |
1007 | else | 1033 | else |
1034 | + self:mylog({desc = "pass"}) | ||
1008 | self:initByChapter({ | 1035 | self:initByChapter({ |
1009 | chapterId = self.chapterId, | 1036 | chapterId = self.chapterId, |
1010 | level = self.level + 1, | 1037 | level = self.level + 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
@@ -53,6 +53,8 @@ end | @@ -53,6 +53,8 @@ end | ||
53 | 53 | ||
54 | local _pipelinings = {} --可同时多个序列 栈的形式保证嵌套不出错 | 54 | local _pipelinings = {} --可同时多个序列 栈的形式保证嵌套不出错 |
55 | function SendPacket(actionCode, bin, client_fd) | 55 | function SendPacket(actionCode, bin, client_fd) |
56 | + --print(actionHandlers[actionCode]) | ||
57 | + --dump(MsgPack.unpack(bin)) | ||
56 | -- 内部消息不扩散出去 | 58 | -- 内部消息不扩散出去 |
57 | if actionCode == actionCodes.Sys_endlessSeason then | 59 | if actionCode == actionCodes.Sys_endlessSeason then |
58 | if agentInfo.role then | 60 | if agentInfo.role then |
@@ -283,6 +285,7 @@ function CMD.close() | @@ -283,6 +285,7 @@ function CMD.close() | ||
283 | local role = agentInfo.role | 285 | local role = agentInfo.role |
284 | if not role then return end | 286 | if not role then return end |
285 | 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")}) | ||
286 | role:onOfflineEvent() | 289 | role:onOfflineEvent() |
287 | end | 290 | end |
288 | 291 |
src/models/Activity.lua
@@ -8,6 +8,8 @@ Activity.ActivityType = { | @@ -8,6 +8,8 @@ Activity.ActivityType = { | ||
8 | DrawHero = 4, --抽卡周 招募 | 8 | DrawHero = 4, --抽卡周 招募 |
9 | AdvDraw = 5, --拾荒抽周 资助 | 9 | AdvDraw = 5, --拾荒抽周 资助 |
10 | OpenBox = 6, --拆解周 时钟箱 | 10 | OpenBox = 6, --拆解周 时钟箱 |
11 | + PaySignIn = 7, --付费签到 | ||
12 | + PayBack = 9, --返利 | ||
11 | 13 | ||
12 | SsrUpPoolChange = 10, -- 特定英雄活动,切卡池 | 14 | SsrUpPoolChange = 10, -- 特定英雄活动,切卡池 |
13 | } | 15 | } |
@@ -36,6 +38,8 @@ Activity.schema = { | @@ -36,6 +38,8 @@ Activity.schema = { | ||
36 | act4 = {"table", {}}, -- {0 = 贩卖数量, 1=1, 2=1} 贩卖周活动 1表示领取过该档位的奖励 | 38 | act4 = {"table", {}}, -- {0 = 贩卖数量, 1=1, 2=1} 贩卖周活动 1表示领取过该档位的奖励 |
37 | act5 = {"table", {}}, -- {0 = 拆解数量, 1=1, 2=1} 拆解周活动 1表示领取过该档位的奖励 | 39 | act5 = {"table", {}}, -- {0 = 拆解数量, 1=1, 2=1} 拆解周活动 1表示领取过该档位的奖励 |
38 | act6 = {"table", {}}, -- {0 = 拾荒消耗远古金币数量, 1=1, 2=1} 拾荒周活动 1表示领取过该档位的奖励 | 40 | act6 = {"table", {}}, -- {0 = 拾荒消耗远古金币数量, 1=1, 2=1} 拾荒周活动 1表示领取过该档位的奖励 |
41 | + act7 = {"table", {}}, -- {1 = 1, 2 = 1} == 付费签到活动 | ||
42 | + act9 = {"number", 0}, -- 充值返利 | ||
39 | } | 43 | } |
40 | 44 | ||
41 | function Activity:data() | 45 | function Activity:data() |
@@ -47,6 +51,8 @@ function Activity:data() | @@ -47,6 +51,8 @@ function Activity:data() | ||
47 | act4 = self:getProperty("act4"), | 51 | act4 = self:getProperty("act4"), |
48 | act5 = self:getProperty("act5"), | 52 | act5 = self:getProperty("act5"), |
49 | act6 = self:getProperty("act6"), | 53 | act6 = self:getProperty("act6"), |
54 | + act7 = self:getProperty("act7"), | ||
55 | + act9 = self:getProperty("act9"), | ||
50 | } | 56 | } |
51 | end | 57 | end |
52 | 58 | ||
@@ -257,7 +263,6 @@ activityFunc[Activity.ActivityType.DrawHero] = { | @@ -257,7 +263,6 @@ activityFunc[Activity.ActivityType.DrawHero] = { | ||
257 | -- ["close"] = function(self, actType, notify) | 263 | -- ["close"] = function(self, actType, notify) |
258 | -- end, | 264 | -- end, |
259 | ["crossDay"] = function(self, actType, notify) | 265 | ["crossDay"] = function(self, actType, notify) |
260 | - print("cross day draw card") | ||
261 | self.owner:sendMail(MailId.ActDrawCard) | 266 | self.owner:sendMail(MailId.ActDrawCard) |
262 | end, | 267 | end, |
263 | } | 268 | } |
@@ -275,7 +280,6 @@ activityFunc[Activity.ActivityType.FoodSell] = { | @@ -275,7 +280,6 @@ activityFunc[Activity.ActivityType.FoodSell] = { | ||
275 | -- ["close"] = function(self, actType, notify) | 280 | -- ["close"] = function(self, actType, notify) |
276 | -- end, | 281 | -- end, |
277 | ["crossDay"] = function(self, actType, notify) | 282 | ["crossDay"] = function(self, actType, notify) |
278 | - print("cross day sell food") | ||
279 | self.owner:sendMail(MailId.ActSellFood) | 283 | self.owner:sendMail(MailId.ActSellFood) |
280 | end, | 284 | end, |
281 | } | 285 | } |
@@ -310,11 +314,37 @@ activityFunc[Activity.ActivityType.OpenBox] = { | @@ -310,11 +314,37 @@ activityFunc[Activity.ActivityType.OpenBox] = { | ||
310 | -- ["close"] = function(self, actType, notify) | 314 | -- ["close"] = function(self, actType, notify) |
311 | -- end, | 315 | -- end, |
312 | ["crossDay"] = function(self, actType, notify) | 316 | ["crossDay"] = function(self, actType, notify) |
313 | - print("cross day open box") | ||
314 | self.owner:sendMail(MailId.ActOpenBox) | 317 | self.owner:sendMail(MailId.ActOpenBox) |
315 | end, | 318 | end, |
316 | } | 319 | } |
317 | 320 | ||
321 | +-- 付费签到 | ||
322 | +activityFunc[Activity.ActivityType.PaySignIn] = { | ||
323 | + ["init"] = function(self, actType, isCrossDay, notify) | ||
324 | + self:updateActData(actType, {}, not notify) | ||
325 | + end, | ||
326 | + -- ["close"] = function(self, actType, notify) | ||
327 | + -- end, | ||
328 | +} | ||
329 | + | ||
330 | +-- 充值反馈 | ||
331 | +activityFunc[Activity.ActivityType.PayBack] = { | ||
332 | + ["check"] = function(self, actType, notify, twd) -- 检查 | ||
333 | + local oldVal = self:getActData(actType) or 0 | ||
334 | + local newVal = oldVal + twd | ||
335 | + local gift = self.owner:getPaybackReward(oldVal, newVal) | ||
336 | + if gift ~= "" then | ||
337 | + self.owner:sendMail(MailId.MonthCard, nil, gift) | ||
338 | + end | ||
339 | + self:updateActData(actType, newVal, not notify) | ||
340 | + end, | ||
341 | + ["init"] = function(self, actType, isCrossDay, notify) | ||
342 | + self:updateActData(actType, {}, not notify) | ||
343 | + end, | ||
344 | + -- ["close"] = function(self, actType, notify) | ||
345 | + -- end, | ||
346 | +} | ||
347 | + | ||
318 | function Activity:initActivity(actType, isCrossDay, notify) | 348 | function Activity:initActivity(actType, isCrossDay, notify) |
319 | if activityFunc[actType] and activityFunc[actType]['close'] then | 349 | if activityFunc[actType] and activityFunc[actType]['close'] then |
320 | activityFunc[actType]["init"](self, actType, isCrossDay, notify) | 350 | activityFunc[actType]["init"](self, actType, isCrossDay, notify) |
@@ -384,5 +414,46 @@ function Activity:getActivityPool(mainType, subType) | @@ -384,5 +414,46 @@ function Activity:getActivityPool(mainType, subType) | ||
384 | return 0 | 414 | return 0 |
385 | end | 415 | end |
386 | 416 | ||
417 | +-- 付费签到可领奖励 | ||
418 | +function Activity:getPaySignReward() | ||
419 | + local actGoodsFlag = self.owner.storeData:getProperty("actGoodsFlag") | ||
420 | + local index = GetActGoodsIndex("paySignIn") | ||
421 | + local flag = actGoodsFlag[index] or 0 | ||
422 | + if flag == 0 then return {} end | ||
423 | + | ||
424 | + if not self.owner.activity:isOpen("PaySignIn") then return {} end | ||
425 | + | ||
426 | + local diffDay = diffFromOpen() + 1 | ||
427 | + | ||
428 | + local curData = self:getActData("PaySignIn") | ||
429 | + local reward, change = {} | ||
430 | + for day, csvData in pairs(csvdb["pay_signInCsv"]) do | ||
431 | + if day <= diffDay then | ||
432 | + if not curData[day] then | ||
433 | + curData[day] = 1 | ||
434 | + -- 奖励 | ||
435 | + for itemId, count in pairs(csvData.reward:toNumMap()) do | ||
436 | + reward[itemId] = (reward[itemId] or 0) + count | ||
437 | + end | ||
438 | + end | ||
439 | + else | ||
440 | + break | ||
441 | + end | ||
442 | + end | ||
443 | + return reward, curData | ||
444 | + --if next(reward) then | ||
445 | + --role.activity:updateActData("PaySignIn", curData) | ||
446 | + --reward, change = role:award(reward, {log = {desc = "actPaySign"}}) | ||
447 | + --end | ||
448 | + | ||
449 | + --role:log("activity", { | ||
450 | + -- activity_id = curData[0], -- 活动ID(或活动指定任务的ID) | ||
451 | + -- activity_type = role.activity.ActivityType.PaySignIn, -- 活动类型,见活动类型枚举表 | ||
452 | + -- activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} | ||
453 | + --}) | ||
454 | + | ||
455 | + --SendPacket(actionCodes.Activity_actPaySignRpc, MsgPack.pack(role:packReward(reward, change))) | ||
456 | +end | ||
457 | + | ||
387 | 458 | ||
388 | return Activity | 459 | return Activity |
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
@@ -149,6 +149,7 @@ Role.schema = { | @@ -149,6 +149,7 @@ Role.schema = { | ||
149 | battlePoint = {"number", 0}, -- 赛季卡使用的活跃点 | 149 | battlePoint = {"number", 0}, -- 赛季卡使用的活跃点 |
150 | 150 | ||
151 | rmbC = {"number", 0}, -- 人民币重置额 | 151 | rmbC = {"number", 0}, -- 人民币重置额 |
152 | + twdC = {"number", 0}, -- 台币总充值金额 | ||
152 | 153 | ||
153 | emailSync = {"number", 0}, -- 已经同步到的邮件Id | 154 | emailSync = {"number", 0}, -- 已经同步到的邮件Id |
154 | 155 | ||
@@ -165,6 +166,7 @@ Role.schema = { | @@ -165,6 +166,7 @@ Role.schema = { | ||
165 | chatline = {"table", {}}, -- 奖励发放 id=时间 | 166 | chatline = {"table", {}}, -- 奖励发放 id=时间 |
166 | 167 | ||
167 | downCvR = {"number", 0}, -- 下载cv扩展包奖励 | 168 | downCvR = {"number", 0}, -- 下载cv扩展包奖励 |
169 | + feedback = {"table", {}}, -- 反馈相关信息 {flag = false, count = 0} flag是否评论过,count 提示次数 | ||
168 | } | 170 | } |
169 | 171 | ||
170 | 172 | ||
@@ -372,6 +374,7 @@ function Role:data() | @@ -372,6 +374,7 @@ function Role:data() | ||
372 | battlePoint = self:getProperty("battlePoint"), | 374 | battlePoint = self:getProperty("battlePoint"), |
373 | 375 | ||
374 | rmbC = self:getProperty("rmbC"), | 376 | rmbC = self:getProperty("rmbC"), |
377 | + twdC = self:getProperty("twdC"), | ||
375 | repayHero = self:getProperty("repayHero"), | 378 | repayHero = self:getProperty("repayHero"), |
376 | newerDraw = self:getProperty("newerDraw"), | 379 | newerDraw = self:getProperty("newerDraw"), |
377 | floorHero = self:getProperty("floorHero"), | 380 | floorHero = self:getProperty("floorHero"), |
@@ -383,6 +386,7 @@ function Role:data() | @@ -383,6 +386,7 @@ function Role:data() | ||
383 | chatline = self:getProperty("chatline"), | 386 | chatline = self:getProperty("chatline"), |
384 | 387 | ||
385 | downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励 | 388 | downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励 |
389 | + feedback = self:getProperty("feedback") | ||
386 | } | 390 | } |
387 | end | 391 | end |
388 | 392 |
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 购买/兑换行为 |
@@ -38,6 +39,9 @@ local ItemReason = { | @@ -38,6 +39,9 @@ local ItemReason = { | ||
38 | startPvp = 124, -- 开始pvp | 39 | startPvp = 124, -- 开始pvp |
39 | unlockStory = 125, -- 解锁剧情 | 40 | unlockStory = 125, -- 解锁剧情 |
40 | towerCount = 126, -- 电波塔次数 | 41 | towerCount = 126, -- 电波塔次数 |
42 | + freeGift = 127, -- 免费礼包 | ||
43 | + exploreCommand = 128, -- 探索指令 | ||
44 | + drawHeroExtraReward = 129, -- 抽卡阶段奖励 | ||
41 | 45 | ||
42 | 46 | ||
43 | advHang = 301, -- 拾荒挂机 | 47 | advHang = 301, -- 拾荒挂机 |
@@ -75,6 +79,7 @@ local ItemReason = { | @@ -75,6 +79,7 @@ local ItemReason = { | ||
75 | friendPoint = 1005, -- 友情 | 79 | friendPoint = 1005, -- 友情 |
76 | birth = 1006, -- 出生奖励 | 80 | birth = 1006, -- 出生奖励 |
77 | actSign = 1007, -- 活动签到 | 81 | actSign = 1007, -- 活动签到 |
82 | + actPaySign = 1008, -- 活动付费签到 | ||
78 | 83 | ||
79 | -- 餐厅 | 84 | -- 餐厅 |
80 | greenHourse = 1101, -- 食材获得 | 85 | greenHourse = 1101, -- 食材获得 |
@@ -98,6 +103,7 @@ local ItemReason = { | @@ -98,6 +103,7 @@ local ItemReason = { | ||
98 | resetHero = 1207, -- 重置养成 | 103 | resetHero = 1207, -- 重置养成 |
99 | unlockPool = 1208, -- 解锁英雄定向抽卡池 | 104 | unlockPool = 1208, -- 解锁英雄定向抽卡池 |
100 | downloadCv = 1209, -- 下载 cv包奖励 | 105 | downloadCv = 1209, -- 下载 cv包奖励 |
106 | + refer = 1210, -- 穿戴 | ||
101 | } | 107 | } |
102 | 108 | ||
103 | 109 | ||
@@ -193,10 +199,9 @@ local MethodType = { | @@ -193,10 +199,9 @@ local MethodType = { | ||
193 | mission_strength = true, -- 消耗的体力或次数 | 199 | mission_strength = true, -- 消耗的体力或次数 |
194 | mission_score = true, -- 本局分数,PVP玩法记录为对战后积分,无得分的填0 | 200 | mission_score = true, -- 本局分数,PVP玩法记录为对战后积分,无得分的填0 |
195 | mission_cleartype = true, -- 1正常通关;2代理拾荒 | 201 | mission_cleartype = true, -- 1正常通关;2代理拾荒 |
196 | - mission_rank = true, -- 对战后排名,适用于PVP玩法和电波塔,其他玩法留空 | 202 | + mission_rank = "auto", -- 对战后排名,适用于PVP玩法和电波塔,其他玩法留空 |
197 | misson_monsterkill = "json", -- 击杀怪物ID和数量,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | 203 | misson_monsterkill = "json", -- 击杀怪物ID和数量,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
198 | misson_teamskill = "json", -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..} | 204 | misson_teamskill = "json", -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..} |
199 | - misson_teambond = "json", -- 编队羁绊和羁绊等级,json格式记录,{"bondid1":1,"bondid2":2,………..} | ||
200 | }, | 205 | }, |
201 | residence_reward = { --玩家挂机或排名奖励 | 206 | residence_reward = { --玩家挂机或排名奖励 |
202 | mission_threadid = true, --大关卡ID | 207 | mission_threadid = true, --大关卡ID |
@@ -210,6 +215,7 @@ local MethodType = { | @@ -210,6 +215,7 @@ local MethodType = { | ||
210 | hero_id = true, --英雄ID | 215 | hero_id = true, --英雄ID |
211 | hero_rise_cost = "json", --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} | 216 | hero_rise_cost = "json", --英雄觉醒消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
212 | hero_rise_score = true, --英雄觉醒后评分提升 | 217 | hero_rise_score = true, --英雄觉醒后评分提升 |
218 | + hero_rise_scoreget = true, -- 提升的评分 | ||
213 | hero_rise_result = "json", --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} | 219 | hero_rise_result = "json", --英雄觉醒效果,可记录效果ID,或json格式记录提升效果,{攻击:20,闪避:20,……..} |
214 | }, | 220 | }, |
215 | hero_upgrade = { --英雄升级 | 221 | hero_upgrade = { --英雄升级 |
@@ -231,6 +237,7 @@ local MethodType = { | @@ -231,6 +237,7 @@ local MethodType = { | ||
231 | hero_talent_cost = "json", -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} | 237 | hero_talent_cost = "json", -- 英雄天赋升级消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
232 | hero_talent_levelbef = true, -- 英雄技能升级前等级 | 238 | hero_talent_levelbef = true, -- 英雄技能升级前等级 |
233 | hero_talent_level = true, -- 英雄技能升级后等级 | 239 | hero_talent_level = true, -- 英雄技能升级后等级 |
240 | + hero_talent_id = true, -- 天赋id | ||
234 | }, | 241 | }, |
235 | hero_jewel = { --英雄铭文 | 242 | hero_jewel = { --英雄铭文 |
236 | hero_id = true, -- 英雄ID | 243 | hero_id = true, -- 英雄ID |
@@ -262,6 +269,7 @@ local MethodType = { | @@ -262,6 +269,7 @@ local MethodType = { | ||
262 | gacha_times = true, -- 抽卡次数 | 269 | gacha_times = true, -- 抽卡次数 |
263 | gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | 270 | gacha_reward = "json", -- 抽卡结果,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
264 | currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} | 271 | currency = "json", -- 消耗,json格式记录,{道具ID1:消耗数量1,道具ID2:消耗数量2,………...} |
272 | + gacha_cnt = true, -- 保底计数 | ||
265 | }, | 273 | }, |
266 | equip_wear = { --装备穿戴与卸载 | 274 | equip_wear = { --装备穿戴与卸载 |
267 | hero_id = true, --英雄ID | 275 | hero_id = true, --英雄ID |
@@ -279,7 +287,7 @@ local MethodType = { | @@ -279,7 +287,7 @@ local MethodType = { | ||
279 | equip_upgrade_amount = true, -- 升级获取的装备数量 | 287 | equip_upgrade_amount = true, -- 升级获取的装备数量 |
280 | equip_upgrade_usedid = true, -- 升级消耗的装备ID | 288 | equip_upgrade_usedid = true, -- 升级消耗的装备ID |
281 | equip_upgrade_cost = true, -- 升级操作消耗装备数量 | 289 | equip_upgrade_cost = true, -- 升级操作消耗装备数量 |
282 | - equip_upgrade_current = true, -- 升级操作消耗货币数量 | 290 | + equip_upgrade_current = "json", -- 升级操作消耗货币数量 |
283 | }, | 291 | }, |
284 | carriage_dismantle = { --物资拆解 | 292 | carriage_dismantle = { --物资拆解 |
285 | item_id = true, -- 道具id | 293 | item_id = true, -- 道具id |
@@ -459,6 +467,178 @@ local function getBaseLog(self) | @@ -459,6 +467,178 @@ local function getBaseLog(self) | ||
459 | end | 467 | end |
460 | 468 | ||
461 | 469 | ||
470 | +-- logType | ||
471 | +local LogType = { | ||
472 | + create = "common", | ||
473 | + login = "common", | ||
474 | + logout = "common", | ||
475 | + guide = "common", | ||
476 | + | ||
477 | + in_item = "common", | ||
478 | + out_item = "common", | ||
479 | + in_diamond = "common", | ||
480 | + out_diamond = "common", | ||
481 | + in_hero = "common", | ||
482 | + out_hero = "common", | ||
483 | + in_equip = "common", | ||
484 | + out_equip = "common", | ||
485 | + in_rune = "common", | ||
486 | + out_rune = "common", | ||
487 | + player_exp = "common", | ||
488 | + func_open = "common", | ||
489 | + in_adv = "common", | ||
490 | + out_adv = "common", | ||
491 | + in_artifact = "common", | ||
492 | + | ||
493 | + mail_action = "common", | ||
494 | + role_action = "common", | ||
495 | + hang_action = "common", | ||
496 | + hero_action = "common", | ||
497 | + adv_action = "common", | ||
498 | + rune_action = "common", | ||
499 | + pvp_action = "common", | ||
500 | + diner_action = "common", | ||
501 | + tower_action = "common", | ||
502 | + gm_action = "common", | ||
503 | + act_action = "common", | ||
504 | +} | ||
505 | + | ||
506 | +-- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* | ||
507 | +local Mapping = { | ||
508 | + -- 预留一些数据格式 担心integer 范围不够用 将 通用的int* 全部换为long | ||
509 | + common = { | ||
510 | + desc = "keyword",--索引的短字符串 | ||
511 | + ucode = "keyword",--关联日志对应ucode | ||
512 | + key1 = "keyword", --可索引的短字符串 | ||
513 | + key2 = "keyword", --可索引的短字符串 | ||
514 | + -- 几乎不用的长文本 | ||
515 | + text1 = "text", --长字符串不索引的类型 | ||
516 | + -- 五个不同类型的数字 基本上满足数量要求 尽量从低到高用 | ||
517 | + short1 = "short", | ||
518 | + int1 = "long", | ||
519 | + int2 = "long", | ||
520 | + long1 = "long", | ||
521 | + float1 = "float", | ||
522 | + | ||
523 | + -- 底层使用的 一些参数 | ||
524 | + cint1 = "long", | ||
525 | + cint2 = "long", | ||
526 | + cint3 = "long", | ||
527 | + } | ||
528 | +} | ||
529 | + | ||
530 | +-- 所有的日志都包括的部分 role 里面的信息 -- mapping 信息在 gamelog-role | ||
531 | +local commonRoleField = { | ||
532 | + name = "keyword", | ||
533 | + id = "integer", | ||
534 | + uid = "keyword", | ||
535 | + sid = "short", | ||
536 | + device = "keyword", | ||
537 | + ctime = "integer", | ||
538 | + ltime = "integer", | ||
539 | + level = "short", | ||
540 | + rmbC = "integer", | ||
541 | +} | ||
542 | + | ||
543 | +local function checkType(logType, field, value, ctype) | ||
544 | + local typecheckfunc = { | ||
545 | + keyword = function() | ||
546 | + --长度不超过256 | ||
547 | + if type(value) ~= "string" then | ||
548 | + value = tostring(value) | ||
549 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [keyword], value : %s", logType, field, value)) | ||
550 | + else | ||
551 | + if #value > 256 then | ||
552 | + printError(string.format("LOG ERROR: logType [%s] field [%s] [keyword] type to long. value : %s", logType, field, value)) | ||
553 | + end | ||
554 | + end | ||
555 | + return value | ||
556 | + end, | ||
557 | + text = function() | ||
558 | + if type(value) ~= "string" then | ||
559 | + value = tostring(value) | ||
560 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [text], value : %s", logType, field, value)) | ||
561 | + end | ||
562 | + return value | ||
563 | + end, | ||
564 | + integer = function() | ||
565 | + if type(value) ~= "number" then | ||
566 | + value = tonumber(value) | ||
567 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], value : %s", logType, field, value)) | ||
568 | + end | ||
569 | + if value then | ||
570 | + if math.type(value) ~= "integer" then | ||
571 | + local oldValue = value | ||
572 | + value = math.floor(value) | ||
573 | + if value ~= oldValue then | ||
574 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], is float, value : %s", logType, field, value)) | ||
575 | + end | ||
576 | + end | ||
577 | + if -2147483648 > value or value > 2147483647 then | ||
578 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [integer], too big, value : %s", logType, field, value)) | ||
579 | + value = nil | ||
580 | + end | ||
581 | + end | ||
582 | + return value | ||
583 | + end, | ||
584 | + short = function() | ||
585 | + if type(value) ~= "number" then | ||
586 | + value = tonumber(value) | ||
587 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], value : %s", logType, field, value)) | ||
588 | + end | ||
589 | + if value then | ||
590 | + if math.type(value) ~= "integer" then | ||
591 | + local oldValue = value | ||
592 | + value = math.floor(value) | ||
593 | + if value ~= oldValue then | ||
594 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], is float, value : %s", logType, field, value)) | ||
595 | + end | ||
596 | + end | ||
597 | + | ||
598 | + if -32768 > value or value > 32768 then | ||
599 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [short], too big, value : %s", logType, field, value)) | ||
600 | + value = nil | ||
601 | + end | ||
602 | + end | ||
603 | + return value | ||
604 | + end, | ||
605 | + long = function() | ||
606 | + if type(value) ~= "number" then | ||
607 | + value = tonumber(value) | ||
608 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], value : %s", logType, field, value)) | ||
609 | + end | ||
610 | + if value then | ||
611 | + if math.type(value) ~= "integer" then | ||
612 | + local oldValue = value | ||
613 | + value = math.floor(value) | ||
614 | + if type(value) ~= "integer" then | ||
615 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], too big, value : %s", logType, field, value)) | ||
616 | + value = nil | ||
617 | + elseif value ~= oldValue then | ||
618 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [long], is float, value : %s", logType, field, value)) | ||
619 | + end | ||
620 | + end | ||
621 | + end | ||
622 | + return value | ||
623 | + end, | ||
624 | + float = function() | ||
625 | + if type(value) ~= "number" then | ||
626 | + value = tonumber(value) | ||
627 | + printError(string.format("LOG ERROR: logType [%s] field [%s] isn't [float], value : %s", logType, field, value)) | ||
628 | + end | ||
629 | + return value | ||
630 | + end, | ||
631 | + } | ||
632 | + | ||
633 | + if typecheckfunc[ctype] then | ||
634 | + return typecheckfunc[ctype]() | ||
635 | + else | ||
636 | + printError(string.format("LOG ERROR: logType [%s] field [%s] have a new type [%s] need add check.", logType, field, ctype)) | ||
637 | + return nil | ||
638 | + end | ||
639 | +end | ||
640 | + | ||
641 | + | ||
462 | 642 | ||
463 | local RoleLog = {} | 643 | local RoleLog = {} |
464 | function RoleLog.bind(Role) | 644 | function RoleLog.bind(Role) |
@@ -486,14 +666,15 @@ function RoleLog.bind(Role) | @@ -486,14 +666,15 @@ function RoleLog.bind(Role) | ||
486 | for field, tag in pairs(schema) do | 666 | for field, tag in pairs(schema) do |
487 | if not contents[field] then | 667 | if not contents[field] then |
488 | if tag == "ucode" then | 668 | if tag == "ucode" then |
489 | - contents[field] = self:getActionUcode() | 669 | + doc[field] = self:getActionUcode() |
670 | + elseif tag == "auto" then | ||
490 | else | 671 | else |
491 | printError(string.format("LOG ERROR: logType [%s] lose field [%s].", logType, field)) | 672 | printError(string.format("LOG ERROR: logType [%s] lose field [%s].", logType, field)) |
492 | end | 673 | end |
493 | end | 674 | end |
494 | end | 675 | end |
495 | if not logd then return end | 676 | if not logd then return end |
496 | - pcall(skynet.send, logd, "lua", "log", doc) | 677 | + pcall(skynet.send, logd, "lua", "log", doc, "bi") |
497 | end | 678 | end |
498 | 679 | ||
499 | function Role:logItems(itemId, before, after, log) | 680 | function Role:logItems(itemId, before, after, log) |
@@ -524,6 +705,38 @@ function RoleLog.bind(Role) | @@ -524,6 +705,38 @@ function RoleLog.bind(Role) | ||
524 | }) | 705 | }) |
525 | end | 706 | end |
526 | 707 | ||
708 | + function Role:mylog(logType, contents) | ||
709 | + contents = contents or {} | ||
710 | + local _logType = LogType[logType] | ||
711 | + if not _logType then | ||
712 | + printError(string.format("LOG ERROR: new logType [%s] need Add Maping.", logType)) | ||
713 | + return | ||
714 | + end | ||
715 | + local doc = {} | ||
716 | + for field, ctype in pairs(commonRoleField) do | ||
717 | + if contents[field] then | ||
718 | + printError(string.format("LOG ERROR: logType [%s] had field [%s] overwrite default.", logType, field)) | ||
719 | + end | ||
720 | + doc[field] = checkType("commonRoleField", field, self:getProperty(field), ctype) | ||
721 | + end | ||
722 | + | ||
723 | + local mapping = Mapping[_logType] | ||
724 | + if mapping["ucode"] and not contents["ucode"] then | ||
725 | + contents["ucode"] = self:getActionUcode() | ||
726 | + end | ||
727 | + for field, value in pairs(contents) do | ||
728 | + local ftype = mapping[field] | ||
729 | + if ftype then | ||
730 | + doc[field] = checkType(logType, field, value, ftype) | ||
731 | + else | ||
732 | + printError(string.format("LOG ERROR: logType [%s] have new field [%s] no type in mapping.", logType, field)) | ||
733 | + end | ||
734 | + end | ||
735 | + doc["@type"] = logType | ||
736 | + if not logd then return end | ||
737 | + pcall(skynet.send, logd, "lua", "log", doc, "log") | ||
738 | + end | ||
739 | + | ||
527 | 740 | ||
528 | function Role:startActionUcode() | 741 | function Role:startActionUcode() |
529 | if not self._uniqueCount then | 742 | if not self._uniqueCount then |
@@ -544,5 +757,6 @@ function RoleLog.bind(Role) | @@ -544,5 +757,6 @@ function RoleLog.bind(Role) | ||
544 | end | 757 | end |
545 | 758 | ||
546 | 759 | ||
760 | + | ||
547 | end | 761 | end |
548 | return RoleLog | 762 | return RoleLog |
549 | \ No newline at end of file | 763 | \ No newline at end of file |
src/models/RolePlugin.lua
@@ -229,13 +229,28 @@ function RolePlugin.bind(Role) | @@ -229,13 +229,28 @@ function RolePlugin.bind(Role) | ||
229 | self:log("setLevel", { | 229 | self:log("setLevel", { |
230 | level_before = oldLevel, | 230 | level_before = oldLevel, |
231 | level_changemain = log.desc, | 231 | level_changemain = log.desc, |
232 | - level_changedetail = log.sub or "", | 232 | + level_changedetail = log.int1 or 0, |
233 | level_reward = {}, | 233 | level_reward = {}, |
234 | }) | 234 | }) |
235 | else | 235 | else |
236 | print("addPlayExp no log ", debug.traceback()) | 236 | print("addPlayExp no log ", debug.traceback()) |
237 | end | 237 | end |
238 | + end | ||
239 | + | ||
240 | + if params.log then | ||
241 | + local log = params.log | ||
242 | + if log["cint1"] or log["cint2"] then | ||
243 | + print("addPlayExp error log have cint1 or cint2 or cint3", debug.traceback()) | ||
244 | + end | ||
238 | 245 | ||
246 | + | ||
247 | + log["cint1"] = addExp | ||
248 | + log["cint2"] = newExp | ||
249 | + log["cint3"] = level | ||
250 | + | ||
251 | + self:mylog("player_exp", log) | ||
252 | + else | ||
253 | + print("addPlayExp no log ", debug.traceback()) | ||
239 | end | 254 | end |
240 | 255 | ||
241 | self:updateProperties({level = level, exp = newExp}) | 256 | self:updateProperties({level = level, exp = newExp}) |
@@ -259,6 +274,21 @@ function RolePlugin.bind(Role) | @@ -259,6 +274,21 @@ function RolePlugin.bind(Role) | ||
259 | end | 274 | end |
260 | 275 | ||
261 | self:logItems(params.itemId, origin, nums, params.log) | 276 | self:logItems(params.itemId, origin, nums, params.log) |
277 | + if params.log then | ||
278 | + local log = params.log | ||
279 | + if log["cint1"] or log["cint2"] then | ||
280 | + print("addItem error log have cint1 or cint2 ", debug.traceback()) | ||
281 | + end | ||
282 | + log["cint1"] = params.itemId | ||
283 | + log["cint2"] = math.abs(params.count) | ||
284 | + if params.count <= 0 then | ||
285 | + self:mylog("out_item", log) | ||
286 | + else | ||
287 | + self:mylog("in_item", log) | ||
288 | + end | ||
289 | + else | ||
290 | + print("addItem no log ", debug.traceback()) | ||
291 | + end | ||
262 | 292 | ||
263 | self:setProperty("items", items) | 293 | self:setProperty("items", items) |
264 | if not params.notNotify then | 294 | if not params.notNotify then |
@@ -329,11 +359,22 @@ function RolePlugin.bind(Role) | @@ -329,11 +359,22 @@ function RolePlugin.bind(Role) | ||
329 | end | 359 | end |
330 | 360 | ||
331 | self:logItems(ItemId.Diamond, origin, count, params.log) | 361 | self:logItems(ItemId.Diamond, origin, count, params.log) |
362 | + if params.log then | ||
363 | + local log = params.log | ||
364 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
365 | + print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
366 | + end | ||
367 | + log["cint1"] = origin | ||
368 | + log["cint2"] = count | ||
369 | + self:mylog("in_diamond", log) | ||
370 | + else | ||
371 | + print("gainDiamond no log ", debug.traceback()) | ||
372 | + end | ||
373 | + | ||
332 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) | 374 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) |
333 | return true | 375 | return true |
334 | end | 376 | end |
335 | 377 | ||
336 | - | ||
337 | function Role:costDiamond(params) | 378 | function Role:costDiamond(params) |
338 | if not params or type(params) ~= "table" then return false end | 379 | if not params or type(params) ~= "table" then return false end |
339 | local count = tonum(params.count) | 380 | local count = tonum(params.count) |
@@ -368,6 +409,17 @@ function RolePlugin.bind(Role) | @@ -368,6 +409,17 @@ function RolePlugin.bind(Role) | ||
368 | 409 | ||
369 | 410 | ||
370 | self:logItems(ItemId.Diamond, origin, count, params.log) | 411 | self:logItems(ItemId.Diamond, origin, count, params.log) |
412 | + if params.log then | ||
413 | + local log = params.log | ||
414 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
415 | + print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
416 | + end | ||
417 | + log["cint1"] = origin | ||
418 | + log["cint2"] = count | ||
419 | + self:mylog("out_diamond", log) | ||
420 | + else | ||
421 | + print("costDiamond no log ", debug.traceback()) | ||
422 | + end | ||
371 | 423 | ||
372 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) | 424 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) |
373 | return true | 425 | return true |
@@ -406,6 +458,17 @@ function RolePlugin.bind(Role) | @@ -406,6 +458,17 @@ function RolePlugin.bind(Role) | ||
406 | 458 | ||
407 | self:logItems(heroType + ItemStartId.Hero, 0, 1, params.log) | 459 | self:logItems(heroType + ItemStartId.Hero, 0, 1, params.log) |
408 | 460 | ||
461 | + if params.log then | ||
462 | + local log = params.log | ||
463 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
464 | + print("addHero error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
465 | + end | ||
466 | + log["cint1"] = heroId | ||
467 | + log["cint2"] = heroType | ||
468 | + self:mylog("in_hero", log) | ||
469 | + else | ||
470 | + print("addHero no log ", debug.traceback()) | ||
471 | + end | ||
409 | return true, newHero | 472 | return true, newHero |
410 | end | 473 | end |
411 | 474 | ||
@@ -516,6 +579,22 @@ function RolePlugin.bind(Role) | @@ -516,6 +579,22 @@ function RolePlugin.bind(Role) | ||
516 | self:setProperty("equips", equips) | 579 | self:setProperty("equips", equips) |
517 | 580 | ||
518 | self:logItems(equipCsv.id, oldCount, curCount, pms.log) | 581 | self:logItems(equipCsv.id, oldCount, curCount, pms.log) |
582 | + if pms.log then | ||
583 | + local log = pms.log | ||
584 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
585 | + print("addEquip error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
586 | + end | ||
587 | + log["cint1"] = equipType | ||
588 | + log["cint2"] = equipLv | ||
589 | + log["cint3"] = math.abs(count) | ||
590 | + if count < 0 then | ||
591 | + self:mylog("out_equip", log) | ||
592 | + else | ||
593 | + self:mylog("in_equip", log) | ||
594 | + end | ||
595 | + else | ||
596 | + print("addEquip no log ", debug.traceback()) | ||
597 | + end | ||
519 | 598 | ||
520 | if not pms.notNotify then | 599 | if not pms.notNotify then |
521 | self:changeUpdates({{type = "equips", field = {equipType, equipLv}, value = curCount, isOnlyToC = true}}) -- 通知客户端 | 600 | self:changeUpdates({{type = "equips", field = {equipType, equipLv}, value = curCount, isOnlyToC = true}}) -- 通知客户端 |
@@ -576,6 +655,20 @@ function RolePlugin.bind(Role) | @@ -576,6 +655,20 @@ function RolePlugin.bind(Role) | ||
576 | self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) | 655 | self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) |
577 | 656 | ||
578 | self:logItems(params.id, 0, 1, params.log) | 657 | self:logItems(params.id, 0, 1, params.log) |
658 | + if params.log then | ||
659 | + local log = params.log | ||
660 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
661 | + print("addRune error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
662 | + end | ||
663 | + | ||
664 | + log["cint1"] = runeUid | ||
665 | + log["cint2"] = params.type | ||
666 | + log["cint3"] = params.id | ||
667 | + | ||
668 | + self:mylog("in_rune", log) | ||
669 | + else | ||
670 | + print("addRune no log ", debug.traceback()) | ||
671 | + end | ||
579 | 672 | ||
580 | return 0, newRune | 673 | return 0, newRune |
581 | else | 674 | else |
@@ -592,6 +685,20 @@ function RolePlugin.bind(Role) | @@ -592,6 +685,20 @@ function RolePlugin.bind(Role) | ||
592 | if rune and rune:getProperty("refer") == 0 then | 685 | if rune and rune:getProperty("refer") == 0 then |
593 | 686 | ||
594 | self:logItems(rune:getProperty("id"), 1, 0, params.log) | 687 | self:logItems(rune:getProperty("id"), 1, 0, params.log) |
688 | + if params.log then | ||
689 | + local log = params.log | ||
690 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
691 | + print("delRunes error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
692 | + end | ||
693 | + | ||
694 | + log["cint1"] = runeId | ||
695 | + log["cint2"] = rune:getProperty("type") | ||
696 | + log["cint3"] = rune:getProperty("id") | ||
697 | + | ||
698 | + self:mylog("out_rune", log) | ||
699 | + else | ||
700 | + print("delRunes no log ", debug.traceback()) | ||
701 | + end | ||
595 | 702 | ||
596 | self.runeBag[runeId] = nil | 703 | self.runeBag[runeId] = nil |
597 | table.insert(bDel, runeId) | 704 | table.insert(bDel, runeId) |
@@ -838,6 +945,19 @@ function RolePlugin.bind(Role) | @@ -838,6 +945,19 @@ function RolePlugin.bind(Role) | ||
838 | count = count or 1 | 945 | count = count or 1 |
839 | 946 | ||
840 | self:logItems(func, 0, count, params.log) | 947 | self:logItems(func, 0, count, params.log) |
948 | + if params.log then | ||
949 | + local log = params.log | ||
950 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
951 | + print("funcOpen error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
952 | + end | ||
953 | + | ||
954 | + log["cint1"] = func | ||
955 | + log["cint2"] = count | ||
956 | + | ||
957 | + self:mylog("func_open", log) | ||
958 | + else | ||
959 | + print("funcOpen no log ", debug.traceback()) | ||
960 | + end | ||
841 | 961 | ||
842 | if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then | 962 | if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then |
843 | local unlockData = csvdb["unlockCsv"][func] | 963 | local unlockData = csvdb["unlockCsv"][func] |
@@ -1393,7 +1513,10 @@ function RolePlugin.bind(Role) | @@ -1393,7 +1513,10 @@ function RolePlugin.bind(Role) | ||
1393 | 1513 | ||
1394 | local order_type = self:getProperty("rmbC") > 0 and 0 or 1 | 1514 | local order_type = self:getProperty("rmbC") > 0 and 0 or 1 |
1395 | local status, reward = self:recharge({ | 1515 | local status, reward = self:recharge({ |
1396 | - id = rechargeId | 1516 | + id = rechargeId, |
1517 | + transactionId = params.transactionId, | ||
1518 | + pay_time = params.pay_time, | ||
1519 | + order = partnerOrderStr, | ||
1397 | }) | 1520 | }) |
1398 | orderObject:setProperty("finishTime", skynet.time()) | 1521 | orderObject:setProperty("finishTime", skynet.time()) |
1399 | orderObject:setProperty("status", "finish") | 1522 | orderObject:setProperty("status", "finish") |
@@ -1413,7 +1536,7 @@ function RolePlugin.bind(Role) | @@ -1413,7 +1536,7 @@ function RolePlugin.bind(Role) | ||
1413 | item_number = 1, -- 购买的道具数量 | 1536 | item_number = 1, -- 购买的道具数量 |
1414 | item_level = 1, -- 购买的道具等级 | 1537 | item_level = 1, -- 购买的道具等级 |
1415 | order_cost = rechargeData.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' | 1538 | order_cost = rechargeData.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' |
1416 | - order_currency = "CNY", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 | 1539 | + order_currency = "TWD", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 |
1417 | order_type = order_type, -- 订单类型,首充记录为1,否则为0 | 1540 | order_type = order_type, -- 订单类型,首充记录为1,否则为0 |
1418 | order_id = params.transactionId, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' | 1541 | order_id = params.transactionId, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' |
1419 | }) | 1542 | }) |
@@ -1451,7 +1574,7 @@ function RolePlugin.bind(Role) | @@ -1451,7 +1574,7 @@ function RolePlugin.bind(Role) | ||
1451 | self:gainDiamond({count = diamondCount, isRecharge = true, log = {desc = "recharge", int1 = id}}) | 1574 | self:gainDiamond({count = diamondCount, isRecharge = true, log = {desc = "recharge", int1 = id}}) |
1452 | elseif rechargeData.shop == 2 then --通行证商店 | 1575 | elseif rechargeData.shop == 2 then --通行证商店 |
1453 | reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) | 1576 | reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) |
1454 | - self.storeData:onBuyCard(rechargeData.type, rechargeData.time) | 1577 | + self.storeData:onBuyCard(rechargeData.type, rechargeData.time, rechargeData.id) |
1455 | elseif rechargeData.shop == 3 then -- 礼包商店 | 1578 | elseif rechargeData.shop == 3 then -- 礼包商店 |
1456 | reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) | 1579 | reward, _ = self:award(rechargeData.itemFirst, {isRecharge = true, log = {desc = "recharge", int1 = id}}) |
1457 | else | 1580 | else |
@@ -1463,9 +1586,14 @@ function RolePlugin.bind(Role) | @@ -1463,9 +1586,14 @@ function RolePlugin.bind(Role) | ||
1463 | reward[ItemId.Diamond] = (reward[ItemId.Diamond] or 0) + diamondCount | 1586 | reward[ItemId.Diamond] = (reward[ItemId.Diamond] or 0) + diamondCount |
1464 | end | 1587 | end |
1465 | 1588 | ||
1589 | + self:checkTaskEnter("Pay", {rmb = rechargeData.rmb, twd = rechargeData.twd}) | ||
1590 | + | ||
1466 | -- 累充 | 1591 | -- 累充 |
1467 | local rmb = rechargeData.rmb | 1592 | local rmb = rechargeData.rmb |
1468 | self:updateProperty({field = "rmbC", delta = rmb}) | 1593 | self:updateProperty({field = "rmbC", delta = rmb}) |
1594 | + self:updateProperty({field = "twdC", delta = rechargeData.twd}) | ||
1595 | + | ||
1596 | + self:mylog("role_action", {desc = "recharge", int1 = id, int2 = rmb, key1 = params.transactionId, key2 = params.order, long1 = params.pay_time}) | ||
1469 | 1597 | ||
1470 | return nil, reward | 1598 | return nil, reward |
1471 | end | 1599 | end |
@@ -1513,6 +1641,7 @@ function RolePlugin.bind(Role) | @@ -1513,6 +1641,7 @@ function RolePlugin.bind(Role) | ||
1513 | end | 1641 | end |
1514 | self:updateProperty({field = "funcGuide", value = funcGuide}) | 1642 | self:updateProperty({field = "funcGuide", value = funcGuide}) |
1515 | self:log("onGuidePoint", {guild_type = 0, guild_id = master, guild_point = slave, guild_pass = 0}) | 1643 | self:log("onGuidePoint", {guild_type = 0, guild_id = master, guild_point = slave, guild_pass = 0}) |
1644 | + self:mylog("guide", {desc = "guide_new",int1 = master*1000+slave}) | ||
1516 | 1645 | ||
1517 | newerGuide = string.format("%d=%d",master,slave) | 1646 | newerGuide = string.format("%d=%d",master,slave) |
1518 | self:updateProperty({field = "newerGuide", value = newerGuide}) | 1647 | self:updateProperty({field = "newerGuide", value = newerGuide}) |
@@ -1532,6 +1661,74 @@ function RolePlugin.bind(Role) | @@ -1532,6 +1661,74 @@ function RolePlugin.bind(Role) | ||
1532 | self:updateProperty({field = "newerGuide", value = "9999=1"}) | 1661 | self:updateProperty({field = "newerGuide", value = "9999=1"}) |
1533 | end | 1662 | end |
1534 | end | 1663 | end |
1664 | + | ||
1665 | + -- 抽卡阶段奖励 | ||
1666 | + function Role:getDrawCardExtraReward(oldVal, newVal) | ||
1667 | + local reward = nil | ||
1668 | + local maxCount = 0 | ||
1669 | + for k, v in pairs(csvdb["build_extraRewardCsv"]) do | ||
1670 | + if oldVal < k and newVal >= k then | ||
1671 | + reward = v["reward"] or "" | ||
1672 | + end | ||
1673 | + maxCount = k > maxCount and k or maxCount | ||
1674 | + end | ||
1675 | + | ||
1676 | + return reward, (newVal >= maxCount and newVal - maxCount or newVal) | ||
1677 | + end | ||
1678 | + | ||
1679 | + -- 获取下一个挂机关卡id | ||
1680 | + function Role:getNextCarbonId(curId) | ||
1681 | + local diff = math.floor(curId / 10000) | ||
1682 | + local chapterId = math.floor((curId / 100) % 100) | ||
1683 | + local subId = curId % 100 | ||
1684 | + local nextId = curId + 1 | ||
1685 | + local function makeCarbonId(diff, chapterId, subId) | ||
1686 | + return diff * 10000 + chapterId * 100 + subId | ||
1687 | + end | ||
1688 | + if not csvdb["idle_battleCsv"][nextId] then | ||
1689 | + nextId = makeCarbonId(diff, chapterId + 1, 1) | ||
1690 | + if not csvdb["idle_battleCsv"][nextId] then | ||
1691 | + nextId = makeCarbonId(diff + 1, 1, 1) | ||
1692 | + if not csvdb["idle_battleCsv"][nextId] then | ||
1693 | + nextId = 0 | ||
1694 | + end | ||
1695 | + end | ||
1696 | + end | ||
1697 | + | ||
1698 | + return nextId | ||
1699 | + end | ||
1700 | + | ||
1701 | + -- 根据累计充值金额计算奖励档位 | ||
1702 | + function Role:getPaybackReward(oldVal, newVal) | ||
1703 | + local maxVal, diff, extraReward = 0, 0, "" | ||
1704 | + local gift = "" | ||
1705 | + for k, v in pairs(csvdb["rebateCsv"]) do | ||
1706 | + if k > maxVal then | ||
1707 | + maxVal = k | ||
1708 | + end | ||
1709 | + if v.isLoop > diff then | ||
1710 | + diff = v.isLoop | ||
1711 | + extraReward = v.reward | ||
1712 | + end | ||
1713 | + if oldVal < k and newVal > k then | ||
1714 | + gift = gift .. v.reward .. " " | ||
1715 | + end | ||
1716 | + end | ||
1717 | + if newVal > maxVal then | ||
1718 | + local cnt = 0 | ||
1719 | + if oldVal < maxVal then | ||
1720 | + cnt = math.floor((newVal - maxVal) / diff) | ||
1721 | + else | ||
1722 | + cnt = math.floor((newVal - maxVal) / diff) - math.floor((oldVal - maxVal) / diff) | ||
1723 | + end | ||
1724 | + for i = 1, cnt do | ||
1725 | + gift = gift .. extraReward .. " " | ||
1726 | + end | ||
1727 | + end | ||
1728 | + | ||
1729 | + return gift | ||
1730 | + end | ||
1731 | + | ||
1535 | end | 1732 | end |
1536 | 1733 | ||
1537 | return RolePlugin | 1734 | return RolePlugin |
1538 | \ No newline at end of file | 1735 | \ No newline at end of file |
src/models/RoleTask.lua
@@ -89,6 +89,7 @@ local TaskType = { | @@ -89,6 +89,7 @@ local TaskType = { | ||
89 | WeBlog = 1010, -- 关注微博 | 89 | WeBlog = 1010, -- 关注微博 |
90 | SignIn = 1011, -- 签到 | 90 | SignIn = 1011, -- 签到 |
91 | ShopAll = 1013, -- 在任意商店购买 | 91 | ShopAll = 1013, -- 在任意商店购买 |
92 | + Pay = 1014, -- 充值 | ||
92 | } | 93 | } |
93 | 94 | ||
94 | local function f(field, func) | 95 | local function f(field, func) |
@@ -216,6 +217,7 @@ local ActivityListener = { | @@ -216,6 +217,7 @@ local ActivityListener = { | ||
216 | [TaskType.FoodSell] = {{Activity.ActivityType.FoodSell, f("count")}}, | 217 | [TaskType.FoodSell] = {{Activity.ActivityType.FoodSell, f("count")}}, |
217 | [TaskType.AdvDraw] = {{Activity.ActivityType.AdvDraw, f("count")}}, | 218 | [TaskType.AdvDraw] = {{Activity.ActivityType.AdvDraw, f("count")}}, |
218 | [TaskType.OpenBox] = {{Activity.ActivityType.OpenBox, f("count")}}, | 219 | [TaskType.OpenBox] = {{Activity.ActivityType.OpenBox, f("count")}}, |
220 | + [TaskType.Pay] = {{Activity.ActivityType.PayBack, f("twd")}}, | ||
219 | } | 221 | } |
220 | } | 222 | } |
221 | 223 |
src/models/RoleTimeReset.lua
@@ -34,7 +34,6 @@ end | @@ -34,7 +34,6 @@ end | ||
34 | ResetFunc["CrossMonth"] = function(self, notify, response) | 34 | ResetFunc["CrossMonth"] = function(self, notify, response) |
35 | local ltime = self:getProperty("ltime") | 35 | local ltime = self:getProperty("ltime") |
36 | if isCrossMonth(ltime, skynet.timex()) then | 36 | if isCrossMonth(ltime, skynet.timex()) then |
37 | - print("cross month") | ||
38 | self.storeData:resetStoreReored(3) --商店跨月重置 time_reset表关联id | 37 | self.storeData:resetStoreReored(3) --商店跨月重置 time_reset表关联id |
39 | end | 38 | end |
40 | end | 39 | end |
src/models/Rune.lua
@@ -26,7 +26,7 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) | @@ -26,7 +26,7 @@ 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) | 29 | +function Rune:mylog(contents) |
30 | contents = contents or {} | 30 | contents = contents or {} |
31 | if contents["cint1"] or contents["cint2"] or contents["cint3"] then | 31 | if contents["cint1"] or contents["cint2"] or contents["cint3"] then |
32 | print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback()) | 32 | print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback()) |
@@ -35,7 +35,7 @@ function Rune:log(contents) | @@ -35,7 +35,7 @@ function Rune:log(contents) | ||
35 | contents["cint2"] = self:getProperty("type") | 35 | contents["cint2"] = self:getProperty("type") |
36 | contents["cint3"] = self:getProperty("id") | 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
@@ -6,21 +6,33 @@ function Store:ctor(properties) | @@ -6,21 +6,33 @@ function Store:ctor(properties) | ||
6 | Store.super.ctor(self, properties) | 6 | Store.super.ctor(self, properties) |
7 | end | 7 | end |
8 | 8 | ||
9 | +ActGoodsType = { | ||
10 | + paySignIn = 1, -- 付费签到 | ||
11 | +} | ||
12 | + | ||
9 | Store.schema = { | 13 | Store.schema = { |
10 | buyR = {"table", {}}, -- 购买商品记录 {id=count} | 14 | buyR = {"table", {}}, -- 购买商品记录 {id=count} |
11 | payR = {"table", {}}, -- 充值记录 {id=count} | 15 | payR = {"table", {}}, -- 充值记录 {id=count} |
12 | growFund = {"number", 0}, -- 成长基金 | 16 | growFund = {"number", 0}, -- 成长基金 |
13 | - growFundR = {"string", ""}, -- 成长基金领取记录 | 17 | + growFundR = {"string", ""}, -- 成长基金领取记录 |
18 | + | ||
14 | monthCardEx = {"number", 0}, -- 月卡过期时间戳 | 19 | monthCardEx = {"number", 0}, -- 月卡过期时间戳 |
15 | - smonthCardEx = {"number", 0}, -- 超级月卡过期时间戳 | 20 | + smonthCardEx = {"number", 0}, -- 超级月卡过期时间戳 |
21 | + | ||
16 | battleCard = {"number", 0}, -- 赛季卡 | 22 | battleCard = {"number", 0}, -- 赛季卡 |
17 | battleFR = {"string", ""}, -- 免费赛季卡领取记录 | 23 | battleFR = {"string", ""}, -- 免费赛季卡领取记录 |
18 | battleLR = {"string", ""}, -- 付费赛季卡领取记录 | 24 | battleLR = {"string", ""}, -- 付费赛季卡领取记录 |
25 | + | ||
19 | limitTPack = {"table", {}}, -- 限时礼包 {id=expire_ts} | 26 | limitTPack = {"table", {}}, -- 限时礼包 {id=expire_ts} |
20 | privCardEx = {"number", 0}, -- 特权卡过期时间戳 | 27 | privCardEx = {"number", 0}, -- 特权卡过期时间戳 |
21 | getMailT1 = {"number",0}, -- 上次发送月卡福利邮件的时间 | 28 | getMailT1 = {"number",0}, -- 上次发送月卡福利邮件的时间 |
22 | getMailT2 = {"number",0}, -- 上次发送超级月卡福利邮件的时间 | 29 | getMailT2 = {"number",0}, -- 上次发送超级月卡福利邮件的时间 |
23 | - packTrigger = {"table", {}} -- 礼包触发记录 {关卡难度1={id, 通关关卡数,升级数,爬塔层数}, ...} | 30 | + packTrigger = {"table", {}}, -- 礼包触发记录 {关卡难度1={id, 通关关卡数,升级数,爬塔层数}, ...} |
31 | + | ||
32 | + -- 活动商品购买记录 | ||
33 | + actGoodsFlag = {"table", {}}, -- ActGoodsType 1购买,0未购买 | ||
34 | + | ||
35 | + bpInfo = {"table", {}}, -- battle pass 探索指令 1={flag=0 为1表示买了,br=""付费领取记录, fr=""免费领取记录},2,3,4 | ||
24 | } | 36 | } |
25 | 37 | ||
26 | function Store:updateProperty(params) | 38 | function Store:updateProperty(params) |
@@ -45,6 +57,7 @@ end | @@ -45,6 +57,7 @@ end | ||
45 | function Store:onCrossDay() | 57 | function Store:onCrossDay() |
46 | self:sendMonthCardEmail() | 58 | self:sendMonthCardEmail() |
47 | self:deleteExpireLimitGoods() | 59 | self:deleteExpireLimitGoods() |
60 | + self:checkPaySignReward() | ||
48 | end | 61 | end |
49 | 62 | ||
50 | -- 删除过期商品 | 63 | -- 删除过期商品 |
@@ -150,7 +163,7 @@ function Store:getGearExchangeCoef() | @@ -150,7 +163,7 @@ function Store:getGearExchangeCoef() | ||
150 | end | 163 | end |
151 | 164 | ||
152 | -- 购买通行证 | 165 | -- 购买通行证 |
153 | -function Store:onBuyCard(type, duration) | 166 | +function Store:onBuyCard(type, duration, id) |
154 | local timeNow = skynet.timex() | 167 | local timeNow = skynet.timex() |
155 | if type == CardType.NormalMonthCard then | 168 | if type == CardType.NormalMonthCard then |
156 | if self:isMonthCardExpire() then | 169 | if self:isMonthCardExpire() then |
@@ -176,6 +189,15 @@ function Store:onBuyCard(type, duration) | @@ -176,6 +189,15 @@ function Store:onBuyCard(type, duration) | ||
176 | self:updateProperty({field = "growFund", value = 1}) | 189 | self:updateProperty({field = "growFund", value = 1}) |
177 | elseif type == CardType.BattleCard then | 190 | elseif type == CardType.BattleCard then |
178 | self:updateProperty({field = "battleCard", value = 1}) | 191 | self:updateProperty({field = "battleCard", value = 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:终极 | ||
196 | + local bpInfo = self:getProperty("bpInfo") or {} | ||
197 | + local info = bpInfo[index] or {} | ||
198 | + info["flag"] = 1 | ||
199 | + bpInfo[index] = info | ||
200 | + self:updateProperty({field = "bpInfo", value = bpInfo}) | ||
179 | end | 201 | end |
180 | end | 202 | end |
181 | 203 | ||
@@ -330,6 +352,46 @@ function Store:OnTriggerLimitTimePack(eventType, param) | @@ -330,6 +352,46 @@ function Store:OnTriggerLimitTimePack(eventType, param) | ||
330 | end | 352 | end |
331 | end | 353 | end |
332 | 354 | ||
355 | +function GetActGoodsIndex(goodsType) | ||
356 | + return ActGoodsType[goodsType] or 0 | ||
357 | +end | ||
358 | + | ||
359 | +-- 购买付费签到 按开服时间算奖励 | ||
360 | +function Store:onBuyPaySignCard(dur) | ||
361 | + local curTs = skynet.timex() | ||
362 | + local actGoodsFlag = self:getProperty("actGoodsFlag") or {} | ||
363 | + local goodsIndex = GetActGoodsIndex("paySignIn") | ||
364 | + if goodsIndex == 0 then | ||
365 | + print("get act goods index fail :paySignIn") | ||
366 | + return | ||
367 | + end | ||
368 | + actGoodsFlag[goodsIndex] = 1 | ||
369 | + self:updateProperty({field = "actGoodsFlag", value = actGoodsFlag}) | ||
370 | + -- 发钱 | ||
371 | + local change | ||
372 | + local reward, curData = self.owner.activity:getPaySignReward() | ||
373 | + if next(reward) then | ||
374 | + self.owner.activity:updateActData("PaySignIn", curData) | ||
375 | + reward, change = self.owner:award(reward, {log = {desc = "actPaySign"}}) | ||
376 | + end | ||
377 | + | ||
378 | + self.owner:log("activity", { | ||
379 | + activity_id = 0, -- 活动ID(或活动指定任务的ID) | ||
380 | + activity_type = self.owner.activity.ActivityType.PaySignIn, -- 活动类型,见活动类型枚举表 | ||
381 | + activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} | ||
382 | + }) | ||
383 | + | ||
384 | + SendPacket(actionCodes.Activity_actPaySignRewardNtf, MsgPack.pack(self.owner:packReward(reward, change))) | ||
385 | +end | ||
386 | + | ||
387 | +function Store:checkPaySignReward() | ||
388 | + local reward, curData = self.owner.activity:getPaySignReward() | ||
389 | + if next(reward) then | ||
390 | + self.owner.activity:updateActData("PaySignIn", curData) | ||
391 | + self.owner:sendMail(MailId.PaySignAward, nil, reward) | ||
392 | + end | ||
393 | +end | ||
394 | + | ||
333 | function Store:data() | 395 | function Store:data() |
334 | return { | 396 | return { |
335 | buyR = self:getProperty("buyR"), | 397 | buyR = self:getProperty("buyR"), |
@@ -343,7 +405,9 @@ function Store:data() | @@ -343,7 +405,9 @@ function Store:data() | ||
343 | battleLR = self:getProperty("battleLR"), | 405 | battleLR = self:getProperty("battleLR"), |
344 | limitTPack = self:getProperty("limitTPack"), | 406 | limitTPack = self:getProperty("limitTPack"), |
345 | privCardEx = self:getProperty("privCardEx"), | 407 | privCardEx = self:getProperty("privCardEx"), |
346 | - packTrigger = self:getProperty("packTrigger") | 408 | + packTrigger = self:getProperty("packTrigger"), |
409 | + actGoodsFlag = self:getProperty("actGoodsFlag"), | ||
410 | + bpInfo = self:getProperty("bpInfo"), | ||
347 | } | 411 | } |
348 | end | 412 | end |
349 | 413 |
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 |
@@ -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/utils/CommonFunc.lua
@@ -146,6 +146,31 @@ function crossDayFromOpen(now) | @@ -146,6 +146,31 @@ function crossDayFromOpen(now) | ||
146 | return crossDay(openTime, now) | 146 | return crossDay(openTime, now) |
147 | end | 147 | end |
148 | 148 | ||
149 | +function diffFromOpen() | ||
150 | + now = now or skynet.timex() | ||
151 | + local openTime = os.time{ | ||
152 | + year = tonum(SERV_OPEN:sub(1,4)), | ||
153 | + month = tonum(SERV_OPEN:sub(5,6)), | ||
154 | + day = tonum(SERV_OPEN:sub(7,8)), | ||
155 | + hour = RESET_TIME, | ||
156 | + } | ||
157 | + if now < openTime then | ||
158 | + return 0 | ||
159 | + end | ||
160 | + | ||
161 | + return math.floor((now - openTime) / DAY_SEC) | ||
162 | +end | ||
163 | + | ||
164 | +function getServerOpenTs() | ||
165 | + local openTime = os.time{ | ||
166 | + year = tonum(SERV_OPEN:sub(1,4)), | ||
167 | + month = tonum(SERV_OPEN:sub(5,6)), | ||
168 | + day = tonum(SERV_OPEN:sub(7,8)), | ||
169 | + hour = RESET_TIME, | ||
170 | + } | ||
171 | + return openTime | ||
172 | +end | ||
173 | + | ||
149 | -- 30*86400 = 2592000 | 174 | -- 30*86400 = 2592000 |
150 | function monthLater(now) | 175 | function monthLater(now) |
151 | now = now or skynet.timex() | 176 | now = now or skynet.timex() |