Commit 4aa21a1dd9096fe6a192477b1195981f853d67f1
Merge branch 'develop' into player
# Conflicts: # src/nodenames.lua
Showing
34 changed files
with
748 additions
and
304 deletions
Show diff stats
No preview for this file type
src/GlobalVar.lua
src/actions/AdvAction.lua
| @@ -163,6 +163,8 @@ function _M.startAdvRpc( agent, data ) | @@ -163,6 +163,8 @@ function _M.startAdvRpc( agent, data ) | ||
| 163 | role:checkTaskEnter("AdvStart", {id = chapterId}) | 163 | role:checkTaskEnter("AdvStart", {id = chapterId}) |
| 164 | role:checkTaskEnter("AdvStartSelf", {id = chapterId}) | 164 | role:checkTaskEnter("AdvStartSelf", {id = chapterId}) |
| 165 | role:getAdvData():popBackEvents() -- 清一下事件 | 165 | role:getAdvData():popBackEvents() -- 清一下事件 |
| 166 | + role:getAdvData():log({desc = "start", int1 = supportIdx}) | ||
| 167 | + | ||
| 166 | SendPacket(actionCodes.Adv_startAdvRpc, '') | 168 | SendPacket(actionCodes.Adv_startAdvRpc, '') |
| 167 | return true | 169 | return true |
| 168 | end | 170 | end |
| @@ -215,6 +217,8 @@ function _M.startHangRpc(agent, data) | @@ -215,6 +217,8 @@ function _M.startHangRpc(agent, data) | ||
| 215 | 217 | ||
| 216 | role.dailyData:updateProperty({field = "advC", delta = 1}) | 218 | role.dailyData:updateProperty({field = "advC", delta = 1}) |
| 217 | role:checkTaskEnter("AdvStart", {id = chapterId}) | 219 | role:checkTaskEnter("AdvStart", {id = chapterId}) |
| 220 | + role:log("adv_action", {desc = "startHang", int1 = chapterId}) | ||
| 221 | + | ||
| 218 | SendPacket(actionCodes.Adv_startHangRpc, '') | 222 | SendPacket(actionCodes.Adv_startHangRpc, '') |
| 219 | return true | 223 | return true |
| 220 | end | 224 | end |
| @@ -238,10 +242,12 @@ function _M.quickHangRpc(agent, data) | @@ -238,10 +242,12 @@ function _M.quickHangRpc(agent, data) | ||
| 238 | local cost = math.ceil((info.time - skynet.timex()) / chapterData.idleTime * chapterData.accelerate) | 242 | local cost = math.ceil((info.time - skynet.timex()) / chapterData.idleTime * chapterData.accelerate) |
| 239 | 243 | ||
| 240 | if not role:checkItemEnough({[ItemId.Diamond] = cost}) then return end | 244 | if not role:checkItemEnough({[ItemId.Diamond] = cost}) then return end |
| 241 | - role:costItems({[ItemId.Diamond] = cost}) | 245 | + role:costItems({[ItemId.Diamond] = cost}, {log = {desc = "quickHang", int1 = chapterId}}) |
| 242 | info.time = 0 | 246 | info.time = 0 |
| 243 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) | 247 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) |
| 244 | 248 | ||
| 249 | + role:log("adv_action", {desc = "quickHang", int1 = chapterId}) | ||
| 250 | + | ||
| 245 | SendPacket(actionCodes.Adv_quickHangRpc, '') | 251 | SendPacket(actionCodes.Adv_quickHangRpc, '') |
| 246 | return true | 252 | return true |
| 247 | end | 253 | end |
| @@ -262,7 +268,7 @@ function _M.endHangRpc(agent, data) | @@ -262,7 +268,7 @@ function _M.endHangRpc(agent, data) | ||
| 262 | 268 | ||
| 263 | local reward, isFull | 269 | local reward, isFull |
| 264 | if skynet.timex() >= info.time then | 270 | if skynet.timex() >= info.time then |
| 265 | - reward = role:award(chapterData.idleReward) | 271 | + reward = role:award(chapterData.idleReward, {log = {desc = "advHang", int1 = chapterId}}) |
| 266 | else | 272 | else |
| 267 | if cancel then | 273 | if cancel then |
| 268 | if role.dailyData:getProperty("advC") <= 0 then | 274 | if role.dailyData:getProperty("advC") <= 0 then |
| @@ -277,6 +283,8 @@ function _M.endHangRpc(agent, data) | @@ -277,6 +283,8 @@ function _M.endHangRpc(agent, data) | ||
| 277 | 283 | ||
| 278 | role:changeUpdates({{type = "advHang", field = chapterId, value = nil}}) | 284 | role:changeUpdates({{type = "advHang", field = chapterId, value = nil}}) |
| 279 | 285 | ||
| 286 | + role:log("adv_action", {desc = "endHang", int1 = chapterId, short1 = cancel and 1 or 0}) | ||
| 287 | + | ||
| 280 | SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, isFull = isFull})) | 288 | SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, isFull = isFull})) |
| 281 | return true | 289 | return true |
| 282 | end | 290 | end |
| @@ -298,7 +306,7 @@ function _M.buyAdvCountRpc(agent , data) | @@ -298,7 +306,7 @@ function _M.buyAdvCountRpc(agent , data) | ||
| 298 | 306 | ||
| 299 | 307 | ||
| 300 | if not role:checkItemEnough(cost) then return end | 308 | if not role:checkItemEnough(cost) then return end |
| 301 | - role:costItems(cost) | 309 | + role:costItems(cost, {log = {desc = "buyAdvCount", short1 = isEl and 1 or 0, int1 = count}}) |
| 302 | if isEl then | 310 | if isEl then |
| 303 | role.dailyData:updateProperty({field = "advElC", delta = -count}) | 311 | role.dailyData:updateProperty({field = "advElC", delta = -count}) |
| 304 | role.dailyData:updateProperty({field = "advElBC", delta = count}) | 312 | role.dailyData:updateProperty({field = "advElBC", delta = count}) |
| @@ -306,6 +314,7 @@ function _M.buyAdvCountRpc(agent , data) | @@ -306,6 +314,7 @@ function _M.buyAdvCountRpc(agent , data) | ||
| 306 | role.dailyData:updateProperty({field = "advC", delta = -count}) | 314 | role.dailyData:updateProperty({field = "advC", delta = -count}) |
| 307 | role.dailyData:updateProperty({field = "advBC", delta = count}) | 315 | role.dailyData:updateProperty({field = "advBC", delta = count}) |
| 308 | end | 316 | end |
| 317 | + role:log("adv_action", {desc = "buyAdvCount", short1 = isEl and 1 or 0, int1 = count}) | ||
| 309 | 318 | ||
| 310 | SendPacket(actionCodes.Adv_buyAdvCountRpc, '') | 319 | SendPacket(actionCodes.Adv_buyAdvCountRpc, '') |
| 311 | return true | 320 | return true |
| @@ -329,6 +338,9 @@ function _M.finishTaskRpc(agent, data) | @@ -329,6 +338,9 @@ function _M.finishTaskRpc(agent, data) | ||
| 329 | adv:updateTask() | 338 | adv:updateTask() |
| 330 | if not status then return end | 339 | if not status then return end |
| 331 | role:checkTaskEnter("AdvOverTask", {id = taskId}) | 340 | role:checkTaskEnter("AdvOverTask", {id = taskId}) |
| 341 | + | ||
| 342 | + adv:log({desc = "finishTask", int1 = taskId}) | ||
| 343 | + | ||
| 332 | SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack({reward = reward})) | 344 | SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack({reward = reward})) |
| 333 | return true | 345 | return true |
| 334 | end | 346 | end |
| @@ -342,8 +354,12 @@ function _M.clickBlockRpc(agent, data) | @@ -342,8 +354,12 @@ function _M.clickBlockRpc(agent, data) | ||
| 342 | local adv = role:getAdvData() | 354 | local adv = role:getAdvData() |
| 343 | 355 | ||
| 344 | if adv:isWaitChooseArtifact() then return end | 356 | if adv:isWaitChooseArtifact() then return end |
| 357 | + | ||
| 358 | + adv:log({desc = "clickBlock", int1 = msg.roomId, int2 = msg.blockId}) | ||
| 359 | + | ||
| 345 | local status, errorCode = adv:clickBlock(msg.roomId, msg.blockId, msg) | 360 | local status, errorCode = adv:clickBlock(msg.roomId, msg.blockId, msg) |
| 346 | if not status then return errorCode end | 361 | if not status then return errorCode end |
| 362 | + | ||
| 347 | SendPacket(actionCodes.Adv_clickBlockRpc, MsgPack.pack({events = adv:popBackEvents()})) | 363 | SendPacket(actionCodes.Adv_clickBlockRpc, MsgPack.pack({events = adv:popBackEvents()})) |
| 348 | return true | 364 | return true |
| 349 | end | 365 | end |
| @@ -369,11 +385,12 @@ function _M.useItemRpc(agent, data) | @@ -369,11 +385,12 @@ function _M.useItemRpc(agent, data) | ||
| 369 | 385 | ||
| 370 | --消耗 | 386 | --消耗 |
| 371 | if itemData["function"] == 0 or itemData["function"] == 1 then | 387 | if itemData["function"] == 0 or itemData["function"] == 1 then |
| 372 | - adv:cost({[itemId] = count}, {}) | 388 | + adv:cost({[itemId] = count}, {log = {desc = "useItem", int1 = itemId, int2 = count}}) |
| 373 | adv:backUse({[itemId] = count}) | 389 | adv:backUse({[itemId] = count}) |
| 374 | end | 390 | end |
| 375 | 391 | ||
| 376 | adv:checkAchievement(adv.AchievType.UseItem, count, itemId) | 392 | adv:checkAchievement(adv.AchievType.UseItem, count, itemId) |
| 393 | + adv:log({desc = "useItem", int1 = itemId, int2 = count}) | ||
| 377 | 394 | ||
| 378 | for i = 1, count do | 395 | for i = 1, count do |
| 379 | adv:doActive(itemData.effect, target) -- target | 396 | adv:doActive(itemData.effect, target) -- target |
| @@ -409,6 +426,8 @@ function _M.usePotionRpc(agent, data) | @@ -409,6 +426,8 @@ function _M.usePotionRpc(agent, data) | ||
| 409 | local adv = role:getAdvData() | 426 | local adv = role:getAdvData() |
| 410 | if adv:isWaitChooseArtifact() then return end | 427 | if adv:isWaitChooseArtifact() then return end |
| 411 | 428 | ||
| 429 | + adv:log({desc = "usePotion", int1 = potionId}) | ||
| 430 | + | ||
| 412 | local status = adv:doActive(potionData.effect, target) -- target | 431 | local status = adv:doActive(potionData.effect, target) -- target |
| 413 | if not status then return end | 432 | if not status then return end |
| 414 | 433 | ||
| @@ -436,7 +455,7 @@ function _M.chooseArtifactRpc(agent, data) | @@ -436,7 +455,7 @@ function _M.chooseArtifactRpc(agent, data) | ||
| 436 | local status = adv:chooseArtifact(msg.idx) | 455 | local status = adv:chooseArtifact(msg.idx) |
| 437 | if not status then return end | 456 | if not status then return end |
| 438 | adv:saveDB() | 457 | adv:saveDB() |
| 439 | - | 458 | + |
| 440 | SendPacket(actionCodes.Adv_chooseArtifactRpc, '') | 459 | SendPacket(actionCodes.Adv_chooseArtifactRpc, '') |
| 441 | return true | 460 | return true |
| 442 | end | 461 | end |
| @@ -481,7 +500,7 @@ function _M.upArtifactRpc(agent, data) | @@ -481,7 +500,7 @@ function _M.upArtifactRpc(agent, data) | ||
| 481 | 500 | ||
| 482 | local status = adv:artifactLevelUp(id) | 501 | local status = adv:artifactLevelUp(id) |
| 483 | if not status then return 5 end | 502 | if not status then return 5 end |
| 484 | - adv:cost(cost, {}) | 503 | + adv:cost(cost, {log = {desc = "upArtifact", int1 = id}}) |
| 485 | adv:backCost(cost) | 504 | adv:backCost(cost) |
| 486 | if status == 1 then -- 现在穿着呢。更新下 | 505 | if status == 1 then -- 现在穿着呢。更新下 |
| 487 | adv:saveDB() | 506 | adv:saveDB() |
| @@ -497,6 +516,7 @@ function _M.exitAdvRpc(agent, data) | @@ -497,6 +516,7 @@ function _M.exitAdvRpc(agent, data) | ||
| 497 | if not isCanContinue(role) then return end | 516 | if not isCanContinue(role) then return end |
| 498 | 517 | ||
| 499 | local adv = role:getAdvData() | 518 | local adv = role:getAdvData() |
| 519 | + adv:log({desc = "exit"}) | ||
| 500 | local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标 | 520 | local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标 |
| 501 | SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()})) | 521 | SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()})) |
| 502 | return true | 522 | return true |
| @@ -555,8 +575,9 @@ function _M.endBattleRpc(agent, data) | @@ -555,8 +575,9 @@ function _M.endBattleRpc(agent, data) | ||
| 555 | if enemy.monsterId ~= monsterId or enemy.roomId ~= roomId or enemy.blockId ~= blockId then return end | 575 | if enemy.monsterId ~= monsterId or enemy.roomId ~= roomId or enemy.blockId ~= blockId then return end |
| 556 | adv.__battleCache = nil | 576 | adv.__battleCache = nil |
| 557 | 577 | ||
| 558 | - | 578 | + adv:log({desc = "endBattle"}) |
| 559 | local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) | 579 | local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) |
| 580 | + | ||
| 560 | if not status then return end | 581 | if not status then return end |
| 561 | SendPacket(actionCodes.Adv_endBattleRpc, MsgPack.pack({events = adv:popBackEvents()})) | 582 | SendPacket(actionCodes.Adv_endBattleRpc, MsgPack.pack({events = adv:popBackEvents()})) |
| 562 | return true | 583 | return true |
| @@ -621,7 +642,7 @@ function _M.wheelSurfRpc(agent, data) | @@ -621,7 +642,7 @@ function _M.wheelSurfRpc(agent, data) | ||
| 621 | end | 642 | end |
| 622 | 643 | ||
| 623 | if not role:checkItemEnough(costs) then return 5 end | 644 | if not role:checkItemEnough(costs) then return 5 end |
| 624 | - role:costItems(costs) | 645 | + role:costItems(costs, {log = {desc = "advWheelSurf", int1 = ptype}}) |
| 625 | role:addAdvLvExp(costs[ItemId.OldCoin] or 0) | 646 | role:addAdvLvExp(costs[ItemId.OldCoin] or 0) |
| 626 | local advDrawB = role:getProperty("advDrawB") | 647 | local advDrawB = role:getProperty("advDrawB") |
| 627 | advDrawB[ptype] = (advDrawB[ptype] or 0) + count | 648 | advDrawB[ptype] = (advDrawB[ptype] or 0) + count |
| @@ -635,8 +656,11 @@ function _M.wheelSurfRpc(agent, data) | @@ -635,8 +656,11 @@ function _M.wheelSurfRpc(agent, data) | ||
| 635 | reward[gift[1]] = (reward[gift[1]] or 0) + gift[2] | 656 | reward[gift[1]] = (reward[gift[1]] or 0) + gift[2] |
| 636 | table.insert(backReward, gift) | 657 | table.insert(backReward, gift) |
| 637 | end | 658 | end |
| 638 | - role:award(reward) | 659 | + role:award(reward, {log = {desc = "advWheelSurf", int1 = ptype}}) |
| 660 | + | ||
| 639 | role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype}) | 661 | role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype}) |
| 662 | + role:log("adv_action", {desc = "advWheelSurf", int1 = ptype, int2 = count}) | ||
| 663 | + | ||
| 640 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) | 664 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) |
| 641 | return true | 665 | return true |
| 642 | end | 666 | end |
| @@ -663,7 +687,8 @@ function _M.repayWheelSurfRpc(agent, data) | @@ -663,7 +687,8 @@ function _M.repayWheelSurfRpc(agent, data) | ||
| 663 | role:updateProperty({field = "advDrawB", value = advDrawB}) | 687 | role:updateProperty({field = "advDrawB", value = advDrawB}) |
| 664 | local gift = drawData["pool3"]:randWeight(true) | 688 | local gift = drawData["pool3"]:randWeight(true) |
| 665 | local reward = {[gift[1]] = gift[2]} | 689 | local reward = {[gift[1]] = gift[2]} |
| 666 | - reward = role:award(reward) | 690 | + reward = role:award(reward, {log = {desc = "advRepayWheelSurf", int1 = ptype}}) |
| 691 | + role:log("adv_action", {desc = "advRepayWheelSurf", int1 = ptype}) | ||
| 667 | 692 | ||
| 668 | SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack({reward = reward})) | 693 | SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack({reward = reward})) |
| 669 | return true | 694 | return true |
| @@ -686,6 +711,8 @@ function _M.finishAchievRpc(agent, data) | @@ -686,6 +711,8 @@ function _M.finishAchievRpc(agent, data) | ||
| 686 | end | 711 | end |
| 687 | if not status then return end | 712 | if not status then return end |
| 688 | adv:updateAchievement() | 713 | adv:updateAchievement() |
| 714 | + role:log("adv_action", {desc = "finishAchiev", short1 = ctype, int1 = chapterId, int2 = taskId}) | ||
| 715 | + | ||
| 689 | SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack({reward = reward})) | 716 | SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack({reward = reward})) |
| 690 | return true | 717 | return true |
| 691 | end | 718 | end |
| @@ -737,10 +764,11 @@ function _M.refreshSupportRpc(agent, data) | @@ -737,10 +764,11 @@ function _M.refreshSupportRpc(agent, data) | ||
| 737 | role.dailyData:updateProperty({field = "advSupRe", delta = 1}) | 764 | role.dailyData:updateProperty({field = "advSupRe", delta = 1}) |
| 738 | else -- 付费 | 765 | else -- 付费 |
| 739 | if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}) then return end | 766 | if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}) then return end |
| 740 | - role:costItems({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}) | 767 | + role:costItems({[ItemId.Diamond] = globalCsv.adv_support_refresh_cost}, {log = {desc = "advReSupport"}}) |
| 741 | end | 768 | end |
| 742 | 769 | ||
| 743 | role:advRandomSupportEffect() | 770 | role:advRandomSupportEffect() |
| 771 | + role:log("adv_action", {desc = "advSupRe", short1 = cr < al and 0 or 1}) | ||
| 744 | 772 | ||
| 745 | SendPacket(actionCodes.Adv_refreshSupportRpc, '') | 773 | SendPacket(actionCodes.Adv_refreshSupportRpc, '') |
| 746 | return true | 774 | return true |
src/actions/CarAction.lua
| @@ -35,10 +35,12 @@ function _M.makePotionRpc( agent, data ) | @@ -35,10 +35,12 @@ function _M.makePotionRpc( agent, data ) | ||
| 35 | return 5 | 35 | return 5 |
| 36 | end | 36 | end |
| 37 | 37 | ||
| 38 | - role:costItems(cost) | 38 | + role:costItems(cost, {log = {desc = "makePotion", int1 = potionId, int2 = count}}) |
| 39 | potionBag[potionId] = own + count | 39 | potionBag[potionId] = own + count |
| 40 | role:updateProperty({field = "potionBag", value = potionBag}) | 40 | role:updateProperty({field = "potionBag", value = potionBag}) |
| 41 | role:checkTaskEnter("PotionMake", {count = count, id = potionId}) | 41 | role:checkTaskEnter("PotionMake", {count = count, id = potionId}) |
| 42 | + | ||
| 43 | + role:log("role_action", {desc = "makePotion", int1 = potionId, int2 = count}) | ||
| 42 | SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag})) | 44 | SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag})) |
| 43 | return true | 45 | return true |
| 44 | end | 46 | end |
| @@ -84,10 +86,13 @@ function _M.equipUpRpc( agent, data ) | @@ -84,10 +86,13 @@ function _M.equipUpRpc( agent, data ) | ||
| 84 | return 4 | 86 | return 4 |
| 85 | end | 87 | end |
| 86 | 88 | ||
| 87 | - role:costItems(cost) | ||
| 88 | - role:addEquip(typ, lv, -costCount) | ||
| 89 | - role:addEquip(typ, nextLv ,count) | 89 | + role:costItems(cost, {log = {desc = "equipUp", int1 = id, int2 = count}}) |
| 90 | + role:addEquip(typ, lv, -costCount, {log = {desc = "equipUp"}}) | ||
| 91 | + role:addEquip(typ, nextLv ,count, {log = {desc = "equipUp"}}) | ||
| 90 | role:checkTaskEnter("EquipUp", {count = count}) | 92 | role:checkTaskEnter("EquipUp", {count = count}) |
| 93 | + | ||
| 94 | + role:log("role_action", {desc = "equipUp", int1 = id, int2 = count}) | ||
| 95 | + | ||
| 91 | SendPacket(actionCodes.Car_equipUpRpc, '') | 96 | SendPacket(actionCodes.Car_equipUpRpc, '') |
| 92 | return true | 97 | return true |
| 93 | end | 98 | end |
| @@ -117,9 +122,12 @@ function _M.runeUpRpc( agent, data ) | @@ -117,9 +122,12 @@ function _M.runeUpRpc( agent, data ) | ||
| 117 | return 7 | 122 | return 7 |
| 118 | end | 123 | end |
| 119 | 124 | ||
| 120 | - role:costItems(cost) | 125 | + role:costItems(cost, {log = {desc = "runeUp", int1 = uid, int2 = level}}) |
| 121 | ownRune:updateProperty({field = "level",value = level+1}) | 126 | ownRune:updateProperty({field = "level",value = level+1}) |
| 122 | role:checkTaskEnter("RuneUp") | 127 | role:checkTaskEnter("RuneUp") |
| 128 | + | ||
| 129 | + ownRune:log({desc = "runeUp", int1 = level + 1}) | ||
| 130 | + | ||
| 123 | SendPacket(actionCodes.Car_runeUpRpc, '') | 131 | SendPacket(actionCodes.Car_runeUpRpc, '') |
| 124 | return true | 132 | return true |
| 125 | end | 133 | end |
| @@ -143,7 +151,7 @@ function _M.saleEquipRpc(agent, data ) | @@ -143,7 +151,7 @@ function _M.saleEquipRpc(agent, data ) | ||
| 143 | local itemData = csvdb["itemCsv"][id] | 151 | local itemData = csvdb["itemCsv"][id] |
| 144 | local typ = math.floor((id-7000)/100) | 152 | local typ = math.floor((id-7000)/100) |
| 145 | local lv = (id-7000)%100 | 153 | local lv = (id-7000)%100 |
| 146 | - role:addEquip(typ, lv, -count) -- 删掉装备 | 154 | + role:addEquip(typ, lv, -count, {log = {desc = "saleEquip"}}) -- 删掉装备 |
| 147 | -- 发奖励 | 155 | -- 发奖励 |
| 148 | local one = itemData.sell_effect:toNumMap() | 156 | local one = itemData.sell_effect:toNumMap() |
| 149 | for k ,v in pairs(one) do | 157 | for k ,v in pairs(one) do |
| @@ -151,7 +159,10 @@ function _M.saleEquipRpc(agent, data ) | @@ -151,7 +159,10 @@ function _M.saleEquipRpc(agent, data ) | ||
| 151 | end | 159 | end |
| 152 | end | 160 | end |
| 153 | role:checkTaskEnter("SaleEquip", {count = allCount}) | 161 | role:checkTaskEnter("SaleEquip", {count = allCount}) |
| 154 | - reward = role:award(reward) | 162 | + reward = role:award(reward, {log = {desc = "saleEquip"}}) |
| 163 | + | ||
| 164 | + role:log("role_action", {desc = "saleEquip", int1 = allCount}) | ||
| 165 | + | ||
| 155 | SendPacket(actionCodes.Car_saleEquipRpc, MsgPack.pack({reward = reward})) | 166 | SendPacket(actionCodes.Car_saleEquipRpc, MsgPack.pack({reward = reward})) |
| 156 | return true | 167 | return true |
| 157 | end | 168 | end |
| @@ -177,10 +188,10 @@ function _M.saleRuneRpc(agent, data ) | @@ -177,10 +188,10 @@ function _M.saleRuneRpc(agent, data ) | ||
| 177 | end | 188 | end |
| 178 | end | 189 | end |
| 179 | 190 | ||
| 180 | - role:delRunes(backs) | 191 | + role:delRunes(backs, {log = {desc = "saleRune"}}) |
| 181 | role:checkTaskEnter("DecoRune", {count = count}) | 192 | role:checkTaskEnter("DecoRune", {count = count}) |
| 182 | - reward = role:award(reward) | ||
| 183 | - | 193 | + reward = role:award(reward, {log = {desc = "saleRune"}}) |
| 194 | + | ||
| 184 | SendPacket(actionCodes.Car_saleRuneRpc, MsgPack.pack({reward = reward})) | 195 | SendPacket(actionCodes.Car_saleRuneRpc, MsgPack.pack({reward = reward})) |
| 185 | return true | 196 | return true |
| 186 | end | 197 | end |
src/actions/DinerAction.lua
| @@ -54,7 +54,7 @@ function _M.addSellRpc( agent, data ) | @@ -54,7 +54,7 @@ function _M.addSellRpc( agent, data ) | ||
| 54 | return 6 | 54 | return 6 |
| 55 | end | 55 | end |
| 56 | 56 | ||
| 57 | - role:costItems(cost) | 57 | + role:costItems(cost, {log = {desc = "addSell"}}) |
| 58 | role.dinerData:updateSell(slot) | 58 | role.dinerData:updateSell(slot) |
| 59 | 59 | ||
| 60 | role:checkTaskEnter("MakeFood", {id = dish, count = count}) | 60 | role:checkTaskEnter("MakeFood", {id = dish, count = count}) |
| @@ -105,6 +105,8 @@ function _M.addSellRpc( agent, data ) | @@ -105,6 +105,8 @@ function _M.addSellRpc( agent, data ) | ||
| 105 | role.dinerData:updateProperty({field = "customer", value = customer}) | 105 | role.dinerData:updateProperty({field = "customer", value = customer}) |
| 106 | end | 106 | end |
| 107 | 107 | ||
| 108 | + role:log("diner_action", {desc = "addSell", int1 = dish, int2 = count}) | ||
| 109 | + | ||
| 108 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) | 110 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
| 109 | SendPacket(actionCodes.Diner_addSellRpc, "") | 111 | SendPacket(actionCodes.Diner_addSellRpc, "") |
| 110 | return true | 112 | return true |
| @@ -143,10 +145,13 @@ function _M.removeSellRpc( agent, data ) | @@ -143,10 +145,13 @@ function _M.removeSellRpc( agent, data ) | ||
| 143 | local cost = dishData.material:toNumMap() | 145 | local cost = dishData.material:toNumMap() |
| 144 | for k, n in pairs(cost) do | 146 | for k, n in pairs(cost) do |
| 145 | local sum = n*sell.count | 147 | local sum = n*sell.count |
| 146 | - role:addItem({itemId = k,count = sum}) | ||
| 147 | reward[k] = sum | 148 | reward[k] = sum |
| 148 | end | 149 | end |
| 150 | + reward = role:award(reward, {log = {desc = "removeSell"}}) | ||
| 149 | sells[slot].count = 0 | 151 | sells[slot].count = 0 |
| 152 | + | ||
| 153 | + role:log("diner_action", {desc = "removeSell", int1 = dish}) | ||
| 154 | + | ||
| 150 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) | 155 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
| 151 | SendPacket(actionCodes.Diner_removeSellRpc, MsgPack.pack({reward = reward})) | 156 | SendPacket(actionCodes.Diner_removeSellRpc, MsgPack.pack({reward = reward})) |
| 152 | return true | 157 | return true |
| @@ -184,18 +189,23 @@ function _M.getSellRewardRpc( agent, data ) | @@ -184,18 +189,23 @@ function _M.getSellRewardRpc( agent, data ) | ||
| 184 | sells[slot].popular = 0 | 189 | sells[slot].popular = 0 |
| 185 | end | 190 | end |
| 186 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) | 191 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
| 187 | - for k, v in pairs(reward:toNumMap()) do | ||
| 188 | - role:addItem({itemId = k,count = v}) | 192 | + local gift = reward:toNumMap() |
| 193 | + for k, v in pairs(gift) do | ||
| 189 | if k == ItemId.Gold then | 194 | if k == ItemId.Gold then |
| 190 | role:checkTaskEnter("FoodSellGold", {count = v}) | 195 | role:checkTaskEnter("FoodSellGold", {count = v}) |
| 191 | end | 196 | end |
| 192 | end | 197 | end |
| 198 | + role:award(gift, {log = {desc = "dinerSell"}}) | ||
| 199 | + | ||
| 193 | 200 | ||
| 194 | role.dinerData:popularAdd(popular) | 201 | role.dinerData:popularAdd(popular) |
| 195 | 202 | ||
| 196 | if dirty then | 203 | if dirty then |
| 197 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) | 204 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) |
| 198 | end | 205 | end |
| 206 | + | ||
| 207 | + role:log("diner_action", {desc = "sell"}) | ||
| 208 | + | ||
| 199 | SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward})) | 209 | SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward})) |
| 200 | return true | 210 | return true |
| 201 | end | 211 | end |
| @@ -213,7 +223,7 @@ function _M.expediteSellRpc( agent, data ) | @@ -213,7 +223,7 @@ function _M.expediteSellRpc( agent, data ) | ||
| 213 | if not role:checkItemEnough(cost) then | 223 | if not role:checkItemEnough(cost) then |
| 214 | return 2 | 224 | return 2 |
| 215 | end | 225 | end |
| 216 | - role:costItems(cost) | 226 | + role:costItems(cost, {log = {desc = "dinerSellQ"}}) |
| 217 | end | 227 | end |
| 218 | 228 | ||
| 219 | local dirty = false | 229 | local dirty = false |
| @@ -250,12 +260,14 @@ function _M.expediteSellRpc( agent, data ) | @@ -250,12 +260,14 @@ function _M.expediteSellRpc( agent, data ) | ||
| 250 | role.dinerData:notifyUpdateProperty("sells", role.dinerData:getProperty("sells")) | 260 | role.dinerData:notifyUpdateProperty("sells", role.dinerData:getProperty("sells")) |
| 251 | role.dinerData:setProperty("expedite",count+1) | 261 | role.dinerData:setProperty("expedite",count+1) |
| 252 | role.dinerData:notifyUpdateProperty("expedite", count+1) | 262 | role.dinerData:notifyUpdateProperty("expedite", count+1) |
| 253 | - for k, v in pairs(reward:toNumMap()) do | ||
| 254 | - role:addItem({itemId = k,count = v}) | 263 | + local gift = reward:toNumMap() |
| 264 | + for k, v in pairs(gift) do | ||
| 255 | if k == ItemId.Gold then | 265 | if k == ItemId.Gold then |
| 256 | role:checkTaskEnter("FoodSellGold", {count = v}) | 266 | role:checkTaskEnter("FoodSellGold", {count = v}) |
| 257 | end | 267 | end |
| 258 | end | 268 | end |
| 269 | + role:award(gift, {log = {desc = "dinerSell"}}) | ||
| 270 | + | ||
| 259 | 271 | ||
| 260 | role.dinerData:popularAdd(popular) | 272 | role.dinerData:popularAdd(popular) |
| 261 | 273 | ||
| @@ -263,6 +275,9 @@ function _M.expediteSellRpc( agent, data ) | @@ -263,6 +275,9 @@ function _M.expediteSellRpc( agent, data ) | ||
| 263 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) | 275 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) |
| 264 | end | 276 | end |
| 265 | role:checkTaskEnter("FoodSellQuick") | 277 | role:checkTaskEnter("FoodSellQuick") |
| 278 | + | ||
| 279 | + role:log("diner_action", {desc = "sellQ"}) | ||
| 280 | + | ||
| 266 | SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward,popular = popular})) | 281 | SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward,popular = popular})) |
| 267 | return true | 282 | return true |
| 268 | end | 283 | end |
| @@ -298,9 +313,12 @@ function _M.levelUpRpc( agent, data ) | @@ -298,9 +313,12 @@ function _M.levelUpRpc( agent, data ) | ||
| 298 | return | 313 | return |
| 299 | end | 314 | end |
| 300 | 315 | ||
| 301 | - role:costItems(cost) | 316 | + role:costItems(cost, {log = {desc = "dinerBuildUp", int1 = index}}) |
| 302 | role.dinerData:updateProperty({field = "buildL", value = buildL:setv(index, curLevel + 1)}) | 317 | role.dinerData:updateProperty({field = "buildL", value = buildL:setv(index, curLevel + 1)}) |
| 303 | role:checkTaskEnter("DinerLevelUp", {type = index, level = curLevel + 1}) | 318 | role:checkTaskEnter("DinerLevelUp", {type = index, level = curLevel + 1}) |
| 319 | + | ||
| 320 | + role:log("diner_action", {desc = "buildUp", int1 = index, int2 = curLevel + 1}) | ||
| 321 | + | ||
| 304 | SendPacket(actionCodes.Diner_levelUpRpc, '') | 322 | SendPacket(actionCodes.Diner_levelUpRpc, '') |
| 305 | return true | 323 | return true |
| 306 | end | 324 | end |
| @@ -374,7 +392,7 @@ function _M.talentUpRpc( agent, data ) | @@ -374,7 +392,7 @@ function _M.talentUpRpc( agent, data ) | ||
| 374 | -- if next(role:getProperty("advTeam")) then return 8 end | 392 | -- if next(role:getProperty("advTeam")) then return 8 end |
| 375 | -- end | 393 | -- end |
| 376 | 394 | ||
| 377 | - role:costItems(cost) | 395 | + role:costItems(cost, {log = {desc = "talentUp", int1 = dish, int2 = dishLevel + 1}}) |
| 378 | role.dinerData:updateProperty({field = "dishTree", value = dishTree:setv(dish, dishLevel + 1)}) | 396 | role.dinerData:updateProperty({field = "dishTree", value = dishTree:setv(dish, dishLevel + 1)}) |
| 379 | -- local treePoint = talentData.tree_point:toNumMap() | 397 | -- local treePoint = talentData.tree_point:toNumMap() |
| 380 | -- if next(treePoint) then | 398 | -- if next(treePoint) then |
| @@ -383,6 +401,8 @@ function _M.talentUpRpc( agent, data ) | @@ -383,6 +401,8 @@ function _M.talentUpRpc( agent, data ) | ||
| 383 | 401 | ||
| 384 | role:checkTaskEnter("DinerTalentUp", {type = talentData.effect:toArray(true,"=")[1]}) | 402 | role:checkTaskEnter("DinerTalentUp", {type = talentData.effect:toArray(true,"=")[1]}) |
| 385 | 403 | ||
| 404 | + role:log("diner_action", {desc = "talentUp", int1 = dish, int2 = dishLevel + 1}) | ||
| 405 | + | ||
| 386 | SendPacket(actionCodes.Diner_talentUpRpc, '') | 406 | SendPacket(actionCodes.Diner_talentUpRpc, '') |
| 387 | return true | 407 | return true |
| 388 | end | 408 | end |
| @@ -414,8 +434,9 @@ function _M.skillUpRpc( agent, data ) | @@ -414,8 +434,9 @@ function _M.skillUpRpc( agent, data ) | ||
| 414 | return | 434 | return |
| 415 | end | 435 | end |
| 416 | 436 | ||
| 417 | - role:costItems(cost) | 437 | + role:costItems(cost, {log = {desc = "dinerSkillUp", int1 = skill, int2 = skillLevel + 1}}) |
| 418 | role.dinerData:updateProperty({field = "skillTree", value = skillTree:setv(skill, skillLevel + 1)}) | 438 | role.dinerData:updateProperty({field = "skillTree", value = skillTree:setv(skill, skillLevel + 1)}) |
| 439 | + role:log("diner_action", {desc = "skillUp", int1 = skill, int2 = skillLevel + 1}) | ||
| 419 | 440 | ||
| 420 | SendPacket(actionCodes.Diner_skillUpRpc, '') | 441 | SendPacket(actionCodes.Diner_skillUpRpc, '') |
| 421 | return true | 442 | return true |
| @@ -442,6 +463,9 @@ function _M.lockTaskRpc( agent, data ) | @@ -442,6 +463,9 @@ function _M.lockTaskRpc( agent, data ) | ||
| 442 | order.lock = 0 | 463 | order.lock = 0 |
| 443 | end | 464 | end |
| 444 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) | 465 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
| 466 | + | ||
| 467 | + role:log("diner_action", {desc = "lockTask", int1 = order.id}) | ||
| 468 | + | ||
| 445 | SendPacket(actionCodes.Diner_lockTaskRpc, MsgPack.pack({lock = order.lock})) | 469 | SendPacket(actionCodes.Diner_lockTaskRpc, MsgPack.pack({lock = order.lock})) |
| 446 | return true | 470 | return true |
| 447 | end | 471 | end |
| @@ -477,6 +501,9 @@ function _M.updateTaskRpc( agent, data ) | @@ -477,6 +501,9 @@ function _M.updateTaskRpc( agent, data ) | ||
| 477 | end | 501 | end |
| 478 | orders[index].status = 1 | 502 | orders[index].status = 1 |
| 479 | orders[index].lock = 1 | 503 | orders[index].lock = 1 |
| 504 | + | ||
| 505 | + role:log("diner_action", {desc = "getTask", int1 = order.id}) | ||
| 506 | + | ||
| 480 | role:checkTaskEnter("GetOderTask", {rarity = taskSet.rarity}) | 507 | role:checkTaskEnter("GetOderTask", {rarity = taskSet.rarity}) |
| 481 | elseif cmd == 1 then | 508 | elseif cmd == 1 then |
| 482 | if order.status ~= 1 then | 509 | if order.status ~= 1 then |
| @@ -484,6 +511,9 @@ function _M.updateTaskRpc( agent, data ) | @@ -484,6 +511,9 @@ function _M.updateTaskRpc( agent, data ) | ||
| 484 | end | 511 | end |
| 485 | orders[index].status = 0 | 512 | orders[index].status = 0 |
| 486 | orders[index].lock = 0 | 513 | orders[index].lock = 0 |
| 514 | + | ||
| 515 | + role:log("diner_action", {desc = "deleteTask", int1 = order.id}) | ||
| 516 | + | ||
| 487 | elseif cmd == 2 then | 517 | elseif cmd == 2 then |
| 488 | if order.status ~= 1 then | 518 | if order.status ~= 1 then |
| 489 | return 32 | 519 | return 32 |
| @@ -491,9 +521,9 @@ function _M.updateTaskRpc( agent, data ) | @@ -491,9 +521,9 @@ function _M.updateTaskRpc( agent, data ) | ||
| 491 | if order.n < taskData.value then | 521 | if order.n < taskData.value then |
| 492 | return 6 | 522 | return 6 |
| 493 | end | 523 | end |
| 494 | - for typ, count in pairs(taskData.reward:toNumMap()) do | ||
| 495 | - role:addItem({itemId = typ, count = count}) | ||
| 496 | - end | 524 | + role:log("diner_action", {desc = "finishTask", int1 = order.id}) |
| 525 | + | ||
| 526 | + role:award(taskData.reward, {log = {desc = "dinerFinishTask", int1 = order.id}}) | ||
| 497 | table.remove(orders,index) | 527 | table.remove(orders,index) |
| 498 | role:checkTaskEnter("OverOderTask", {rarity = taskSet.rarity}) | 528 | role:checkTaskEnter("OverOderTask", {rarity = taskSet.rarity}) |
| 499 | else | 529 | else |
| @@ -550,7 +580,7 @@ function _M.refreshTaskRpc( agent, data ) | @@ -550,7 +580,7 @@ function _M.refreshTaskRpc( agent, data ) | ||
| 550 | end | 580 | end |
| 551 | if not role:checkItemEnough(cost) then return end | 581 | if not role:checkItemEnough(cost) then return end |
| 552 | 582 | ||
| 553 | - role:costItems(cost) | 583 | + role:costItems(cost, {log = {desc = "dinerReTask"}}) |
| 554 | 584 | ||
| 555 | 585 | ||
| 556 | for idx, order in ipairs(orders) do | 586 | for idx, order in ipairs(orders) do |
| @@ -565,6 +595,8 @@ function _M.refreshTaskRpc( agent, data ) | @@ -565,6 +595,8 @@ function _M.refreshTaskRpc( agent, data ) | ||
| 565 | end | 595 | end |
| 566 | end | 596 | end |
| 567 | 597 | ||
| 598 | + role:log("diner_action", {desc = "reTask"}) | ||
| 599 | + | ||
| 568 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) | 600 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
| 569 | 601 | ||
| 570 | SendPacket(actionCodes.Diner_refreshTaskRpc, '') | 602 | SendPacket(actionCodes.Diner_refreshTaskRpc, '') |
| @@ -605,6 +637,8 @@ function _M.addWantFoodRpc(agent , data) | @@ -605,6 +637,8 @@ function _M.addWantFoodRpc(agent , data) | ||
| 605 | gfood[slot] = {id = itemId, st = skynet.timex()} | 637 | gfood[slot] = {id = itemId, st = skynet.timex()} |
| 606 | end | 638 | end |
| 607 | 639 | ||
| 640 | + role:log("diner_action", {desc = "wantFood"}) | ||
| 641 | + | ||
| 608 | role.dinerData:updateProperty({field = "gfood", value = gfood}) | 642 | role.dinerData:updateProperty({field = "gfood", value = gfood}) |
| 609 | 643 | ||
| 610 | SendPacket(actionCodes.Diner_addWantFoodRpc, '') | 644 | SendPacket(actionCodes.Diner_addWantFoodRpc, '') |
| @@ -640,8 +674,11 @@ function _M.getGreenhouseRpc( agent, data ) | @@ -640,8 +674,11 @@ function _M.getGreenhouseRpc( agent, data ) | ||
| 640 | end | 674 | end |
| 641 | end | 675 | end |
| 642 | role.dinerData:updateProperty({field = "gfood", value = gfood}) | 676 | role.dinerData:updateProperty({field = "gfood", value = gfood}) |
| 643 | - local reward = role:award(reward) | 677 | + local reward = role:award(reward, {log = {desc = "greenHourse"}}) |
| 644 | role:checkTaskEnter("FoodMGet") | 678 | role:checkTaskEnter("FoodMGet") |
| 679 | + | ||
| 680 | + role:log("diner_action", {desc = "greenHourse"}) | ||
| 681 | + | ||
| 645 | SendPacket(actionCodes.Diner_getGreenhouseRpc, MsgPack.pack({reward = reward})) | 682 | SendPacket(actionCodes.Diner_getGreenhouseRpc, MsgPack.pack({reward = reward})) |
| 646 | return true | 683 | return true |
| 647 | end | 684 | end |
| @@ -751,24 +788,25 @@ function _M.entrustRpc(agent , data) | @@ -751,24 +788,25 @@ function _M.entrustRpc(agent , data) | ||
| 751 | local ctype = msg.ctype | 788 | local ctype = msg.ctype |
| 752 | 789 | ||
| 753 | local entrust = role.dinerData:getProperty("entrust") | 790 | local entrust = role.dinerData:getProperty("entrust") |
| 754 | - if not entrust[1] then return end | 791 | + local entrustId = entrust[1] |
| 792 | + if not entrustId then return end | ||
| 755 | 793 | ||
| 756 | local reward | 794 | local reward |
| 757 | if ctype == 1 then -- 完成 | 795 | if ctype == 1 then -- 完成 |
| 758 | - local curData = csvdb["diner_missionCsv"][entrust[1]] | 796 | + local curData = csvdb["diner_missionCsv"][entrustId] |
| 759 | if not curData then return end | 797 | if not curData then return end |
| 760 | 798 | ||
| 761 | if curData.type == 1 then | 799 | if curData.type == 1 then |
| 762 | local cost = curData.condition:toNumMap() | 800 | local cost = curData.condition:toNumMap() |
| 763 | if not role:checkItemEnough(cost) then return end | 801 | if not role:checkItemEnough(cost) then return end |
| 764 | - role:costItems(cost) | 802 | + role:costItems(cost, {log = {desc = "dinerEntrus", int1 = entrustId}}) |
| 765 | elseif curData.type == 2 then | 803 | elseif curData.type == 2 then |
| 766 | -- todo 数据校验 | 804 | -- todo 数据校验 |
| 767 | else | 805 | else |
| 768 | return | 806 | return |
| 769 | end | 807 | end |
| 770 | 808 | ||
| 771 | - reward = role:award(curData.reward) | 809 | + reward = role:award(curData.reward, {log = {desc = "dinerEntrus", int1 = entrustId}}) |
| 772 | table.remove(entrust, 1) | 810 | table.remove(entrust, 1) |
| 773 | elseif ctype == 2 then -- 放弃 | 811 | elseif ctype == 2 then -- 放弃 |
| 774 | table.remove(entrust, 1) | 812 | table.remove(entrust, 1) |
| @@ -777,6 +815,8 @@ function _M.entrustRpc(agent , data) | @@ -777,6 +815,8 @@ function _M.entrustRpc(agent , data) | ||
| 777 | end | 815 | end |
| 778 | role.dinerData:updateProperty({field = "entrust", value = entrust}) | 816 | role.dinerData:updateProperty({field = "entrust", value = entrust}) |
| 779 | 817 | ||
| 818 | + role:log("diner_action", {desc = "entrus", short1 = ctype, int1 = entrustId}) | ||
| 819 | + | ||
| 780 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward})) | 820 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward})) |
| 781 | return true | 821 | return true |
| 782 | end | 822 | end |
| @@ -798,9 +838,10 @@ function _M.collectRpc(agent , data) | @@ -798,9 +838,10 @@ function _M.collectRpc(agent , data) | ||
| 798 | for slot, _ in pairs(sells) do | 838 | for slot, _ in pairs(sells) do |
| 799 | role.dinerData:updateSell(slot) | 839 | role.dinerData:updateSell(slot) |
| 800 | end | 840 | end |
| 801 | - local reward = role:award(customerData.reward) | 841 | + local reward = role:award(customerData.reward, {log = {desc = "dinerCollect", int1 = id}}) |
| 802 | customer[id] = 1 | 842 | customer[id] = 1 |
| 803 | role.dinerData:updateProperty({field = "customer", value = customer}) -- 解锁了 | 843 | role.dinerData:updateProperty({field = "customer", value = customer}) -- 解锁了 |
| 844 | + role:log("diner_action", {desc = "collect", int1 = id}) | ||
| 804 | 845 | ||
| 805 | SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward})) | 846 | SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward})) |
| 806 | return true | 847 | return true |
| @@ -826,10 +867,12 @@ function _M.comboRewardRpc(agent , data) | @@ -826,10 +867,12 @@ function _M.comboRewardRpc(agent , data) | ||
| 826 | end | 867 | end |
| 827 | 868 | ||
| 828 | comboStatus[id] = 1 | 869 | comboStatus[id] = 1 |
| 829 | - local reward = role:award(comboData.reward) | 870 | + local reward = role:award(comboData.reward, {log = {desc = "dinerCombo", int1 = id}}) |
| 830 | 871 | ||
| 831 | role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 | 872 | role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 |
| 832 | 873 | ||
| 874 | + role:log("diner_action", {desc = "combo", int1 = id}) | ||
| 875 | + | ||
| 833 | SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward})) | 876 | SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward})) |
| 834 | return true | 877 | return true |
| 835 | end | 878 | end |
src/actions/EmailAction.lua
| @@ -53,7 +53,7 @@ function _M.listRpc(agent, data) | @@ -53,7 +53,7 @@ function _M.listRpc(agent, data) | ||
| 53 | content = email.content, | 53 | content = email.content, |
| 54 | attachments = email.attachments | 54 | attachments = email.attachments |
| 55 | }) | 55 | }) |
| 56 | - --role:log("mail_actions", {desc = "get_global", s1 = email.title, s2 = email.attachments}) | 56 | + role:log("mail_action", {desc = "get_global", key1 = email.title, key2 = email.attachments}) |
| 57 | end | 57 | end |
| 58 | end | 58 | end |
| 59 | end | 59 | end |
| @@ -95,10 +95,10 @@ function _M.drawAllAttachRpc(agent, data) | @@ -95,10 +95,10 @@ function _M.drawAllAttachRpc(agent, data) | ||
| 95 | local attachments = getEmailAttachments(email) | 95 | local attachments = getEmailAttachments(email) |
| 96 | if attachments ~= "" then | 96 | if attachments ~= "" then |
| 97 | local emailId = email:getProperty("id") | 97 | local emailId = email:getProperty("id") |
| 98 | - local items = role:award(attachments) | 98 | + local items = role:award(attachments, {log = {desc = "draw_attach", int1 = emailId, key1 = email:getProperty("title")}}) |
| 99 | ids[emailId] = 1 | 99 | ids[emailId] = 1 |
| 100 | red:hset(string.format(R_EMAIL_ITEM, roleId, emailId), "status", 2) | 100 | red:hset(string.format(R_EMAIL_ITEM, roleId, emailId), "status", 2) |
| 101 | - -- role:log("mail_actions", {desc = "draw_attach", int1 = emailId, s1 = email:getProperty("title"), s2 = attachments}) | 101 | + role:log("mail_action", {desc = "draw_attach", int1 = emailId, key1 = email:getProperty("title"), key2 = attachments}) |
| 102 | 102 | ||
| 103 | for key, v in pairs(items) do | 103 | for key, v in pairs(items) do |
| 104 | reward[key] = (reward[key] or 0) + v | 104 | reward[key] = (reward[key] or 0) + v |
| @@ -125,11 +125,11 @@ function _M.drawAttachRpc(agent, data) | @@ -125,11 +125,11 @@ function _M.drawAttachRpc(agent, data) | ||
| 125 | local attachments = getEmailAttachments(email) | 125 | local attachments = getEmailAttachments(email) |
| 126 | if attachments == "" then return end | 126 | if attachments == "" then return end |
| 127 | 127 | ||
| 128 | - local reward = role:award(attachments) | 128 | + local reward = role:award(attachments, {log = {desc = "draw_attach", int1 = emailId, key1 = email:getProperty("title")}}) |
| 129 | redisproxy:hset(rds, "status", 2) -- 领取标记 | 129 | redisproxy:hset(rds, "status", 2) -- 领取标记 |
| 130 | SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward})) | 130 | SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward})) |
| 131 | 131 | ||
| 132 | - -- role:log("mail_actions", {desc = "draw_attach", int1 = id, s1 = email:getProperty("title"), s2 = attachments, ucode = ucode}) | 132 | + role:log("mail_action", {desc = "draw_attach", int1 = id, key1 = email:getProperty("title"), key2 = attachments}) |
| 133 | return true | 133 | return true |
| 134 | end | 134 | end |
| 135 | 135 | ||
| @@ -144,7 +144,7 @@ function _M.checkRpc(agent, data) | @@ -144,7 +144,7 @@ function _M.checkRpc(agent, data) | ||
| 144 | if not redisproxy:exists(rds) then return end | 144 | if not redisproxy:exists(rds) then return end |
| 145 | 145 | ||
| 146 | redisproxy:hset(rds, "status", 1) | 146 | redisproxy:hset(rds, "status", 1) |
| 147 | - -- role:log("mail_actions", {desc = "check_mail", int1 = id}) | 147 | + role:log("mail_action", {desc = "check_mail", int1 = id}) |
| 148 | 148 | ||
| 149 | SendPacket(actionCodes.Email_checkRpc, '') | 149 | SendPacket(actionCodes.Email_checkRpc, '') |
| 150 | return true | 150 | return true |
| @@ -179,9 +179,9 @@ function _M.delRpc(agent, data) | @@ -179,9 +179,9 @@ function _M.delRpc(agent, data) | ||
| 179 | end | 179 | end |
| 180 | end | 180 | end |
| 181 | end) | 181 | end) |
| 182 | - -- for delId, _ in ipairs(result) do | ||
| 183 | - -- role:log("mail_actions", {desc = "del_mail", int1 = delId}) | ||
| 184 | - -- end | 182 | + for delId, _ in ipairs(result) do |
| 183 | + role:log("mail_action", {desc = "del_mail", int1 = delId}) | ||
| 184 | + end | ||
| 185 | SendPacket(actionCodes.Email_delRpc, MsgPack.pack({result = result})) | 185 | SendPacket(actionCodes.Email_delRpc, MsgPack.pack({result = result})) |
| 186 | return true | 186 | return true |
| 187 | end | 187 | end |
src/actions/FriendAction.lua
| @@ -110,6 +110,8 @@ function _M.searchRpc(agent, data) | @@ -110,6 +110,8 @@ function _M.searchRpc(agent, data) | ||
| 110 | 110 | ||
| 111 | })) | 111 | })) |
| 112 | end | 112 | end |
| 113 | + | ||
| 114 | + role:log("role_action", {desc = "searchFriend"}) | ||
| 113 | SendPacket(actionCodes.Friend_searchRpc, MsgPack.pack({searchList = searchList})) | 115 | SendPacket(actionCodes.Friend_searchRpc, MsgPack.pack({searchList = searchList})) |
| 114 | return true | 116 | return true |
| 115 | end | 117 | end |
| @@ -175,8 +177,14 @@ function _M.applyRpc(agent, data) | @@ -175,8 +177,14 @@ function _M.applyRpc(agent, data) | ||
| 175 | myInfo.roleId = roleId | 177 | myInfo.roleId = roleId |
| 176 | myInfo.online = true | 178 | myInfo.online = true |
| 177 | myInfo.hadApply = true | 179 | myInfo.hadApply = true |
| 180 | + | ||
| 181 | + role:log("role_action", {desc = "addFriend", int1 = 1}) | ||
| 182 | + | ||
| 178 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方 | 183 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方 |
| 179 | end | 184 | end |
| 185 | + | ||
| 186 | + | ||
| 187 | + | ||
| 180 | SendPacket(actionCodes.Friend_applyRpc, MsgPack.pack({result = result})) | 188 | SendPacket(actionCodes.Friend_applyRpc, MsgPack.pack({result = result})) |
| 181 | return true | 189 | return true |
| 182 | end | 190 | end |
| @@ -268,6 +276,9 @@ function _M.handleApplyRpc(agent, data) | @@ -268,6 +276,9 @@ function _M.handleApplyRpc(agent, data) | ||
| 268 | otherInfo.isFriend = true | 276 | otherInfo.isFriend = true |
| 269 | otherInfo.pGet = redret[2] == 1 and 1 or nil | 277 | otherInfo.pGet = redret[2] == 1 and 1 or nil |
| 270 | SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {otherInfo}})) | 278 | SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {otherInfo}})) |
| 279 | + | ||
| 280 | + role:log("role_action", {desc = "addFriend", int1 = 1}) | ||
| 281 | + | ||
| 271 | end | 282 | end |
| 272 | 283 | ||
| 273 | elseif cmd == 0 then -- 不同意 | 284 | elseif cmd == 0 then -- 不同意 |
| @@ -322,6 +333,8 @@ function _M.handleApplyRpc(agent, data) | @@ -322,6 +333,8 @@ function _M.handleApplyRpc(agent, data) | ||
| 322 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {myInfo}})) -- 通知对方 | 333 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {myInfo}})) -- 通知对方 |
| 323 | end | 334 | end |
| 324 | if next(needAdd) then | 335 | if next(needAdd) then |
| 336 | + role:log("role_action", {desc = "addFriend", int1 = #needAdd}) | ||
| 337 | + | ||
| 325 | SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = needAddInfo})) | 338 | SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = needAddInfo})) |
| 326 | else | 339 | else |
| 327 | result = 1 | 340 | result = 1 |
| @@ -520,6 +533,8 @@ function _M.pointRpc(agent, data) | @@ -520,6 +533,8 @@ function _M.pointRpc(agent, data) | ||
| 520 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) | 533 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) |
| 521 | role:checkTaskEnter("GiveFriendP", {count = 1}) | 534 | role:checkTaskEnter("GiveFriendP", {count = 1}) |
| 522 | rpcRole(objId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newPoint = 1, roleId = roleId})) | 535 | rpcRole(objId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newPoint = 1, roleId = roleId})) |
| 536 | + | ||
| 537 | + role:log("role_action", {desc = "giveFPoint", int1 = 1}) | ||
| 523 | end | 538 | end |
| 524 | elseif cmd == 2 then -- 领取 | 539 | elseif cmd == 2 then -- 领取 |
| 525 | local objId = msg.roleId | 540 | local objId = msg.roleId |
| @@ -535,9 +550,11 @@ function _M.pointRpc(agent, data) | @@ -535,9 +550,11 @@ function _M.pointRpc(agent, data) | ||
| 535 | end | 550 | end |
| 536 | if not result then | 551 | if not result then |
| 537 | getP[objId] = 1 | 552 | getP[objId] = 1 |
| 538 | - reward = role:award({[ItemId.FriendPoint] = 1}) | 553 | + reward = role:award({[ItemId.FriendPoint] = 1}, {log = {desc = "friendPoint"}}) |
| 539 | role.dailyData:updateProperty({field = "getFP", value = getP}) | 554 | role.dailyData:updateProperty({field = "getFP", value = getP}) |
| 540 | role:checkTaskEnter("GetFriendP", {count = 1}) | 555 | role:checkTaskEnter("GetFriendP", {count = 1}) |
| 556 | + | ||
| 557 | + role:log("role_action", {desc = "getFPoint", int1 = 1}) | ||
| 541 | end | 558 | end |
| 542 | elseif cmd == 3 then -- 一键赠送领取 | 559 | elseif cmd == 3 then -- 一键赠送领取 |
| 543 | -- 赠送 | 560 | -- 赠送 |
| @@ -558,6 +575,9 @@ function _M.pointRpc(agent, data) | @@ -558,6 +575,9 @@ function _M.pointRpc(agent, data) | ||
| 558 | if change > 0 then | 575 | if change > 0 then |
| 559 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) | 576 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) |
| 560 | role:checkTaskEnter("GiveFriendP", {count = change}) | 577 | role:checkTaskEnter("GiveFriendP", {count = change}) |
| 578 | + | ||
| 579 | + role:log("role_action", {desc = "giveFPoint", int1 = change}) | ||
| 580 | + | ||
| 561 | else | 581 | else |
| 562 | result = 1 | 582 | result = 1 |
| 563 | end | 583 | end |
| @@ -579,9 +599,10 @@ function _M.pointRpc(agent, data) | @@ -579,9 +599,10 @@ function _M.pointRpc(agent, data) | ||
| 579 | end | 599 | end |
| 580 | end | 600 | end |
| 581 | if getCount > 0 then | 601 | if getCount > 0 then |
| 582 | - reward = role:award({[ItemId.FriendPoint] = getCount}) | 602 | + reward = role:award({[ItemId.FriendPoint] = getCount}, {log = {desc = "friendPoint"}}) |
| 583 | role.dailyData:updateProperty({field = "getFP", value = getP}) | 603 | role.dailyData:updateProperty({field = "getFP", value = getP}) |
| 584 | role:checkTaskEnter("GetFriendP", {count = getCount}) | 604 | role:checkTaskEnter("GetFriendP", {count = getCount}) |
| 605 | + role:log("role_action", {desc = "getFPoint", int1 = getCount}) | ||
| 585 | else | 606 | else |
| 586 | result = (result or 0) + 2 | 607 | result = (result or 0) + 2 |
| 587 | end | 608 | end |
src/actions/GmAction.lua
| @@ -19,14 +19,15 @@ function _M.testhotfix(role, pms) | @@ -19,14 +19,15 @@ function _M.testhotfix(role, pms) | ||
| 19 | return csvdb["itemCsv"][1]["name"] .. " -=- " .. csvdb["itemCsv"][2]["name"] .. " -=- " .. role:getItemCount(123) .. " -=- " .. table.pack(next(role.heros))[2]:getBattleValue() | 19 | return csvdb["itemCsv"][1]["name"] .. " -=- " .. csvdb["itemCsv"][2]["name"] .. " -=- " .. role:getItemCount(123) .. " -=- " .. table.pack(next(role.heros))[2]:getBattleValue() |
| 20 | end | 20 | end |
| 21 | 21 | ||
| 22 | -function _M.ignoreout(role, params) | ||
| 23 | - params = params or {} | ||
| 24 | - local status = tonum(params.pm1, 1) | 22 | +function _M.ignoreout(role, pms) |
| 23 | + pms = pms or {} | ||
| 24 | + local status = tonum(pms.pm1, 1) | ||
| 25 | if status == 1 then -- 忽视 | 25 | if status == 1 then -- 忽视 |
| 26 | role:updateProperty({field = "ignoreMt", value = 1}) | 26 | role:updateProperty({field = "ignoreMt", value = 1}) |
| 27 | else -- 解除 | 27 | else -- 解除 |
| 28 | role:updateProperty({field = "ignoreMt", value = 0}) | 28 | role:updateProperty({field = "ignoreMt", value = 0}) |
| 29 | end | 29 | end |
| 30 | + role:log("gm_action", {desc = "ignoreout", key1 = pms.sender}) | ||
| 30 | return "指令生效" | 31 | return "指令生效" |
| 31 | end | 32 | end |
| 32 | 33 | ||
| @@ -46,11 +47,17 @@ function _M.ban(role, pms) | @@ -46,11 +47,17 @@ function _M.ban(role, pms) | ||
| 46 | end) | 47 | end) |
| 47 | end | 48 | end |
| 48 | end | 49 | end |
| 50 | + | ||
| 51 | + role:log("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender}) | ||
| 52 | + | ||
| 49 | return isBan and "解封杀成功" or "封杀成功" | 53 | return isBan and "解封杀成功" or "封杀成功" |
| 50 | end | 54 | end |
| 51 | 55 | ||
| 52 | function _M.unban(role, pms) | 56 | function _M.unban(role, pms) |
| 53 | role:setBan(0, 0) | 57 | role:setBan(0, 0) |
| 58 | + | ||
| 59 | + role:log("gm_action", {desc = "unban", key1 = pms.sender}) | ||
| 60 | + | ||
| 54 | return "解封杀成功" | 61 | return "解封杀成功" |
| 55 | end | 62 | end |
| 56 | 63 | ||
| @@ -63,6 +70,7 @@ function _M.gmmsg(role, pms) | @@ -63,6 +70,7 @@ function _M.gmmsg(role, pms) | ||
| 63 | skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd) | 70 | skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd) |
| 64 | end) | 71 | end) |
| 65 | end | 72 | end |
| 73 | + role:log("gm_action", {desc = "gmmsg", text1 = pms.pm1, key1 = pms.sender}) | ||
| 66 | 74 | ||
| 67 | return "指令成功" | 75 | return "指令成功" |
| 68 | end | 76 | end |
| @@ -74,6 +82,8 @@ function _M.silent(role, pms) | @@ -74,6 +82,8 @@ function _M.silent(role, pms) | ||
| 74 | return "解禁言成功" | 82 | return "解禁言成功" |
| 75 | end | 83 | end |
| 76 | role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400}) | 84 | role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400}) |
| 85 | + | ||
| 86 | + role:log("gm_action", {desc = "silent", int1 = pms.pm1, key1 = pms.sender}) | ||
| 77 | return "禁言成功" | 87 | return "禁言成功" |
| 78 | end | 88 | end |
| 79 | 89 | ||
| @@ -83,9 +93,11 @@ local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}} | @@ -83,9 +93,11 @@ local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}} | ||
| 83 | table.insert(helpDes, {"获得角色" , "hero", "角色类型"}) | 93 | table.insert(helpDes, {"获得角色" , "hero", "角色类型"}) |
| 84 | function _M.hero(role, pms) | 94 | function _M.hero(role, pms) |
| 85 | local heroType = tonum(pms.pm1) | 95 | local heroType = tonum(pms.pm1) |
| 86 | - if not role:addHero({type = heroType}) then | 96 | + if not role:addHero({type = heroType, log = {desc = "gm"}}) then |
| 87 | return "失败" | 97 | return "失败" |
| 88 | end | 98 | end |
| 99 | + | ||
| 100 | + role:log("gm_action", {desc = "hero", int1 = heroType, key1 = pms.sender}) | ||
| 89 | return "成功" | 101 | return "成功" |
| 90 | end | 102 | end |
| 91 | 103 | ||
| @@ -117,6 +129,9 @@ function _M.herol(role, pms) | @@ -117,6 +129,9 @@ function _M.herol(role, pms) | ||
| 117 | addLevel = math.min(hero:getMaxLevel() - hero:getProperty("level"), addLevel) | 129 | addLevel = math.min(hero:getMaxLevel() - hero:getProperty("level"), addLevel) |
| 118 | hero:updateProperty({field = "level", delta = addLevel}) | 130 | hero:updateProperty({field = "level", delta = addLevel}) |
| 119 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) | 131 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) |
| 132 | + | ||
| 133 | + role:log("gm_action", {desc = "herol", int1 = heroType, int2 = addLevel, key1 = pms.sender}) | ||
| 134 | + | ||
| 120 | return "成功" | 135 | return "成功" |
| 121 | end | 136 | end |
| 122 | 137 | ||
| @@ -127,6 +142,9 @@ function _M.herola(role, pms) | @@ -127,6 +142,9 @@ function _M.herola(role, pms) | ||
| 127 | for _, hero in pairs(role.heros) do | 142 | for _, hero in pairs(role.heros) do |
| 128 | _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel}) | 143 | _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel}) |
| 129 | end | 144 | end |
| 145 | + | ||
| 146 | + role:log("gm_action", {desc = "herola", int1 = addLevel, key1 = pms.sender}) | ||
| 147 | + | ||
| 130 | return "成功" | 148 | return "成功" |
| 131 | end | 149 | end |
| 132 | 150 | ||
| @@ -136,7 +154,8 @@ function _M.equip(role, pms) | @@ -136,7 +154,8 @@ function _M.equip(role, pms) | ||
| 136 | local typ = tonum(pms.pm1) | 154 | local typ = tonum(pms.pm1) |
| 137 | local level = tonum(pms.pm2) | 155 | local level = tonum(pms.pm2) |
| 138 | local count = tonum(pms.pm3) | 156 | local count = tonum(pms.pm3) |
| 139 | - role:addEquip({type = typ,level = level,count = count}) | 157 | + role:addEquip(typ, level, count, {log = {desc = "gm"}}) |
| 158 | + role:log("gm_action", {desc = "equip", int1 = typ, int2 = level, long1 = count, key1 = pms.sender}) | ||
| 140 | return "成功" | 159 | return "成功" |
| 141 | end | 160 | end |
| 142 | 161 | ||
| @@ -144,7 +163,9 @@ table.insert(helpDes, {"获得零件" , "rune", "零件类型", "零件id"}) | @@ -144,7 +163,9 @@ table.insert(helpDes, {"获得零件" , "rune", "零件类型", "零件id"}) | ||
| 144 | function _M.rune(role, pms) | 163 | function _M.rune(role, pms) |
| 145 | local typ = tonum(pms.pm1) | 164 | local typ = tonum(pms.pm1) |
| 146 | local id = tonum(pms.pm2) | 165 | local id = tonum(pms.pm2) |
| 147 | - local result = role:addRune({type = typ,id = id}) | 166 | + local result = role:addRune({type = typ,id = id, log = {desc = "gm"}}) |
| 167 | + role:log("gm_action", {desc = "rune", int1 = typ, int2 = id, key1 = pms.sender}) | ||
| 168 | + | ||
| 148 | return result | 169 | return result |
| 149 | end | 170 | end |
| 150 | 171 | ||
| @@ -165,6 +186,9 @@ function _M.fb(role, pms) -- 直接通关 | @@ -165,6 +186,9 @@ function _M.fb(role, pms) -- 直接通关 | ||
| 165 | passCarbon[carbonId] = 1 | 186 | passCarbon[carbonId] = 1 |
| 166 | addPre(carbonId) | 187 | addPre(carbonId) |
| 167 | role:updateProperty({field = "hangPass", value = passCarbon}) | 188 | role:updateProperty({field = "hangPass", value = passCarbon}) |
| 189 | + | ||
| 190 | + role:log("gm_action", {desc = "fb", int1 = carbonId, key1 = pms.sender}) | ||
| 191 | + | ||
| 168 | role:checkTaskEnter("HangPass", {id = carbonId}) | 192 | role:checkTaskEnter("HangPass", {id = carbonId}) |
| 169 | return "成功" | 193 | return "成功" |
| 170 | end | 194 | end |
| @@ -187,6 +211,9 @@ function _M.fbc(role, pms) -- 直接通关 | @@ -187,6 +211,9 @@ function _M.fbc(role, pms) -- 直接通关 | ||
| 187 | role:updateProperty({field = "hangInfo", value = {}}) | 211 | role:updateProperty({field = "hangInfo", value = {}}) |
| 188 | role:updateProperty({field = "hangPass", value = passCarbon}) | 212 | role:updateProperty({field = "hangPass", value = passCarbon}) |
| 189 | role:checkTaskEnter("HangPass", {id = carbonId}) | 213 | role:checkTaskEnter("HangPass", {id = carbonId}) |
| 214 | + | ||
| 215 | + role:log("gm_action", {desc = "fbc", int1 = carbonId, key1 = pms.sender}) | ||
| 216 | + | ||
| 190 | return "成功" | 217 | return "成功" |
| 191 | end | 218 | end |
| 192 | 219 | ||
| @@ -217,7 +244,10 @@ table.insert(helpDes, {"玩家经验", "exp", "经验"}) | @@ -217,7 +244,10 @@ table.insert(helpDes, {"玩家经验", "exp", "经验"}) | ||
| 217 | function _M.exp(role, pms) | 244 | function _M.exp(role, pms) |
| 218 | local exp = tonum(pms.pm1) | 245 | local exp = tonum(pms.pm1) |
| 219 | exp = math.floor(math.max(exp, 0)) | 246 | exp = math.floor(math.max(exp, 0)) |
| 220 | - role:addPlayExp(exp) | 247 | + role:addPlayExp(exp, {log = {desc = "gm"}}) |
| 248 | + | ||
| 249 | + role:log("gm_action", {desc = "exp", int1 = exp, key1 = pms.sender}) | ||
| 250 | + | ||
| 221 | return "成功" | 251 | return "成功" |
| 222 | end | 252 | end |
| 223 | 253 | ||
| @@ -236,35 +266,35 @@ function _M.get(role, pms) | @@ -236,35 +266,35 @@ function _M.get(role, pms) | ||
| 236 | reward[id] = data.number | 266 | reward[id] = data.number |
| 237 | end | 267 | end |
| 238 | end | 268 | end |
| 239 | - role:award(reward) | 269 | + role:award(reward, {log = {desc = "gm"}}) |
| 240 | elseif pms.pm1 == "EQUIP" then | 270 | elseif pms.pm1 == "EQUIP" then |
| 241 | for itemId = 7000 , 8000 do | 271 | for itemId = 7000 , 8000 do |
| 242 | if csvdb["itemCsv"][itemId] then | 272 | if csvdb["itemCsv"][itemId] then |
| 243 | - role:award({[itemId] = 100}) | 273 | + role:award({[itemId] = 100}, {log = {desc = "gm"}}) |
| 244 | end | 274 | end |
| 245 | end | 275 | end |
| 246 | elseif pms.pm1 == "RUNE" then | 276 | elseif pms.pm1 == "RUNE" then |
| 247 | for itemId = 2000 , 3000 do | 277 | for itemId = 2000 , 3000 do |
| 248 | if csvdb["itemCsv"][itemId] then | 278 | if csvdb["itemCsv"][itemId] then |
| 249 | - role:award({[itemId] = 1}) | 279 | + role:award({[itemId] = 1}, {log = {desc = "gm"}}) |
| 250 | end | 280 | end |
| 251 | end | 281 | end |
| 252 | elseif pms.pm1 == "FRAG" then | 282 | elseif pms.pm1 == "FRAG" then |
| 253 | for itemId = 100 , 400 do | 283 | for itemId = 100 , 400 do |
| 254 | if csvdb["itemCsv"][itemId] then | 284 | if csvdb["itemCsv"][itemId] then |
| 255 | - role:award({[itemId] = 100}) | 285 | + role:award({[itemId] = 100}, {log = {desc = "gm"}}) |
| 256 | end | 286 | end |
| 257 | end | 287 | end |
| 258 | elseif pms.pm1 == "FOOD" then | 288 | elseif pms.pm1 == "FOOD" then |
| 259 | for itemId = 4000 , 5000 do | 289 | for itemId = 4000 , 5000 do |
| 260 | if csvdb["itemCsv"][itemId] then | 290 | if csvdb["itemCsv"][itemId] then |
| 261 | - role:award({[itemId] = 100}) | 291 | + role:award({[itemId] = 100}, {log = {desc = "gm"}}) |
| 262 | end | 292 | end |
| 263 | end | 293 | end |
| 264 | elseif pms.pm1 == "HERO" then | 294 | elseif pms.pm1 == "HERO" then |
| 265 | for itemId = 400 , 700 do | 295 | for itemId = 400 , 700 do |
| 266 | if csvdb["itemCsv"][itemId] then | 296 | if csvdb["itemCsv"][itemId] then |
| 267 | - role:award({[itemId] = 1}) | 297 | + role:award({[itemId] = 1}, {log = {desc = "gm"}}) |
| 268 | end | 298 | end |
| 269 | end | 299 | end |
| 270 | else | 300 | else |
| @@ -273,7 +303,8 @@ function _M.get(role, pms) | @@ -273,7 +303,8 @@ function _M.get(role, pms) | ||
| 273 | return "物品不存在" | 303 | return "物品不存在" |
| 274 | end | 304 | end |
| 275 | local count = tonum(pms.pm2, 1) | 305 | local count = tonum(pms.pm2, 1) |
| 276 | - role:award({[itemId] = count}) | 306 | + role:award({[itemId] = count}, {log = {desc = "gm"}}) |
| 307 | + role:log("gm_action", {desc = "get", int1 = itemId, int2 = count, key1 = pms.sender}) | ||
| 277 | end | 308 | end |
| 278 | return "成功" | 309 | return "成功" |
| 279 | end | 310 | end |
| @@ -287,7 +318,7 @@ function _M.advc(role, pms) | @@ -287,7 +318,7 @@ function _M.advc(role, pms) | ||
| 287 | for itemId, count in pairs(reward) do | 318 | for itemId, count in pairs(reward) do |
| 288 | reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 | 319 | reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 |
| 289 | end | 320 | end |
| 290 | - role:award(reward) | 321 | + role:award(reward, {log = {desc = "gm"}}) |
| 291 | 322 | ||
| 292 | role:updateProperties({ | 323 | role:updateProperties({ |
| 293 | advInfo = {}, | 324 | advInfo = {}, |
| @@ -297,6 +328,9 @@ function _M.advc(role, pms) | @@ -297,6 +328,9 @@ function _M.advc(role, pms) | ||
| 297 | advAFWear = {}, | 328 | advAFWear = {}, |
| 298 | }, notNotify) | 329 | }, notNotify) |
| 299 | role.advData = nil | 330 | role.advData = nil |
| 331 | + | ||
| 332 | + role:log("gm_action", {desc = "advc", key1 = pms.sender}) | ||
| 333 | + | ||
| 300 | return "成功" | 334 | return "成功" |
| 301 | end | 335 | end |
| 302 | 336 | ||
| @@ -304,6 +338,9 @@ table.insert(helpDes, {"冒险次数恢复", "advf"}) | @@ -304,6 +338,9 @@ table.insert(helpDes, {"冒险次数恢复", "advf"}) | ||
| 304 | function _M.advf(role, pms) | 338 | function _M.advf(role, pms) |
| 305 | role.dailyData:updateProperty({field = "advC", value = 0}) | 339 | role.dailyData:updateProperty({field = "advC", value = 0}) |
| 306 | role.dailyData:updateProperty({field = "advElC", value = 0}) | 340 | role.dailyData:updateProperty({field = "advElC", value = 0}) |
| 341 | + | ||
| 342 | + role:log("gm_action", {desc = "advf", key1 = pms.sender}) | ||
| 343 | + | ||
| 307 | return "成功" | 344 | return "成功" |
| 308 | end | 345 | end |
| 309 | 346 | ||
| @@ -331,6 +368,7 @@ function _M.adv(role, pms) | @@ -331,6 +368,7 @@ function _M.adv(role, pms) | ||
| 331 | addPre(chapterId) | 368 | addPre(chapterId) |
| 332 | role:updateProperty({field = "advPass", value = advPass}) | 369 | role:updateProperty({field = "advPass", value = advPass}) |
| 333 | end | 370 | end |
| 371 | + role:log("gm_action", {desc = "advf", int1 = chapterId, int2 = layer, key1 = pms.sender}) | ||
| 334 | 372 | ||
| 335 | return "成功" | 373 | return "成功" |
| 336 | end | 374 | end |
| @@ -355,6 +393,7 @@ function _M.advt(role, pms) | @@ -355,6 +393,7 @@ function _M.advt(role, pms) | ||
| 355 | advData.level = layer | 393 | advData.level = layer |
| 356 | 394 | ||
| 357 | advData:saveDB() | 395 | advData:saveDB() |
| 396 | + role:log("gm_action", {desc = "advt", int1 = chapterId, int2 = layer, key1 = pms.sender}) | ||
| 358 | 397 | ||
| 359 | return "成功" | 398 | return "成功" |
| 360 | end | 399 | end |
| @@ -363,6 +402,9 @@ table.insert(helpDes, {"冒险队等级增加", "advl", "经验"}) | @@ -363,6 +402,9 @@ table.insert(helpDes, {"冒险队等级增加", "advl", "经验"}) | ||
| 363 | function _M.advl(role, pms) | 402 | function _M.advl(role, pms) |
| 364 | local exp = tonum(pms.pm1) | 403 | local exp = tonum(pms.pm1) |
| 365 | role:addAdvLvExp(math.max(0, exp)) | 404 | role:addAdvLvExp(math.max(0, exp)) |
| 405 | + | ||
| 406 | + role:log("gm_action", {desc = "advl", int1 = exp, key1 = pms.sender}) | ||
| 407 | + | ||
| 366 | return "成功" | 408 | return "成功" |
| 367 | end | 409 | end |
| 368 | 410 | ||
| @@ -376,7 +418,8 @@ function _M.advcl(role, pms) | @@ -376,7 +418,8 @@ function _M.advcl(role, pms) | ||
| 376 | end | 418 | end |
| 377 | advData.battle.player:addExp(exp) | 419 | advData.battle.player:addExp(exp) |
| 378 | advData:saveDB() | 420 | advData:saveDB() |
| 379 | - | 421 | + role:log("gm_action", {desc = "advcl", int1 = exp, key1 = pms.sender}) |
| 422 | + | ||
| 380 | return "成功" | 423 | return "成功" |
| 381 | end | 424 | end |
| 382 | 425 | ||
| @@ -385,6 +428,8 @@ function _M.idlec(role, pms) | @@ -385,6 +428,8 @@ function _M.idlec(role, pms) | ||
| 385 | role:updateProperty({field = "hangTeam", value = {}}) | 428 | role:updateProperty({field = "hangTeam", value = {}}) |
| 386 | role:updateProperty({field = "hangInfo", value = {}}) | 429 | role:updateProperty({field = "hangInfo", value = {}}) |
| 387 | role:updateProperty({field = "hangBag", value = {}}) | 430 | role:updateProperty({field = "hangBag", value = {}}) |
| 431 | + role:log("gm_action", {desc = "idlec", key1 = pms.sender}) | ||
| 432 | + | ||
| 388 | role.advData = nil | 433 | role.advData = nil |
| 389 | return "成功" | 434 | return "成功" |
| 390 | end | 435 | end |
| @@ -408,11 +453,13 @@ function _M.advit(role, pms) | @@ -408,11 +453,13 @@ function _M.advit(role, pms) | ||
| 408 | local itemId = tonum(pms.pm1) | 453 | local itemId = tonum(pms.pm1) |
| 409 | local count = tonum(pms.pm2) | 454 | local count = tonum(pms.pm2) |
| 410 | reward[itemId] = count | 455 | reward[itemId] = count |
| 456 | + | ||
| 457 | + role:log("gm_action", {desc = "advit", int1 = itemId, int2 = count, key1 = pms.sender}) | ||
| 411 | end | 458 | end |
| 412 | 459 | ||
| 413 | 460 | ||
| 414 | local adv = role:getAdvData() | 461 | local adv = role:getAdvData() |
| 415 | - adv:award(reward) | 462 | + adv:award(reward, {log = {desc = "gm"}}) |
| 416 | return "成功" | 463 | return "成功" |
| 417 | end | 464 | end |
| 418 | 465 | ||
| @@ -422,6 +469,9 @@ function _M.tower(role, pms) | @@ -422,6 +469,9 @@ function _M.tower(role, pms) | ||
| 422 | local level = tonum(pms.pm1, 1) | 469 | local level = tonum(pms.pm1, 1) |
| 423 | if not csvdb["tower_battleCsv"][level] then return "不存在" end | 470 | if not csvdb["tower_battleCsv"][level] then return "不存在" end |
| 424 | role:updateProperty({field = "towerInfo", value = {c = globalCsv.tower_count_limit, l = level}}) | 471 | role:updateProperty({field = "towerInfo", value = {c = globalCsv.tower_count_limit, l = level}}) |
| 472 | + | ||
| 473 | + role:log("gm_action", {desc = "tower", int1 = level, key1 = pms.sender}) | ||
| 474 | + | ||
| 425 | return "成功" | 475 | return "成功" |
| 426 | end | 476 | end |
| 427 | 477 | ||
| @@ -439,6 +489,9 @@ function _M.email(role, pms) | @@ -439,6 +489,9 @@ function _M.email(role, pms) | ||
| 439 | attachments = id == 0 and reward or nil, | 489 | attachments = id == 0 and reward or nil, |
| 440 | rewardPms = id ~= 0 and reward or nil, | 490 | rewardPms = id ~= 0 and reward or nil, |
| 441 | }) | 491 | }) |
| 492 | + | ||
| 493 | + role:log("gm_action", {desc = "email", int1 = id, key1 = pms.sender}) | ||
| 494 | + | ||
| 442 | return "成功" | 495 | return "成功" |
| 443 | end | 496 | end |
| 444 | 497 | ||
| @@ -455,6 +508,8 @@ function _M.cguide(role, pms) | @@ -455,6 +508,8 @@ function _M.cguide(role, pms) | ||
| 455 | elseif id == 2 then | 508 | elseif id == 2 then |
| 456 | role:updateProperty({field = "funcGuide", value = ""}) | 509 | role:updateProperty({field = "funcGuide", value = ""}) |
| 457 | end | 510 | end |
| 511 | + | ||
| 512 | + role:log("gm_action", {desc = "cguide", int1 = id, key1 = pms.sender}) | ||
| 458 | return "成功" | 513 | return "成功" |
| 459 | end | 514 | end |
| 460 | 515 |
src/actions/HangAction.lua
| @@ -102,6 +102,8 @@ function _M.startRpc( agent, data ) | @@ -102,6 +102,8 @@ function _M.startRpc( agent, data ) | ||
| 102 | end | 102 | end |
| 103 | role:updateProperty({field = "hangInfo", value = hangInfo}) | 103 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
| 104 | 104 | ||
| 105 | + role:log("hang_action", {desc = "startHang", int1 = carbonId}) | ||
| 106 | + | ||
| 105 | SendPacket(actionCodes.Hang_startRpc, '') | 107 | SendPacket(actionCodes.Hang_startRpc, '') |
| 106 | return true | 108 | return true |
| 107 | end | 109 | end |
| @@ -184,12 +186,15 @@ function _M.endBattleRpc(agent, data) | @@ -184,12 +186,15 @@ function _M.endBattleRpc(agent, data) | ||
| 184 | for itemId, count in pairs(carbonData.item_clear:toNumMap()) do | 186 | for itemId, count in pairs(carbonData.item_clear:toNumMap()) do |
| 185 | reward[itemId] = count | 187 | reward[itemId] = count |
| 186 | end | 188 | end |
| 187 | - reward = role:award(reward) | 189 | + reward = role:award(reward, {log = {desc = "hangBattle", int1 = carbonId}}) |
| 188 | 190 | ||
| 189 | role:checkTaskEnter("HangPass", {id = carbonId}) | 191 | role:checkTaskEnter("HangPass", {id = carbonId}) |
| 190 | end | 192 | end |
| 191 | hangInfo.key = nil | 193 | hangInfo.key = nil |
| 192 | role:updateProperty({field = "hangInfo", value = hangInfo}) | 194 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
| 195 | + | ||
| 196 | + role:log("hang_action", {desc = "hangBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = carbonId}) | ||
| 197 | + | ||
| 193 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ | 198 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ |
| 194 | starNum = msg.starNum, | 199 | starNum = msg.starNum, |
| 195 | reward = reward, | 200 | reward = reward, |
| @@ -232,7 +237,7 @@ function _M.getRewardRpc(agent , data) | @@ -232,7 +237,7 @@ function _M.getRewardRpc(agent , data) | ||
| 232 | checkReward(role) | 237 | checkReward(role) |
| 233 | local items = role:getProperty("hangBag") | 238 | local items = role:getProperty("hangBag") |
| 234 | if not next(items) then return end | 239 | if not next(items) then return end |
| 235 | - local reward = role:award(items) | 240 | + local reward = role:award(items, {log = {desc = "hangReward"}}) |
| 236 | table.clear(items) | 241 | table.clear(items) |
| 237 | local hangInfo = role:getProperty("hangInfo") | 242 | local hangInfo = role:getProperty("hangInfo") |
| 238 | local nowTime = skynet.timex() | 243 | local nowTime = skynet.timex() |
| @@ -323,7 +328,7 @@ function _M.quickRpc(agent , data) | @@ -323,7 +328,7 @@ function _M.quickRpc(agent , data) | ||
| 323 | if not costs[curCount] then return end | 328 | if not costs[curCount] then return end |
| 324 | if costs[curCount] > 0 then | 329 | if costs[curCount] > 0 then |
| 325 | if not role:checkItemEnough({[ItemId.Diamond] = costs[curCount]}) then return end | 330 | if not role:checkItemEnough({[ItemId.Diamond] = costs[curCount]}) then return end |
| 326 | - role:costItems({[ItemId.Diamond] = costs[curCount]}) | 331 | + role:costItems({[ItemId.Diamond] = costs[curCount]}, {log = {desc = "quickHang", int1 = hangInfo.carbonId}}) |
| 327 | end | 332 | end |
| 328 | 333 | ||
| 329 | role.dailyData:updateProperty({field = "hangQC", value = curCount}) | 334 | role.dailyData:updateProperty({field = "hangQC", value = curCount}) |
| @@ -345,7 +350,7 @@ function _M.quickRpc(agent , data) | @@ -345,7 +350,7 @@ function _M.quickRpc(agent , data) | ||
| 345 | reward[cur[1]] = (reward[cur[1]] or 0) + cur[2] | 350 | reward[cur[1]] = (reward[cur[1]] or 0) + cur[2] |
| 346 | end | 351 | end |
| 347 | 352 | ||
| 348 | - reward = role:award(reward) | 353 | + reward = role:award(reward, {log = {desc = "quickHang", int1 = hangInfo.carbonId}}) |
| 349 | if reward[ItemId.Gold] then | 354 | if reward[ItemId.Gold] then |
| 350 | role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) | 355 | role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) |
| 351 | end | 356 | end |
| @@ -393,16 +398,16 @@ function _M.buyBonusCountRpc(agent, data) | @@ -393,16 +398,16 @@ function _M.buyBonusCountRpc(agent, data) | ||
| 393 | local count = msg.count | 398 | local count = msg.count |
| 394 | local btype = msg.type | 399 | local btype = msg.type |
| 395 | 400 | ||
| 396 | - if math.illegalNum(btype, 1, 2) then return 0 end | 401 | + if not TimeReset["DailyBattle" .. btype] then return end |
| 397 | 402 | ||
| 398 | local bonusC = role.dailyData:getProperty("bonusC") | 403 | local bonusC = role.dailyData:getProperty("bonusC") |
| 399 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} | 404 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} |
| 400 | local lastCount = globalCsv.bonus_daily_buy_count - bonusC[btype]["b"] | 405 | local lastCount = globalCsv.bonus_daily_buy_count - bonusC[btype]["b"] |
| 401 | if math.illegalNum(count, 1, lastCount) then return 1 end | 406 | if math.illegalNum(count, 1, lastCount) then return 1 end |
| 402 | 407 | ||
| 403 | - if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return end | 408 | + if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return 2 end |
| 404 | 409 | ||
| 405 | - role:costItems({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) | 410 | + role:costItems({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}, {log = {desc = "buyBonusCount", short1 = btype, int1 = count}}) |
| 406 | bonusC[btype]["b"] = bonusC[btype]["b"] + count | 411 | bonusC[btype]["b"] = bonusC[btype]["b"] + count |
| 407 | bonusC[btype]["c"] = bonusC[btype]["c"] - count | 412 | bonusC[btype]["c"] = bonusC[btype]["c"] - count |
| 408 | 413 | ||
| @@ -457,10 +462,12 @@ function _M.endBonusBattleRpc(agent, data) | @@ -457,10 +462,12 @@ function _M.endBonusBattleRpc(agent, data) | ||
| 457 | 462 | ||
| 458 | local reward | 463 | local reward |
| 459 | if starNum and starNum > 0 then | 464 | if starNum and starNum > 0 then |
| 460 | - reward = role:award(bonusData.reward) | 465 | + reward = role:award(bonusData.reward, {log = {desc = "bonusBattle", int1 = id}}) |
| 461 | role:checkTaskEnter("BonusPass", {id = id}) | 466 | role:checkTaskEnter("BonusPass", {id = id}) |
| 462 | end | 467 | end |
| 463 | 468 | ||
| 469 | + role:log("hang_action", {desc = "bonusBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id}) | ||
| 470 | + | ||
| 464 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ | 471 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ |
| 465 | starNum = starNum, | 472 | starNum = starNum, |
| 466 | reward = reward})) | 473 | reward = reward})) |
src/actions/HeroAction.lua
| @@ -27,9 +27,11 @@ function _M.levelUpRpc( agent, data ) | @@ -27,9 +27,11 @@ function _M.levelUpRpc( agent, data ) | ||
| 27 | local curData = csvdb["unit_expCsv"][hero:getProperty("level")] | 27 | local curData = csvdb["unit_expCsv"][hero:getProperty("level")] |
| 28 | local cost = {[ItemId.Exp] = curData.exp, [ItemId.Gold] = curData.gold} | 28 | local cost = {[ItemId.Exp] = curData.exp, [ItemId.Gold] = curData.gold} |
| 29 | if not role:checkItemEnough(cost) then return 3 end | 29 | if not role:checkItemEnough(cost) then return 3 end |
| 30 | - role:costItems(cost) | 30 | + role:costItems(cost, {log = {desc = "heroLevelUp", int1 = msg.id, int2 = hero:getProperty("type")}}) |
| 31 | hero:updateProperty({field = "level", delta = 1}) | 31 | hero:updateProperty({field = "level", delta = 1}) |
| 32 | 32 | ||
| 33 | + hero:log({desc = "levelUp", int1 = hero:getProperty("level")}) | ||
| 34 | + | ||
| 33 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) | 35 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) |
| 34 | SendPacket(actionCodes.Hero_levelUpRpc, '') | 36 | SendPacket(actionCodes.Hero_levelUpRpc, '') |
| 35 | return true | 37 | return true |
| @@ -46,9 +48,11 @@ function _M.breakRpc( agent, data ) | @@ -46,9 +48,11 @@ function _M.breakRpc( agent, data ) | ||
| 46 | local curData = csvdb["unit_breakCsv"][hero:getProperty("breakL")] | 48 | local curData = csvdb["unit_breakCsv"][hero:getProperty("breakL")] |
| 47 | local cost = {[ItemId.BreakCost] = curData.cost, [ItemId.Gold] = curData.gold} | 49 | local cost = {[ItemId.BreakCost] = curData.cost, [ItemId.Gold] = curData.gold} |
| 48 | if not role:checkItemEnough(cost) then return 4 end | 50 | if not role:checkItemEnough(cost) then return 4 end |
| 49 | - role:costItems(cost) | 51 | + role:costItems(cost, {log = {desc = "heroBreak", int1 = msg.id, int2 = hero:getProperty("type")}}) |
| 50 | hero:updateProperty({field = "breakL", delta = 1}) | 52 | hero:updateProperty({field = "breakL", delta = 1}) |
| 51 | 53 | ||
| 54 | + hero:log({desc = "break", int1 = hero:getProperty("breakL")}) | ||
| 55 | + | ||
| 52 | SendPacket(actionCodes.Hero_breakRpc, '') | 56 | SendPacket(actionCodes.Hero_breakRpc, '') |
| 53 | return true | 57 | return true |
| 54 | end | 58 | end |
| @@ -82,7 +86,7 @@ function _M.wakeRpc(agent, data) | @@ -82,7 +86,7 @@ function _M.wakeRpc(agent, data) | ||
| 82 | end | 86 | end |
| 83 | end | 87 | end |
| 84 | 88 | ||
| 85 | - role:costItems(cost) | 89 | + role:costItems(cost, {log = {desc = "heroWake", int1 = msg.id, int2 = hero:getProperty("type")}}) |
| 86 | for k,v in pairs(skills) do | 90 | for k,v in pairs(skills) do |
| 87 | hero:updateProperty({field = "skillL", value = hero:getProperty("skillL"):setv(k, v)}) | 91 | hero:updateProperty({field = "skillL", value = hero:getProperty("skillL"):setv(k, v)}) |
| 88 | end | 92 | end |
| @@ -93,6 +97,8 @@ function _M.wakeRpc(agent, data) | @@ -93,6 +97,8 @@ function _M.wakeRpc(agent, data) | ||
| 93 | if curLevel == 4 then -- 解锁cg | 97 | if curLevel == 4 then -- 解锁cg |
| 94 | role:checkTaskEnter("WakeCG", {heroType = typ}) | 98 | role:checkTaskEnter("WakeCG", {heroType = typ}) |
| 95 | end | 99 | end |
| 100 | + hero:log({desc = "wake", int1 = hero:getProperty("wakeL")}) | ||
| 101 | + | ||
| 96 | 102 | ||
| 97 | SendPacket(actionCodes.Hero_wakeRpc, '') | 103 | SendPacket(actionCodes.Hero_wakeRpc, '') |
| 98 | return true | 104 | return true |
| @@ -109,6 +115,8 @@ function _M.skillUpRpc(agent, data) | @@ -109,6 +115,8 @@ function _M.skillUpRpc(agent, data) | ||
| 109 | if hero:getLSPoint() <= 0 or curLevel >= #hero:getSkillData(index) then return end | 115 | if hero:getLSPoint() <= 0 or curLevel >= #hero:getSkillData(index) then return end |
| 110 | hero:updateProperty({field = "skillL", value = hero:getProperty("skillL"):setv(index, curLevel + 1)}) | 116 | hero:updateProperty({field = "skillL", value = hero:getProperty("skillL"):setv(index, curLevel + 1)}) |
| 111 | 117 | ||
| 118 | + hero:log({desc = "skillUp", int1 = index, int2 = curLevel + 1}) | ||
| 119 | + | ||
| 112 | SendPacket(actionCodes.Hero_skillUpRpc, '') | 120 | SendPacket(actionCodes.Hero_skillUpRpc, '') |
| 113 | return true | 121 | return true |
| 114 | end | 122 | end |
| @@ -141,7 +149,7 @@ function _M.talentRpc(agent, data) | @@ -141,7 +149,7 @@ function _M.talentRpc(agent, data) | ||
| 141 | cost[globalCsv.unit_talent_cost[csvdb["unitCsv"][hero:getProperty("type")].camp][k]] = v | 149 | cost[globalCsv.unit_talent_cost[csvdb["unitCsv"][hero:getProperty("type")].camp][k]] = v |
| 142 | end | 150 | end |
| 143 | if not role:checkItemEnough(cost) then return 6 end | 151 | if not role:checkItemEnough(cost) then return 6 end |
| 144 | - role:costItems(cost) | 152 | + role:costItems(cost, {log = {desc = "heroTalent", int1 = msg.id, int2 = hero:getProperty("type")}}) |
| 145 | talent = talent:incrv(index, 1) | 153 | talent = talent:incrv(index, 1) |
| 146 | 154 | ||
| 147 | --是否进阶 | 155 | --是否进阶 |
| @@ -167,6 +175,8 @@ function _M.talentRpc(agent, data) | @@ -167,6 +175,8 @@ function _M.talentRpc(agent, data) | ||
| 167 | 175 | ||
| 168 | role:checkTaskEnter("HeroTalent", {heroType = hero:getProperty("type"), alv = aheadLevel}) | 176 | role:checkTaskEnter("HeroTalent", {heroType = hero:getProperty("type"), alv = aheadLevel}) |
| 169 | 177 | ||
| 178 | + hero:log({desc = "talent", int1 = index, int2 = talent:getv(index, 0)}) | ||
| 179 | + | ||
| 170 | SendPacket(actionCodes.Hero_talentRpc, '') | 180 | SendPacket(actionCodes.Hero_talentRpc, '') |
| 171 | return true | 181 | return true |
| 172 | end | 182 | end |
| @@ -491,8 +501,8 @@ function _M.createHeroRpc(agent, data) | @@ -491,8 +501,8 @@ function _M.createHeroRpc(agent, data) | ||
| 491 | if hero:getProperty("type") == heroType then return end | 501 | if hero:getProperty("type") == heroType then return end |
| 492 | end | 502 | end |
| 493 | 503 | ||
| 494 | - role:costItems({[heroType] = cost}) | ||
| 495 | - role:award({[heroType + ItemStartId.Hero] = 1}) | 504 | + role:costItems({[heroType] = cost}, {log = {desc = "createHero"}}) |
| 505 | + role:award({[heroType + ItemStartId.Hero] = 1}, {log = {desc = "createHero"}}) | ||
| 496 | 506 | ||
| 497 | SendPacket(actionCodes.Hero_createHeroRpc, "") | 507 | SendPacket(actionCodes.Hero_createHeroRpc, "") |
| 498 | return true | 508 | return true |
| @@ -522,12 +532,12 @@ function _M.referEquipsRpc(agent, data) | @@ -522,12 +532,12 @@ function _M.referEquipsRpc(agent, data) | ||
| 522 | if equips[typ] == 0 then | 532 | if equips[typ] == 0 then |
| 523 | curEquip = curEquip:delk(typ) | 533 | curEquip = curEquip:delk(typ) |
| 524 | else | 534 | else |
| 525 | - role:addEquip(typ, equips[typ], -1) -- 穿上 | 535 | + role:addEquip(typ, equips[typ], -1, {log = {desc = "refer"}}) -- 穿上 |
| 526 | curEquip = curEquip:setv(typ, equips[typ]) | 536 | curEquip = curEquip:setv(typ, equips[typ]) |
| 527 | end | 537 | end |
| 528 | 538 | ||
| 529 | if cur ~= 0 then | 539 | if cur ~= 0 then |
| 530 | - role:addEquip(typ, cur, 1) -- 脱掉 | 540 | + role:addEquip(typ, cur, 1, {log = {desc = "refer"}}) -- 脱掉 |
| 531 | end | 541 | end |
| 532 | end | 542 | end |
| 533 | end | 543 | end |
| @@ -602,8 +612,8 @@ function _M.createHeroRandomRpc(agent, data) | @@ -602,8 +612,8 @@ function _M.createHeroRandomRpc(agent, data) | ||
| 602 | else | 612 | else |
| 603 | reward = {[temp[1] + ItemStartId.Hero] = 1} | 613 | reward = {[temp[1] + ItemStartId.Hero] = 1} |
| 604 | end | 614 | end |
| 605 | - role:costItems({[itemId] = cost}) | ||
| 606 | - reward = role:award(reward) | 615 | + role:costItems({[itemId] = cost}, {log = {desc = "createHeroRandom"}}) |
| 616 | + reward = role:award(reward, {log = {desc = "createHeroRandom"}}) | ||
| 607 | SendPacket(actionCodes.Hero_createHeroRandomRpc, MsgPack.pack({reward = reward})) | 617 | SendPacket(actionCodes.Hero_createHeroRandomRpc, MsgPack.pack({reward = reward})) |
| 608 | return true | 618 | return true |
| 609 | end | 619 | end |
| @@ -668,11 +678,12 @@ function _M.getResetRewardRpc(agent, data) | @@ -668,11 +678,12 @@ function _M.getResetRewardRpc(agent, data) | ||
| 668 | hero:updateProperty({field = "level", value = level}) | 678 | hero:updateProperty({field = "level", value = level}) |
| 669 | hero:updateProperty({field = "breakL", value = breakL}) | 679 | hero:updateProperty({field = "breakL", value = breakL}) |
| 670 | hero:updateProperty({field = "talent", value = ""}) | 680 | hero:updateProperty({field = "talent", value = ""}) |
| 681 | + hero:log({desc = "resetHero"}) | ||
| 671 | 682 | ||
| 672 | for itemId, count in pairs(reward) do | 683 | for itemId, count in pairs(reward) do |
| 673 | reward[itemId] = math.floor(count * globalCsv.unit_back_discount) | 684 | reward[itemId] = math.floor(count * globalCsv.unit_back_discount) |
| 674 | end | 685 | end |
| 675 | - reward = role:award(reward) | 686 | + reward = role:award(reward, {log = {desc = "resetHero", int1 = msg.id, int2 = hero:getProperty("type")}}) |
| 676 | 687 | ||
| 677 | SendPacket(actionCodes.Hero_getResetRewardRpc, MsgPack.pack({reward = reward})) | 688 | SendPacket(actionCodes.Hero_getResetRewardRpc, MsgPack.pack({reward = reward})) |
| 678 | return true | 689 | return true |
| @@ -784,7 +795,7 @@ function _M.drawHeroRpc(agent, data) | @@ -784,7 +795,7 @@ function _M.drawHeroRpc(agent, data) | ||
| 784 | end, | 795 | end, |
| 785 | } | 796 | } |
| 786 | 797 | ||
| 787 | - role:costItems(cost) | 798 | + role:costItems(cost, {log = {desc = "drawHero", short1 = pool}}) |
| 788 | local floorHeroCount = role:getProperty("floorHero")[pool] or 0 | 799 | local floorHeroCount = role:getProperty("floorHero")[pool] or 0 |
| 789 | 800 | ||
| 790 | local ssrCount = 0 | 801 | local ssrCount = 0 |
| @@ -823,10 +834,10 @@ function _M.drawHeroRpc(agent, data) | @@ -823,10 +834,10 @@ function _M.drawHeroRpc(agent, data) | ||
| 823 | local fragId = itemData.id - ItemStartId.Hero | 834 | local fragId = itemData.id - ItemStartId.Hero |
| 824 | local heroData = csvdb["unitCsv"][fragId] | 835 | local heroData = csvdb["unitCsv"][fragId] |
| 825 | local count = globalCsv.draw_unit_tofragment[heroData.rare] * temp[2] | 836 | local count = globalCsv.draw_unit_tofragment[heroData.rare] * temp[2] |
| 826 | - role:award({[fragId] = count}) | 837 | + role:award({[fragId] = count}, {log = {desc = "drawHero", short1 = pool}}) |
| 827 | table.insert(reward, {id = fragId, count = count, from = temp[1], fcount = temp[2]}) | 838 | table.insert(reward, {id = fragId, count = count, from = temp[1], fcount = temp[2]}) |
| 828 | else | 839 | else |
| 829 | - role:award({[temp[1]] = temp[2]}) | 840 | + role:award({[temp[1]] = temp[2]}, {log = {desc = "drawHero", short1 = pool}}) |
| 830 | table.insert(reward, {id = temp[1], count = temp[2]}) | 841 | table.insert(reward, {id = temp[1], count = temp[2]}) |
| 831 | end | 842 | end |
| 832 | end | 843 | end |
| @@ -847,7 +858,7 @@ function _M.drawHeroRpc(agent, data) | @@ -847,7 +858,7 @@ function _M.drawHeroRpc(agent, data) | ||
| 847 | if ssrCount > 0 then | 858 | if ssrCount > 0 then |
| 848 | role:checkTaskEnter("DrawSSR", {count = ssrCount}) | 859 | role:checkTaskEnter("DrawSSR", {count = ssrCount}) |
| 849 | end | 860 | end |
| 850 | - | 861 | + role:log("hero_action", {desc = "drawHero", short1 = pool, int1 = drawCount[drawType]}) |
| 851 | SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 | 862 | SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 |
| 852 | return true | 863 | return true |
| 853 | end | 864 | end |
| @@ -869,13 +880,13 @@ function _M.repayHeroRpc(agent, data) | @@ -869,13 +880,13 @@ function _M.repayHeroRpc(agent, data) | ||
| 869 | local fragId = itemData.id - ItemStartId.Hero | 880 | local fragId = itemData.id - ItemStartId.Hero |
| 870 | local heroData = csvdb["unitCsv"][fragId] | 881 | local heroData = csvdb["unitCsv"][fragId] |
| 871 | local count = globalCsv.draw_unit_tofragment[heroData.rare] | 882 | local count = globalCsv.draw_unit_tofragment[heroData.rare] |
| 872 | - role:award({[fragId] = count}) | 883 | + role:award({[fragId] = count}, {log = {desc = "heroRepay"}}) |
| 873 | reward = {id = fragId, count = count, from = id, fcount = 1} | 884 | reward = {id = fragId, count = count, from = id, fcount = 1} |
| 874 | else | 885 | else |
| 875 | - role:award({[id] = 1}) | 886 | + role:award({[id] = 1}, {log = {desc = "heroRepay"}}) |
| 876 | reward = {id = id, count = 1} | 887 | reward = {id = id, count = 1} |
| 877 | end | 888 | end |
| 878 | - | 889 | + role:log("hero_action", {desc = "heroRepay"}) |
| 879 | SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward})) | 890 | SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward})) |
| 880 | return true | 891 | return true |
| 881 | end | 892 | end |
src/actions/HttpAction.lua
| @@ -179,7 +179,11 @@ function _M.gm_action(query) | @@ -179,7 +179,11 @@ function _M.gm_action(query) | ||
| 179 | return "角色不存在" | 179 | return "角色不存在" |
| 180 | end | 180 | end |
| 181 | role:loadAll() | 181 | role:loadAll() |
| 182 | - return gmFuncs[query.cmd](role, query) | 182 | + role:startActionUcode() |
| 183 | + local status = gmFuncs[query.cmd](role, query) | ||
| 184 | + role:endActionUcode() | ||
| 185 | + | ||
| 186 | + return status | ||
| 183 | end | 187 | end |
| 184 | 188 | ||
| 185 | function _M.broadcast(query) | 189 | function _M.broadcast(query) |
src/actions/PvpAction.lua
| @@ -235,8 +235,8 @@ function _M.buyCountRpc(agent, data) | @@ -235,8 +235,8 @@ function _M.buyCountRpc(agent, data) | ||
| 235 | 235 | ||
| 236 | local cost = {[ItemId.Diamond] = globalCsv.pvp_buy_cost * count} | 236 | local cost = {[ItemId.Diamond] = globalCsv.pvp_buy_cost * count} |
| 237 | if not role:checkItemEnough(cost) then return 2 end | 237 | if not role:checkItemEnough(cost) then return 2 end |
| 238 | - role:costItems(cost) | ||
| 239 | - role:award({[ItemId.PvpKey] = count}) | 238 | + role:costItems(cost, {log = {desc = "buyPvpKey"}}) |
| 239 | + role:award({[ItemId.PvpKey] = count}, {log = {desc = "buyPvpKey"}}) | ||
| 240 | 240 | ||
| 241 | SendPacket(actionCodes.Pvp_buyCountRpc, '') | 241 | SendPacket(actionCodes.Pvp_buyCountRpc, '') |
| 242 | return true | 242 | return true |
| @@ -287,7 +287,7 @@ function _M.startBattleRpc(agent, data) | @@ -287,7 +287,7 @@ function _M.startBattleRpc(agent, data) | ||
| 287 | if pvpFree >= globalCsv.pvp_battle_free_count then | 287 | if pvpFree >= globalCsv.pvp_battle_free_count then |
| 288 | local cost = {[ItemId.PvpKey] = 1} | 288 | local cost = {[ItemId.PvpKey] = 1} |
| 289 | if not role:checkItemEnough(cost) then return 5 end | 289 | if not role:checkItemEnough(cost) then return 5 end |
| 290 | - role:costItems(cost) | 290 | + role:costItems(cost, {log = {desc = "startPvp", short1 = 1}}) |
| 291 | else | 291 | else |
| 292 | role.dailyData:updateProperty({field = "pvpFree", delta = 1}) | 292 | role.dailyData:updateProperty({field = "pvpFree", delta = 1}) |
| 293 | end | 293 | end |
| @@ -296,6 +296,9 @@ function _M.startBattleRpc(agent, data) | @@ -296,6 +296,9 @@ function _M.startBattleRpc(agent, data) | ||
| 296 | _pvpStartBattleCacheC = {idx = idx, key = key, revenge = revenge} | 296 | _pvpStartBattleCacheC = {idx = idx, key = key, revenge = revenge} |
| 297 | 297 | ||
| 298 | role:checkTaskEnter("PvpBattle") | 298 | role:checkTaskEnter("PvpBattle") |
| 299 | + | ||
| 300 | + | ||
| 301 | + role:log("pvp_action", {desc = "startBattle", short1 = 1, int1 = revenge and 1 or 0}) | ||
| 299 | end | 302 | end |
| 300 | 303 | ||
| 301 | SendPacket(actionCodes.Pvp_startBattleRpc, MsgPack.pack({matchInfo = matchInfo, key = key, result = result, wait = wait})) | 304 | SendPacket(actionCodes.Pvp_startBattleRpc, MsgPack.pack({matchInfo = matchInfo, key = key, result = result, wait = wait})) |
| @@ -331,7 +334,7 @@ function _M.endBattleRpc(agent, data) | @@ -331,7 +334,7 @@ function _M.endBattleRpc(agent, data) | ||
| 331 | if not match then return end | 334 | if not match then return end |
| 332 | 335 | ||
| 333 | local temp = string.randWeight(csvdb["player_expCsv"][role:getProperty("level")].pvpBonus, true) | 336 | local temp = string.randWeight(csvdb["player_expCsv"][role:getProperty("level")].pvpBonus, true) |
| 334 | - local reward = role:award({[temp[1]] = temp[2]}) | 337 | + local reward = role:award({[temp[1]] = temp[2]}, {log = {desc = "pvpBattleC"}}) |
| 335 | local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreCommon(match.t == 1 and match.id or -1, isWin) | 338 | local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreCommon(match.t == 1 and match.id or -1, isWin) |
| 336 | 339 | ||
| 337 | _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 | 340 | _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 |
| @@ -384,6 +387,8 @@ function _M.endBattleRpc(agent, data) | @@ -384,6 +387,8 @@ function _M.endBattleRpc(agent, data) | ||
| 384 | if isWin then | 387 | if isWin then |
| 385 | role:checkTaskEnter("PvpWin", {score = myScore}) | 388 | role:checkTaskEnter("PvpWin", {score = myScore}) |
| 386 | end | 389 | end |
| 390 | + | ||
| 391 | + role:log("pvp_action", {desc = "battleEnd", short1 = 1, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0}) | ||
| 387 | 392 | ||
| 388 | SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({ | 393 | SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({ |
| 389 | reward = reward, | 394 | reward = reward, |
| @@ -483,7 +488,7 @@ function _M.startBattleHRpc(agent, data) | @@ -483,7 +488,7 @@ function _M.startBattleHRpc(agent, data) | ||
| 483 | if pvpFreeH >= globalCsv.pvp_battle_free_count_high then | 488 | if pvpFreeH >= globalCsv.pvp_battle_free_count_high then |
| 484 | local cost = {[ItemId.PvpKey] = globalCsv.pvp_battle_high_cost} | 489 | local cost = {[ItemId.PvpKey] = globalCsv.pvp_battle_high_cost} |
| 485 | if not role:checkItemEnough(cost) then return 5 end | 490 | if not role:checkItemEnough(cost) then return 5 end |
| 486 | - role:costItems(cost) | 491 | + role:costItems(cost, {log = {desc = "startPvp", short1 = 2}}) |
| 487 | else | 492 | else |
| 488 | role.dailyData:updateProperty({field = "pvpFreeH", delta = 1}) | 493 | role.dailyData:updateProperty({field = "pvpFreeH", delta = 1}) |
| 489 | end | 494 | end |
| @@ -508,6 +513,9 @@ function _M.startBattleHRpc(agent, data) | @@ -508,6 +513,9 @@ function _M.startBattleHRpc(agent, data) | ||
| 508 | } | 513 | } |
| 509 | 514 | ||
| 510 | role:checkTaskEnter("PvpBattle") | 515 | role:checkTaskEnter("PvpBattle") |
| 516 | + | ||
| 517 | + role:log("pvp_action", {desc = "startBattle", short1 = 2, int1 = revenge and 1 or 0}) | ||
| 518 | + | ||
| 511 | end | 519 | end |
| 512 | 520 | ||
| 513 | SendPacket(actionCodes.Pvp_startBattleHRpc, MsgPack.pack({ | 521 | SendPacket(actionCodes.Pvp_startBattleHRpc, MsgPack.pack({ |
| @@ -607,7 +615,7 @@ function _M.endBattleHRpc(agent, data) | @@ -607,7 +615,7 @@ function _M.endBattleHRpc(agent, data) | ||
| 607 | 615 | ||
| 608 | -- 战斗结束了发奖 | 616 | -- 战斗结束了发奖 |
| 609 | local temp = string.randWeight(csvdb["player_expCsv"][role:getProperty("level")].pvpgroupBonus, true) | 617 | local temp = string.randWeight(csvdb["player_expCsv"][role:getProperty("level")].pvpgroupBonus, true) |
| 610 | - local reward = role:award({[temp[1]] = temp[2]}) | 618 | + local reward = role:award({[temp[1]] = temp[2]}, {log = {desc = "pvpBattleH"}}) |
| 611 | local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = 0, 0, 0, 0, 0, 0 | 619 | local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = 0, 0, 0, 0, 0, 0 |
| 612 | if role:isTimeResetOpen(TimeReset.PvpHight) then | 620 | if role:isTimeResetOpen(TimeReset.PvpHight) then |
| 613 | myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreHigh(match.t == 1 and match.id or -1, isWin) | 621 | myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreHigh(match.t == 1 and match.id or -1, isWin) |
| @@ -675,6 +683,7 @@ function _M.endBattleHRpc(agent, data) | @@ -675,6 +683,7 @@ function _M.endBattleHRpc(agent, data) | ||
| 675 | if isWin then | 683 | if isWin then |
| 676 | role:checkTaskEnter("PvpWin", {score = myScore}) | 684 | role:checkTaskEnter("PvpWin", {score = myScore}) |
| 677 | end | 685 | end |
| 686 | + role:log("pvp_action", {desc = "battleEnd", short1 = 2, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0}) | ||
| 678 | 687 | ||
| 679 | SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ | 688 | SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ |
| 680 | reward = reward, | 689 | reward = reward, |
| @@ -829,7 +838,8 @@ function _M.highDivisionGiftRpc(agent, data) | @@ -829,7 +838,8 @@ function _M.highDivisionGiftRpc(agent, data) | ||
| 829 | pvpHGift = {}, | 838 | pvpHGift = {}, |
| 830 | }) | 839 | }) |
| 831 | 840 | ||
| 832 | - local reward = role:award(newReward) | 841 | + local reward = role:award(newReward, {log = {desc = "pvpDivisionH"}}) |
| 842 | + role:log("pvp_action", {desc = "pvpDivisionH"}) | ||
| 833 | 843 | ||
| 834 | SendPacket(actionCodes.Pvp_highDivisionGiftRpc, MsgPack.pack({reward = reward})) | 844 | SendPacket(actionCodes.Pvp_highDivisionGiftRpc, MsgPack.pack({reward = reward})) |
| 835 | return true | 845 | return true |
| @@ -853,7 +863,7 @@ function _M.shopBuyRpc(agent, data) | @@ -853,7 +863,7 @@ function _M.shopBuyRpc(agent, data) | ||
| 853 | 863 | ||
| 854 | if not role:checkItemEnough({[ItemId.PvpCoin] = csvData.cost * count}) then return end | 864 | if not role:checkItemEnough({[ItemId.PvpCoin] = csvData.cost * count}) then return end |
| 855 | 865 | ||
| 856 | - role:costItems({[ItemId.PvpCoin] = csvData.cost * count}) | 866 | + role:costItems({[ItemId.PvpCoin] = csvData.cost * count}, {log = {desc = "pvpShop", int1 = id, int2 = count}}) |
| 857 | if csvData.limit > 0 then | 867 | if csvData.limit > 0 then |
| 858 | role:changeUpdates({{type = "pvpShop", field = id, value = (pvpShop[id] or 0) + count}}) | 868 | role:changeUpdates({{type = "pvpShop", field = id, value = (pvpShop[id] or 0) + count}}) |
| 859 | end | 869 | end |
| @@ -862,8 +872,9 @@ function _M.shopBuyRpc(agent, data) | @@ -862,8 +872,9 @@ function _M.shopBuyRpc(agent, data) | ||
| 862 | for id, c in pairs(gift) do | 872 | for id, c in pairs(gift) do |
| 863 | gift[id] = c * count | 873 | gift[id] = c * count |
| 864 | end | 874 | end |
| 865 | - local reward = role:award(gift) | 875 | + local reward = role:award(gift, {log = {desc = "pvpShop", int1 = id, int2 = count}}) |
| 866 | 876 | ||
| 877 | + role:log("pvp_action", {desc = "pvpShop", int1 = id, int2 = count}) | ||
| 867 | 878 | ||
| 868 | SendPacket(actionCodes.Pvp_shopBuyRpc, MsgPack.pack({reward = reward})) | 879 | SendPacket(actionCodes.Pvp_shopBuyRpc, MsgPack.pack({reward = reward})) |
| 869 | return true | 880 | return true |
| @@ -953,9 +964,10 @@ function _M.crossBetRpc(agent, data) | @@ -953,9 +964,10 @@ function _M.crossBetRpc(agent, data) | ||
| 953 | if not role:isTimeResetOpen(TimeReset.PvpCross) then return end | 964 | if not role:isTimeResetOpen(TimeReset.PvpCross) then return end |
| 954 | if msg.idx ~= 1 and msg.idx ~= 2 then return end | 965 | if msg.idx ~= 1 and msg.idx ~= 2 then return end |
| 955 | 966 | ||
| 956 | - local result = role:getCrossServerPvpBet(msg.idx) | 967 | + local result = role:setCrossServerPvpBet(msg.idx) |
| 957 | if not result then return end | 968 | if not result then return end |
| 958 | - | 969 | + |
| 970 | + role:log("pvp_action", {desc = "crossBet"}) | ||
| 959 | SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result)) | 971 | SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result)) |
| 960 | return true | 972 | return true |
| 961 | end | 973 | end |
src/actions/RoleAction.lua
| @@ -94,6 +94,8 @@ function _M.loginRpc( agent, data ) | @@ -94,6 +94,8 @@ function _M.loginRpc( agent, data ) | ||
| 94 | role = require("models.Role").new({key = roleKey}) | 94 | role = require("models.Role").new({key = roleKey}) |
| 95 | role:load() | 95 | role:load() |
| 96 | role:loadAll() | 96 | role:loadAll() |
| 97 | + role:startActionUcode() | ||
| 98 | + role:setProperty("ltime", now) | ||
| 97 | else | 99 | else |
| 98 | role:reloadWhenLogin() | 100 | role:reloadWhenLogin() |
| 99 | end | 101 | end |
| @@ -120,7 +122,6 @@ function _M.loginRpc( agent, data ) | @@ -120,7 +122,6 @@ function _M.loginRpc( agent, data ) | ||
| 120 | 122 | ||
| 121 | -- 跨天登陆事件 | 123 | -- 跨天登陆事件 |
| 122 | role:updateTimeReset(now) | 124 | role:updateTimeReset(now) |
| 123 | - role:setProperty("ltime", now) | ||
| 124 | redisproxy:zadd(FRIEND_RECOMMEND, now, roleId) | 125 | redisproxy:zadd(FRIEND_RECOMMEND, now, roleId) |
| 125 | 126 | ||
| 126 | for _, name in ipairs({"dailyData", "dinerData"}) do | 127 | for _, name in ipairs({"dailyData", "dinerData"}) do |
| @@ -291,8 +292,8 @@ function _M.createRpc(agent, data) | @@ -291,8 +292,8 @@ function _M.createRpc(agent, data) | ||
| 291 | SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response)) | 292 | SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response)) |
| 292 | return true | 293 | return true |
| 293 | end | 294 | end |
| 294 | - | ||
| 295 | - newRole:award(globalCsv.birthItem) | 295 | + newRole:startActionUcode() |
| 296 | + newRole:award(globalCsv.birthItem, {log = {desc = "birth"}}) | ||
| 296 | -- 欢迎邮件 | 297 | -- 欢迎邮件 |
| 297 | redisproxy:insertEmail({roleId = roleId, emailId = 1}) | 298 | redisproxy:insertEmail({roleId = roleId, emailId = 1}) |
| 298 | 299 | ||
| @@ -394,8 +395,8 @@ function _M.saleItemRpc(agent, data) | @@ -394,8 +395,8 @@ function _M.saleItemRpc(agent, data) | ||
| 394 | reward[sellEffect[1]] = (reward[sellEffect[1]] or 0) + sellEffect[2] * count | 395 | reward[sellEffect[1]] = (reward[sellEffect[1]] or 0) + sellEffect[2] * count |
| 395 | end | 396 | end |
| 396 | 397 | ||
| 397 | - role:costItems(backs) | ||
| 398 | - local reward = role:award(reward) | 398 | + role:costItems(backs, {log = {desc = "saleItem"}}) |
| 399 | + local reward = role:award(reward, {log = {desc = "saleItem"}}) | ||
| 399 | role:checkTaskEnter("DecoFrag", {count = fragCount}) | 400 | role:checkTaskEnter("DecoFrag", {count = fragCount}) |
| 400 | SendPacket(actionCodes.Role_saleItemRpc, MsgPack.pack({reward = reward})) | 401 | SendPacket(actionCodes.Role_saleItemRpc, MsgPack.pack({reward = reward})) |
| 401 | return true | 402 | return true |
| @@ -433,8 +434,8 @@ function _M.openItemRpc(agent, data) | @@ -433,8 +434,8 @@ function _M.openItemRpc(agent, data) | ||
| 433 | end | 434 | end |
| 434 | reward[0] = nil | 435 | reward[0] = nil |
| 435 | 436 | ||
| 436 | - role:costItems({[itemId] = count}) | ||
| 437 | - reward = role:award(reward) | 437 | + role:costItems({[itemId] = count}, {log = {desc = "openItem"}}) |
| 438 | + reward = role:award(reward, {log = {desc = "openItem", int1 = itemId, int2 = count}}) | ||
| 438 | 439 | ||
| 439 | SendPacket(actionCodes.Role_openItemRpc, MsgPack.pack({reward = reward})) | 440 | SendPacket(actionCodes.Role_openItemRpc, MsgPack.pack({reward = reward})) |
| 440 | return true | 441 | return true |
| @@ -457,7 +458,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -457,7 +458,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
| 457 | if not itemData or not randomData or randomData.openTime <= 0 then return end | 458 | if not itemData or not randomData or randomData.openTime <= 0 then return end |
| 458 | 459 | ||
| 459 | if boxL[slot] then return end | 460 | if boxL[slot] then return end |
| 460 | - role:costItems({[itemId] = 1}) | 461 | + role:costItems({[itemId] = 1}, {log = {desc = "openTimeBox"}}) |
| 461 | boxL[slot] = {id = itemId, time = skynet.timex() + randomData.openTime} | 462 | boxL[slot] = {id = itemId, time = skynet.timex() + randomData.openTime} |
| 462 | 463 | ||
| 463 | elseif oper == 2 then -- 领取 | 464 | elseif oper == 2 then -- 领取 |
| @@ -468,7 +469,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -468,7 +469,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
| 468 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") | 469 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") |
| 469 | local costD = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] | 470 | local costD = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] |
| 470 | if not role:checkItemEnough({[ItemId.BoxKey] = costD}) then return end | 471 | if not role:checkItemEnough({[ItemId.BoxKey] = costD}) then return end |
| 471 | - role:costItems({[ItemId.BoxKey] = costD}) | 472 | + role:costItems({[ItemId.BoxKey] = costD}, {log = {desc = "openTimeBox"}}) |
| 472 | end | 473 | end |
| 473 | local boxId = boxL[slot].id | 474 | local boxId = boxL[slot].id |
| 474 | local itemData = csvdb["itemCsv"][boxId] | 475 | local itemData = csvdb["itemCsv"][boxId] |
| @@ -496,7 +497,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -496,7 +497,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
| 496 | reward[0] = nil | 497 | reward[0] = nil |
| 497 | 498 | ||
| 498 | boxL[slot] = nil | 499 | boxL[slot] = nil |
| 499 | - reward = role:award(reward) | 500 | + reward = role:award(reward, {log = {desc = "openTimeBox", int1 = boxId}}) |
| 500 | role:checkTaskEnter("OpenBox", {id = boxId}) | 501 | role:checkTaskEnter("OpenBox", {id = boxId}) |
| 501 | else | 502 | else |
| 502 | return | 503 | return |
| @@ -554,8 +555,8 @@ function _M.openSpeedUpBoxRpc(agent, data) | @@ -554,8 +555,8 @@ function _M.openSpeedUpBoxRpc(agent, data) | ||
| 554 | return | 555 | return |
| 555 | end | 556 | end |
| 556 | 557 | ||
| 557 | - role:costItems({[id] = count}) | ||
| 558 | - reward = role:award(reward) | 558 | + role:costItems({[id] = count}, {log = {desc = "speedUpBox"}}) |
| 559 | + reward = role:award(reward, {log = {desc = "speedUpBox"}, int1 = id, int2 = count}) | ||
| 559 | 560 | ||
| 560 | SendPacket(actionCodes.Role_openSpeedUpBoxRpc, MsgPack.pack({reward = reward})) | 561 | SendPacket(actionCodes.Role_openSpeedUpBoxRpc, MsgPack.pack({reward = reward})) |
| 561 | return true | 562 | return true |
| @@ -574,7 +575,7 @@ function _M.storyBookRewardRpc(agent, data) | @@ -574,7 +575,7 @@ function _M.storyBookRewardRpc(agent, data) | ||
| 574 | -- 获取奖励 | 575 | -- 获取奖励 |
| 575 | storyStatus[storyId].s = -1 | 576 | storyStatus[storyId].s = -1 |
| 576 | role:changeUpdates({{ type = "storyB", field = storyId, value = storyStatus[storyId] }}) | 577 | role:changeUpdates({{ type = "storyB", field = storyId, value = storyStatus[storyId] }}) |
| 577 | - local reward = role:award(storyBookData.gift) | 578 | + local reward = role:award(storyBookData.gift, {log = {desc = "storybookReward", int1 = storyId}}) |
| 578 | SendPacket(actionCodes.Role_storyBookRewardRpc, MsgPack.pack({reward = reward})) | 579 | SendPacket(actionCodes.Role_storyBookRewardRpc, MsgPack.pack({reward = reward})) |
| 579 | return true | 580 | return true |
| 580 | end | 581 | end |
| @@ -594,7 +595,7 @@ function _M.unLockStoryBookRpc(agent, data) | @@ -594,7 +595,7 @@ function _M.unLockStoryBookRpc(agent, data) | ||
| 594 | if not cost or not next(cost) then return end | 595 | if not cost or not next(cost) then return end |
| 595 | if not role:checkItemEnough(cost) then return end -- 消耗品不足 | 596 | if not role:checkItemEnough(cost) then return end -- 消耗品不足 |
| 596 | 597 | ||
| 597 | - role:costItems(cost) | 598 | + role:costItems(cost, {log = {desc = "unlockStory", int1 = storyId}}) |
| 598 | 599 | ||
| 599 | -- 解锁 | 600 | -- 解锁 |
| 600 | storyStatus[storyId] = storyStatus[storyId] or {} | 601 | storyStatus[storyId] = storyStatus[storyId] or {} |
| @@ -626,7 +627,7 @@ function _M.taskRpc(agent, data) | @@ -626,7 +627,7 @@ function _M.taskRpc(agent, data) | ||
| 626 | return 3 | 627 | return 3 |
| 627 | end | 628 | end |
| 628 | 629 | ||
| 629 | - local reward = role:award(taskData.reward) | 630 | + local reward = role:award(taskData.reward, {log = {desc = "finishTask", int1 = taskType, int2 = taskId}}) |
| 630 | local active = (taskStatus["a"] or 0) + taskData.active | 631 | local active = (taskStatus["a"] or 0) + taskData.active |
| 631 | 632 | ||
| 632 | role:changeUpdates({ | 633 | role:changeUpdates({ |
| @@ -659,7 +660,7 @@ function _M.taskActiveRpc(agent, data) | @@ -659,7 +660,7 @@ function _M.taskActiveRpc(agent, data) | ||
| 659 | return | 660 | return |
| 660 | end | 661 | end |
| 661 | 662 | ||
| 662 | - local reward = role:award(taskData.reward) | 663 | + local reward = role:award(taskData.reward, {log = {desc = "taskActive", int1 = taskType, int2 = taskId}}) |
| 663 | role:changeUpdates({ | 664 | role:changeUpdates({ |
| 664 | { type = roleField[taskType], field = {"at", taskId}, value = -1 } | 665 | { type = roleField[taskType], field = {"at", taskId}, value = -1 } |
| 665 | }) | 666 | }) |
| @@ -690,7 +691,7 @@ function _M.achiveRpc(agent, data) | @@ -690,7 +691,7 @@ function _M.achiveRpc(agent, data) | ||
| 690 | return 3 | 691 | return 3 |
| 691 | end | 692 | end |
| 692 | 693 | ||
| 693 | - local reward = role:award(achiveTask.reward) | 694 | + local reward = role:award(achiveTask.reward, {log = {desc = "finishAchive", int1 = taskId}}) |
| 694 | role:changeUpdates({ | 695 | role:changeUpdates({ |
| 695 | { type = "achiveV", field = taskId, value = skynet.timex() } | 696 | { type = "achiveV", field = taskId, value = skynet.timex() } |
| 696 | }) | 697 | }) |
| @@ -869,6 +870,8 @@ function _M.changeSettingRpc(agent, data) | @@ -869,6 +870,8 @@ function _M.changeSettingRpc(agent, data) | ||
| 869 | setting[id] = status | 870 | setting[id] = status |
| 870 | role:updateProperty({field = "setting", value = setting}) | 871 | role:updateProperty({field = "setting", value = setting}) |
| 871 | 872 | ||
| 873 | + role:log("role_action", {desc = "changeSetting", int1 = id, int2 = status}) | ||
| 874 | + | ||
| 872 | SendPacket(actionCodes.Role_changeSettingRpc, '') | 875 | SendPacket(actionCodes.Role_changeSettingRpc, '') |
| 873 | return true | 876 | return true |
| 874 | end | 877 | end |
| @@ -897,7 +900,7 @@ function _M.drawCodeRpc(agent, data) | @@ -897,7 +900,7 @@ function _M.drawCodeRpc(agent, data) | ||
| 897 | if ret == 0 then | 900 | if ret == 0 then |
| 898 | local giftId = tonumber(result.giftId) | 901 | local giftId = tonumber(result.giftId) |
| 899 | role:setProperty("codeStr", codestr:setv(giftId, 1)) | 902 | role:setProperty("codeStr", codestr:setv(giftId, 1)) |
| 900 | - local reward = role:award(result.gift) | 903 | + local reward = role:award(result.gift, {log = {desc = "drawCode", key1 = code, int1 = giftId}}) |
| 901 | 904 | ||
| 902 | SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ | 905 | SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ |
| 903 | result = ret, | 906 | result = ret, |
| @@ -941,6 +944,8 @@ function _M.changeHeadRpc(agent, data) | @@ -941,6 +944,8 @@ function _M.changeHeadRpc(agent, data) | ||
| 941 | end | 944 | end |
| 942 | role:updateProperty({field = "headId" ,value = id}) | 945 | role:updateProperty({field = "headId" ,value = id}) |
| 943 | role:changeCrossServerPvpSelfInfo("headId") | 946 | role:changeCrossServerPvpSelfInfo("headId") |
| 947 | + role:log("role_action", {desc = "changeHead", int1 = id}) | ||
| 948 | + | ||
| 944 | SendPacket(actionCodes.Role_changeHeadRpc, "") | 949 | SendPacket(actionCodes.Role_changeHeadRpc, "") |
| 945 | return true | 950 | return true |
| 946 | end | 951 | end |
| @@ -960,6 +965,7 @@ function _M.guideRpc(agent, data) | @@ -960,6 +965,7 @@ function _M.guideRpc(agent, data) | ||
| 960 | if master < 0 or slave < 0 then return end | 965 | if master < 0 or slave < 0 then return end |
| 961 | newerGuide = string.format("%d=%d",master,slave) | 966 | newerGuide = string.format("%d=%d",master,slave) |
| 962 | role:updateProperty({field = "newerGuide", value = newerGuide}) | 967 | role:updateProperty({field = "newerGuide", value = newerGuide}) |
| 968 | + role:log("guide", {desc = "guide_new",int1 = master*1000+slave}) | ||
| 963 | elseif cmdType == 2 then | 969 | elseif cmdType == 2 then |
| 964 | -- 系统引导 | 970 | -- 系统引导 |
| 965 | if not msg.skip then return end | 971 | if not msg.skip then return end |
| @@ -972,6 +978,7 @@ function _M.guideRpc(agent, data) | @@ -972,6 +978,7 @@ function _M.guideRpc(agent, data) | ||
| 972 | 978 | ||
| 973 | if msg.funcType then | 979 | if msg.funcType then |
| 974 | funcGuide = funcGuide:setv(msg.funcType, 1) | 980 | funcGuide = funcGuide:setv(msg.funcType, 1) |
| 981 | + role:log("guide", {desc = "guide_sys", int1 = msg.funcType}) | ||
| 975 | end | 982 | end |
| 976 | role:updateProperty({field = "funcGuide", value = funcGuide}) | 983 | role:updateProperty({field = "funcGuide", value = funcGuide}) |
| 977 | elseif cmdType == 3 then | 984 | elseif cmdType == 3 then |
| @@ -979,6 +986,7 @@ function _M.guideRpc(agent, data) | @@ -979,6 +986,7 @@ function _M.guideRpc(agent, data) | ||
| 979 | if msg.funcType then | 986 | if msg.funcType then |
| 980 | local value = msg.value or 1 | 987 | local value = msg.value or 1 |
| 981 | for _, funcIdx in pairs(msg.funcType:toArray(true,"=")) do | 988 | for _, funcIdx in pairs(msg.funcType:toArray(true,"=")) do |
| 989 | + role:log("guide", {desc = "guide_weak", int1 = funcIdx}) | ||
| 982 | funcGuide = funcGuide:setv(funcIdx, value) | 990 | funcGuide = funcGuide:setv(funcIdx, value) |
| 983 | end | 991 | end |
| 984 | role:updateProperty({field = "funcGuide", value = funcGuide}) | 992 | role:updateProperty({field = "funcGuide", value = funcGuide}) |
src/actions/StoreAction.lua
| @@ -15,7 +15,7 @@ function _M.rechargeRpc(agent , data) | @@ -15,7 +15,7 @@ function _M.rechargeRpc(agent , data) | ||
| 15 | rechargeF[id] = 1 | 15 | rechargeF[id] = 1 |
| 16 | role:updateProperty({field = "rechargeF", value = rechargeF}) | 16 | role:updateProperty({field = "rechargeF", value = rechargeF}) |
| 17 | end | 17 | end |
| 18 | - role:gainDiamond({count = diamondCount, isRecharge = true}) | 18 | + role:gainDiamond({count = diamondCount, isRecharge = true, log = {desc = "recharge", int1 = id}}) |
| 19 | elseif dataSet.type == 1 then --月卡 | 19 | elseif dataSet.type == 1 then --月卡 |
| 20 | return | 20 | return |
| 21 | elseif dataSet.type == 2 then -- 赛季通行证 | 21 | elseif dataSet.type == 2 then -- 赛季通行证 |
| @@ -28,6 +28,8 @@ function _M.rechargeRpc(agent , data) | @@ -28,6 +28,8 @@ function _M.rechargeRpc(agent , data) | ||
| 28 | local rmb = dataSet.rmb | 28 | local rmb = dataSet.rmb |
| 29 | role:updateProperty({field = "rmbC", delta = rmb}) | 29 | role:updateProperty({field = "rmbC", delta = rmb}) |
| 30 | 30 | ||
| 31 | + role:log("role_action", {desc = "recharge", int1 = id}) | ||
| 32 | + | ||
| 31 | SendPacket(actionCodes.Store_rechargeRpc, MsgPack.pack({diamond = diamondCount})) | 33 | SendPacket(actionCodes.Store_rechargeRpc, MsgPack.pack({diamond = diamondCount})) |
| 32 | return true | 34 | return true |
| 33 | end | 35 | end |
| @@ -57,7 +59,7 @@ function _M.dailyBuyRpc(agent , data) | @@ -57,7 +59,7 @@ function _M.dailyBuyRpc(agent , data) | ||
| 57 | return 3 | 59 | return 3 |
| 58 | end | 60 | end |
| 59 | 61 | ||
| 60 | - if not role:costDiamond({count = cost * count}) then | 62 | + if not role:costDiamond({count = cost * count}, {log = {desc = "dailyShop", int1 = id, int2 = count}}) then |
| 61 | return 4 | 63 | return 4 |
| 62 | end | 64 | end |
| 63 | 65 | ||
| @@ -65,7 +67,9 @@ function _M.dailyBuyRpc(agent , data) | @@ -65,7 +67,9 @@ function _M.dailyBuyRpc(agent , data) | ||
| 65 | dailySDC[id] = (dailySDC[id] or 0) + count | 67 | dailySDC[id] = (dailySDC[id] or 0) + count |
| 66 | role.dailyData:updateProperty({field = "dailySDC", value = dailySDC}) | 68 | role.dailyData:updateProperty({field = "dailySDC", value = dailySDC}) |
| 67 | end | 69 | end |
| 68 | - local reward = role:award(dataSet.gift) | 70 | + local reward = role:award(dataSet.gift, {log = {desc = "dailyShop", int1 = id, int2 = count}}) |
| 71 | + | ||
| 72 | + role:log("role_action", {desc = "dailyShop", int1 = id, int2 = count}) | ||
| 69 | 73 | ||
| 70 | SendPacket(actionCodes.Store_dailyBuyRpc, MsgPack.pack({reward = reward})) | 74 | SendPacket(actionCodes.Store_dailyBuyRpc, MsgPack.pack({reward = reward})) |
| 71 | return true | 75 | return true |
| @@ -92,13 +96,15 @@ function _M.dinerBuyRpc(agent , data) | @@ -92,13 +96,15 @@ function _M.dinerBuyRpc(agent , data) | ||
| 92 | role:updateProperty({field = "dinerS", value = dinerS}) | 96 | role:updateProperty({field = "dinerS", value = dinerS}) |
| 93 | end | 97 | end |
| 94 | 98 | ||
| 95 | - role:costItems(cost) | 99 | + role:costItems(cost, {log = {desc = "dinerShop", int1 = id, int2 = count}}) |
| 96 | 100 | ||
| 97 | local gift = {} | 101 | local gift = {} |
| 98 | for _id, _count in pairs(dataSet.gift:toNumMap()) do | 102 | for _id, _count in pairs(dataSet.gift:toNumMap()) do |
| 99 | gift[_id] = _count * count | 103 | gift[_id] = _count * count |
| 100 | end | 104 | end |
| 101 | - local reward = role:award(gift) | 105 | + local reward = role:award(gift, {log = {desc = "dinerShop", int1 = id, int2 = count}}) |
| 106 | + | ||
| 107 | + role:log("role_action", {desc = "dinerShop", int1 = id, int2 = count}) | ||
| 102 | 108 | ||
| 103 | SendPacket(actionCodes.Store_dinerBuyRpc, MsgPack.pack({reward = reward})) | 109 | SendPacket(actionCodes.Store_dinerBuyRpc, MsgPack.pack({reward = reward})) |
| 104 | return true | 110 | return true |
src/actions/TowerAction.lua
| @@ -32,6 +32,7 @@ function _M.roleFormatRpc(agent , data) | @@ -32,6 +32,7 @@ function _M.roleFormatRpc(agent , data) | ||
| 32 | towerTeam.leader = msg.leader | 32 | towerTeam.leader = msg.leader |
| 33 | towerTeam.supports = supports | 33 | towerTeam.supports = supports |
| 34 | 34 | ||
| 35 | + | ||
| 35 | role:updateProperty({field = "towerF", value = towerTeam}) | 36 | role:updateProperty({field = "towerF", value = towerTeam}) |
| 36 | SendPacket(actionCodes.Tower_roleFormatRpc, '') | 37 | SendPacket(actionCodes.Tower_roleFormatRpc, '') |
| 37 | return true | 38 | return true |
| @@ -74,6 +75,9 @@ function _M.startBattleRpc(agent, data) | @@ -74,6 +75,9 @@ function _M.startBattleRpc(agent, data) | ||
| 74 | 75 | ||
| 75 | role:updateProperty({field = "towerInfo", value = towerInfo}) | 76 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
| 76 | role:checkTaskEnter("TowerBattle", {level = towerInfo.l}) | 77 | role:checkTaskEnter("TowerBattle", {level = towerInfo.l}) |
| 78 | + | ||
| 79 | + role:log("tower_action", {desc = "startBattle", int1 = id}) | ||
| 80 | + | ||
| 77 | SendPacket(actionCodes.Tower_startBattleRpc, '') | 81 | SendPacket(actionCodes.Tower_startBattleRpc, '') |
| 78 | return true | 82 | return true |
| 79 | end | 83 | end |
| @@ -100,7 +104,7 @@ function _M.endBattleRpc(agent, data) | @@ -100,7 +104,7 @@ function _M.endBattleRpc(agent, data) | ||
| 100 | role:setTowerRank(towerInfo.l) | 104 | role:setTowerRank(towerInfo.l) |
| 101 | 105 | ||
| 102 | towerInfo.l = towerInfo.l + 1 | 106 | towerInfo.l = towerInfo.l + 1 |
| 103 | - reward = role:award(curTower.reward) | 107 | + reward = role:award(curTower.reward, {log = {desc = "towerBattle", int1 = id}}) |
| 104 | role:checkTaskEnter("TowerPass", {level = towerInfo.l - 1}) | 108 | role:checkTaskEnter("TowerPass", {level = towerInfo.l - 1}) |
| 105 | end | 109 | end |
| 106 | 110 | ||
| @@ -108,6 +112,9 @@ function _M.endBattleRpc(agent, data) | @@ -108,6 +112,9 @@ function _M.endBattleRpc(agent, data) | ||
| 108 | towerInfo.t = nextTime | 112 | towerInfo.t = nextTime |
| 109 | towerInfo.k = nil | 113 | towerInfo.k = nil |
| 110 | role:updateProperty({field = "towerInfo", value = towerInfo}) | 114 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
| 115 | + | ||
| 116 | + role:log("tower_action", {desc = "startBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id}) | ||
| 117 | + | ||
| 111 | SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward})) | 118 | SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward})) |
| 112 | return true | 119 | return true |
| 113 | end | 120 | end |
| @@ -124,12 +131,14 @@ function _M.bugCountRpc(agent, data) | @@ -124,12 +131,14 @@ function _M.bugCountRpc(agent, data) | ||
| 124 | cost[k] = v * needCount | 131 | cost[k] = v * needCount |
| 125 | end | 132 | end |
| 126 | if not role:checkItemEnough(cost) then return end | 133 | if not role:checkItemEnough(cost) then return end |
| 127 | - role:costItems(cost) | 134 | + role:costItems(cost, {log = {desc = "towerCount"}}) |
| 128 | curCount = globalCsv.tower_count_limit | 135 | curCount = globalCsv.tower_count_limit |
| 129 | end | 136 | end |
| 130 | towerInfo.c = curCount | 137 | towerInfo.c = curCount |
| 131 | towerInfo.t = nextTime | 138 | towerInfo.t = nextTime |
| 132 | role:updateProperty({field = "towerInfo", value = towerInfo}) | 139 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
| 140 | + role:log("tower_action", {desc = "bugCount"}) | ||
| 141 | + | ||
| 133 | SendPacket(actionCodes.Tower_bugCountRpc, '') | 142 | SendPacket(actionCodes.Tower_bugCountRpc, '') |
| 134 | return true | 143 | return true |
| 135 | end | 144 | end |
src/adv/Adv.lua
| @@ -23,6 +23,17 @@ function Adv:ctor(owner) | @@ -23,6 +23,17 @@ function Adv:ctor(owner) | ||
| 23 | self:initByInfo(self.owner:getProperty("advInfo")) | 23 | self:initByInfo(self.owner:getProperty("advInfo")) |
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | +function Adv:log(contents) | ||
| 27 | + contents = contents or {} | ||
| 28 | + if contents["cint1"] or contents["cint2"] or contents["cint3"] then | ||
| 29 | + print("advLog error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 30 | + end | ||
| 31 | + contents["cint1"] = self.chapterId | ||
| 32 | + contents["cint2"] = self.level | ||
| 33 | + | ||
| 34 | + self.owner:log("adv_action", contents) | ||
| 35 | +end | ||
| 36 | + | ||
| 26 | --初始化adv 信息 | 37 | --初始化adv 信息 |
| 27 | function Adv:initByInfo(advInfo) | 38 | function Adv:initByInfo(advInfo) |
| 28 | if not next(advInfo) then return end --还没有 开始新地图 | 39 | if not next(advInfo) then return end --还没有 开始新地图 |
| @@ -84,6 +95,7 @@ function Adv:initByChapter(chapterId, level, isToNext, notNotify, isRelay, isEnt | @@ -84,6 +95,7 @@ function Adv:initByChapter(chapterId, level, isToNext, notNotify, isRelay, isEnt | ||
| 84 | 95 | ||
| 85 | if isEnter then -- 把 支援效果初始化为易用用的形式 | 96 | if isEnter then -- 把 支援效果初始化为易用用的形式 |
| 86 | self:initSupport(support or {}) | 97 | self:initSupport(support or {}) |
| 98 | + self.owner:setProperty("advLimit", {}) -- 清掉 Limit | ||
| 87 | end | 99 | end |
| 88 | 100 | ||
| 89 | -- 随机出地图 | 101 | -- 随机出地图 |
| @@ -244,7 +256,7 @@ end | @@ -244,7 +256,7 @@ end | ||
| 244 | function Adv:activeSomeSupport() | 256 | function Adv:activeSomeSupport() |
| 245 | -- 奖励物品 | 257 | -- 奖励物品 |
| 246 | if self.support[1] then | 258 | if self.support[1] then |
| 247 | - self:award(self.support[1]) | 259 | + self:award(self.support[1], {log = {desc = "support"}}) |
| 248 | self.support[1] = nil | 260 | self.support[1] = nil |
| 249 | end | 261 | end |
| 250 | 262 | ||
| @@ -274,7 +286,7 @@ function Adv:activeSomeSupport() | @@ -274,7 +286,7 @@ function Adv:activeSomeSupport() | ||
| 274 | end | 286 | end |
| 275 | for i = 1, math.min(self.support[6], #pool) do | 287 | for i = 1, math.min(self.support[6], #pool) do |
| 276 | local idx = math.randomInt(1, #pool) | 288 | local idx = math.randomInt(1, #pool) |
| 277 | - self:award({[pool[idx]] = 1}) | 289 | + self:award({[pool[idx]] = 1}, {log = {desc = "support"}}) |
| 278 | table.remove(pool, idx) | 290 | table.remove(pool, idx) |
| 279 | end | 291 | end |
| 280 | self.support[6] = nil | 292 | self.support[6] = nil |
| @@ -317,7 +329,7 @@ end | @@ -317,7 +329,7 @@ end | ||
| 317 | -- 强制结束 | 329 | -- 强制结束 |
| 318 | function Adv:forceOver(notNotify) | 330 | function Adv:forceOver(notNotify) |
| 319 | if self:isRunning() then | 331 | if self:isRunning() then |
| 320 | - self:clear() | 332 | + |
| 321 | local advTeam = self.owner:getProperty("advTeam") | 333 | local advTeam = self.owner:getProperty("advTeam") |
| 322 | advTeam.player = nil | 334 | advTeam.player = nil |
| 323 | 335 | ||
| @@ -325,8 +337,9 @@ function Adv:forceOver(notNotify) | @@ -325,8 +337,9 @@ function Adv:forceOver(notNotify) | ||
| 325 | for itemId, count in pairs(reward) do | 337 | for itemId, count in pairs(reward) do |
| 326 | reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 | 338 | reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 |
| 327 | end | 339 | end |
| 328 | - self.owner:award(reward) | 340 | + self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}}) |
| 329 | 341 | ||
| 342 | + self:clear() | ||
| 330 | self.owner:updateProperties({ | 343 | self.owner:updateProperties({ |
| 331 | advInfo = {}, | 344 | advInfo = {}, |
| 332 | advTeam = advTeam, | 345 | advTeam = advTeam, |
| @@ -355,7 +368,7 @@ function Adv:checkAdvUnlock(utype, value) | @@ -355,7 +368,7 @@ function Adv:checkAdvUnlock(utype, value) | ||
| 355 | end | 368 | end |
| 356 | end | 369 | end |
| 357 | if next(reward) then | 370 | if next(reward) then |
| 358 | - self.owner:award(reward) | 371 | + self.owner:award(reward, {log = {desc = "advUnlock", int1 = self.chapterId}}) |
| 359 | end | 372 | end |
| 360 | end | 373 | end |
| 361 | 374 | ||
| @@ -365,7 +378,7 @@ function Adv:clearAdvUnlockCache() | @@ -365,7 +378,7 @@ function Adv:clearAdvUnlockCache() | ||
| 365 | reward[itemId] = 1 | 378 | reward[itemId] = 1 |
| 366 | end | 379 | end |
| 367 | if next(reward) then | 380 | if next(reward) then |
| 368 | - self.owner:award(reward) | 381 | + self.owner:award(reward, {log = {desc = "advUnlock", int1 = self.chapterId}}) |
| 369 | end | 382 | end |
| 370 | self.cacheUnlock = {} | 383 | self.cacheUnlock = {} |
| 371 | end | 384 | end |
| @@ -427,6 +440,21 @@ function Adv:awardArtifact(id, params) | @@ -427,6 +440,21 @@ function Adv:awardArtifact(id, params) | ||
| 427 | if self:isHaveArtifact(id) then return end | 440 | if self:isHaveArtifact(id) then return end |
| 428 | self.owner:changeUpdates({{type = "advAFGet", field = id, value = 1}}, params.notNotify) | 441 | self.owner:changeUpdates({{type = "advAFGet", field = id, value = 1}}, params.notNotify) |
| 429 | self:checkAchievement(Adv.AchievType.GetMWeapon, 1, id) | 442 | self:checkAchievement(Adv.AchievType.GetMWeapon, 1, id) |
| 443 | + | ||
| 444 | + | ||
| 445 | + if params.log then | ||
| 446 | + local log = clone(params.log) | ||
| 447 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 448 | + print("awardArtifact error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 449 | + end | ||
| 450 | + log["cint1"] = self.chapterId | ||
| 451 | + log["cint2"] = self.level | ||
| 452 | + log["cint3"] = id | ||
| 453 | + self.owner:log("in_artifact", log) | ||
| 454 | + else | ||
| 455 | + print("awardArtifact no log ", debug.traceback()) | ||
| 456 | + end | ||
| 457 | + | ||
| 430 | self:pushBackEvent(AdvBackEventType.Artifact, {id = id}) | 458 | self:pushBackEvent(AdvBackEventType.Artifact, {id = id}) |
| 431 | end | 459 | end |
| 432 | 460 | ||
| @@ -513,6 +541,7 @@ function Adv:wearArtifact(slot, id) | @@ -513,6 +541,7 @@ function Adv:wearArtifact(slot, id) | ||
| 513 | else | 541 | else |
| 514 | id = nil | 542 | id = nil |
| 515 | end | 543 | end |
| 544 | + self:log({desc = "wearArtifact", int1 = id}) | ||
| 516 | 545 | ||
| 517 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) | 546 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) |
| 518 | return true | 547 | return true |
| @@ -571,6 +600,9 @@ function Adv:artifactLevelUp(id, level) | @@ -571,6 +600,9 @@ function Adv:artifactLevelUp(id, level) | ||
| 571 | end | 600 | end |
| 572 | if newLv == advAFGet[id] then return end | 601 | if newLv == advAFGet[id] then return end |
| 573 | 602 | ||
| 603 | + self:log({desc = "artifactLevelUp", int1 = id, int2 = level}) | ||
| 604 | + | ||
| 605 | + | ||
| 574 | local status = 0 | 606 | local status = 0 |
| 575 | if curWear[id] then -- 穿着呢 | 607 | if curWear[id] then -- 穿着呢 |
| 576 | local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] | 608 | local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] |
| @@ -595,7 +627,7 @@ function Adv:waitChooseArtifact() | @@ -595,7 +627,7 @@ function Adv:waitChooseArtifact() | ||
| 595 | end | 627 | end |
| 596 | end | 628 | end |
| 597 | if #pool == 0 then | 629 | if #pool == 0 then |
| 598 | - self:award({[ItemId.AdvPoint] = 48}) | 630 | + self:award({[ItemId.AdvPoint] = 48}, {log = {desc = "chooseArtifact"}}) |
| 599 | else | 631 | else |
| 600 | for i = 1, math.min(count, #pool) do | 632 | for i = 1, math.min(count, #pool) do |
| 601 | local idx = math.randomInt(1, #pool) | 633 | local idx = math.randomInt(1, #pool) |
| @@ -613,7 +645,10 @@ end | @@ -613,7 +645,10 @@ end | ||
| 613 | 645 | ||
| 614 | function Adv:chooseArtifact(index) | 646 | function Adv:chooseArtifact(index) |
| 615 | if not self.waitArtifact or not self.waitArtifact[index] then return end | 647 | if not self.waitArtifact or not self.waitArtifact[index] then return end |
| 616 | - self:award({[self.waitArtifact[index]] = 1}) | 648 | + self:award({[self.waitArtifact[index]] = 1}, {log = {desc = "chooseArtifact"}}) |
| 649 | + | ||
| 650 | + self:log({desc = "chooseArtifact", int1 = self.waitArtifact[index]}) | ||
| 651 | + | ||
| 617 | self.waitArtifact = nil | 652 | self.waitArtifact = nil |
| 618 | 653 | ||
| 619 | -- 支援效果继续选择 | 654 | -- 支援效果继续选择 |
| @@ -657,7 +692,7 @@ function Adv:over(success, rewardRatio, overType) | @@ -657,7 +692,7 @@ function Adv:over(success, rewardRatio, overType) | ||
| 657 | local scoreInfo = self.score | 692 | local scoreInfo = self.score |
| 658 | 693 | ||
| 659 | local scoreReward = math.floor(score / chapterData.scoreAward) | 694 | local scoreReward = math.floor(score / chapterData.scoreAward) |
| 660 | - self.owner:award({[ItemId.OldCoin] = scoreReward}) | 695 | + self.owner:award({[ItemId.OldCoin] = scoreReward}, {log = {desc = "advOver", int1 = self.chapterId}}) |
| 661 | 696 | ||
| 662 | -- 被动技会影响奖励 | 697 | -- 被动技会影响奖励 |
| 663 | self.battle.player:triggerPassive(Passive.ADV_OVER, {score = score, level = self.level}) | 698 | self.battle.player:triggerPassive(Passive.ADV_OVER, {score = score, level = self.level}) |
| @@ -671,7 +706,7 @@ function Adv:over(success, rewardRatio, overType) | @@ -671,7 +706,7 @@ function Adv:over(success, rewardRatio, overType) | ||
| 671 | reward[itemId] = math.ceil(count * rewardRatio / 100) | 706 | reward[itemId] = math.ceil(count * rewardRatio / 100) |
| 672 | end | 707 | end |
| 673 | end | 708 | end |
| 674 | - reward = self.owner:award(reward) | 709 | + reward = self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}}) |
| 675 | 710 | ||
| 676 | if success then | 711 | if success then |
| 677 | self.owner:checkTaskEnter("AdvPass", {id = self.chapterId, level = self.level, score = score}) | 712 | self.owner:checkTaskEnter("AdvPass", {id = self.chapterId, level = self.level, score = score}) |
| @@ -699,6 +734,9 @@ function Adv:over(success, rewardRatio, overType) | @@ -699,6 +734,9 @@ function Adv:over(success, rewardRatio, overType) | ||
| 699 | end | 734 | end |
| 700 | end | 735 | end |
| 701 | self:clearAdvUnlockCache() | 736 | self:clearAdvUnlockCache() |
| 737 | + | ||
| 738 | + self:log({desc = "over", short1 = success and 1 or 0, int1 = overType}) | ||
| 739 | + | ||
| 702 | self:clear() | 740 | self:clear() |
| 703 | self.owner:checkTaskEnter("AdvScore", {score = score}) | 741 | self.owner:checkTaskEnter("AdvScore", {score = score}) |
| 704 | 742 | ||
| @@ -788,6 +826,22 @@ function Adv:award(gift, params) | @@ -788,6 +826,22 @@ function Adv:award(gift, params) | ||
| 788 | else | 826 | else |
| 789 | items = items:setv(itemId, nums) | 827 | items = items:setv(itemId, nums) |
| 790 | end | 828 | end |
| 829 | + | ||
| 830 | + if params.log then | ||
| 831 | + local log = clone(params.log) | ||
| 832 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 833 | + print("addAdvItem error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 834 | + end | ||
| 835 | + log["cint1"] = origin | ||
| 836 | + log["cint2"] = math.abs(count) | ||
| 837 | + if count >= 0 then | ||
| 838 | + self.owner:log("in_adv", log) | ||
| 839 | + else | ||
| 840 | + self.owner:log("out_adv", log) | ||
| 841 | + end | ||
| 842 | + else | ||
| 843 | + print("addAdvItem no log ", debug.traceback()) | ||
| 844 | + end | ||
| 791 | end | 845 | end |
| 792 | end | 846 | end |
| 793 | if items ~= oldItems then | 847 | if items ~= oldItems then |
| @@ -862,7 +916,7 @@ local function clickOut(self, room, block, params) | @@ -862,7 +916,7 @@ local function clickOut(self, room, block, params) | ||
| 862 | self.battle.player:triggerPassive(Passive.DOWN_LAYER) | 916 | self.battle.player:triggerPassive(Passive.DOWN_LAYER) |
| 863 | 917 | ||
| 864 | if curFloorData then | 918 | if curFloorData then |
| 865 | - self:backReward(self:award({[ItemId.AdvPoint] = curFloorData.exp})) | 919 | + self:backReward(self:award({[ItemId.AdvPoint] = curFloorData.exp}, {log = {desc = "passReward", int1 = self.chapterId, int2 = self.level}})) |
| 866 | end | 920 | end |
| 867 | local isHaveRelay = self:isHaveRelay(self.level) | 921 | local isHaveRelay = self:isHaveRelay(self.level) |
| 868 | 922 | ||
| @@ -870,6 +924,7 @@ local function clickOut(self, room, block, params) | @@ -870,6 +924,7 @@ local function clickOut(self, room, block, params) | ||
| 870 | if isHaveRelay and not self.isRelay then | 924 | if isHaveRelay and not self.isRelay then |
| 871 | self:initByChapter(self.chapterId, self.level, true, true, true, false) | 925 | self:initByChapter(self.chapterId, self.level, true, true, true, false) |
| 872 | else | 926 | else |
| 927 | + self:log({desc = "pass"}) | ||
| 873 | self:initByChapter(self.chapterId, self.level + 1, true, true, false, false) | 928 | self:initByChapter(self.chapterId, self.level + 1, true, true, false, false) |
| 874 | end | 929 | end |
| 875 | self:backNext() --下一关 | 930 | self:backNext() --下一关 |
| @@ -903,7 +958,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) | @@ -903,7 +958,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) | ||
| 903 | end, | 958 | end, |
| 904 | -- 拥有道具 | 959 | -- 拥有道具 |
| 905 | [1] = function(_, itemId, count) | 960 | [1] = function(_, itemId, count) |
| 906 | - if self:cost({[itemId] = count}, {}, true) then | 961 | + if self:cost({[itemId] = count}, {log = {desc = "chooseEvent", key1 = tag, int1 = chooseData.id}}, true) then |
| 907 | return true | 962 | return true |
| 908 | end | 963 | end |
| 909 | end, | 964 | end, |
| @@ -935,7 +990,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) | @@ -935,7 +990,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) | ||
| 935 | end, | 990 | end, |
| 936 | -- 提交一个物品 | 991 | -- 提交一个物品 |
| 937 | [5] = function (_, itemId, count) | 992 | [5] = function (_, itemId, count) |
| 938 | - if self:cost({[itemId] = count}, {}) then | 993 | + if self:cost({[itemId] = count}, {log = {desc = "chooseEvent", key1 = tag, int1 = chooseData.id}}) then |
| 939 | self:backCost({[itemId] = count}) | 994 | self:backCost({[itemId] = count}) |
| 940 | return true | 995 | return true |
| 941 | end | 996 | end |
| @@ -985,7 +1040,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) | @@ -985,7 +1040,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) | ||
| 985 | local item = csvdb["event_dropCsv"][effect[2]]["range"]:randWeight(true) | 1040 | local item = csvdb["event_dropCsv"][effect[2]]["range"]:randWeight(true) |
| 986 | reward[item[1]] = (reward[item[1]] or 0) + item[2] | 1041 | reward[item[1]] = (reward[item[1]] or 0) + item[2] |
| 987 | end | 1042 | end |
| 988 | - self:backReward(self:award(reward, {}), {roomId = room.roomId, blockId = block.blockId}) | 1043 | + self:backReward(self:award(reward, {log = {desc = "chooseEvent", key1 = tag, int1 = chooseData.id}}), {roomId = room.roomId, blockId = block.blockId}) |
| 989 | end, | 1044 | end, |
| 990 | [2] = function() --获得冒险buff | 1045 | [2] = function() --获得冒险buff |
| 991 | local layer = effect[3] or 1 | 1046 | local layer = effect[3] or 1 |
| @@ -1137,7 +1192,7 @@ local function clickDrop(self, room, block, params) | @@ -1137,7 +1192,7 @@ local function clickDrop(self, room, block, params) | ||
| 1137 | local reward = {} | 1192 | local reward = {} |
| 1138 | if not block.event.item then return end | 1193 | if not block.event.item then return end |
| 1139 | self.battle.player:triggerPassive(Passive.CLICK_DROP) | 1194 | self.battle.player:triggerPassive(Passive.CLICK_DROP) |
| 1140 | - local reward = self:award({[block.event.item[1]] = block.event.item[2]}) | 1195 | + local reward = self:award({[block.event.item[1]] = block.event.item[2]}, {log = {desc = "clickDrop"}}) |
| 1141 | -- local reward = self:award({[5801] = 1}) | 1196 | -- local reward = self:award({[5801] = 1}) |
| 1142 | block:clear() | 1197 | block:clear() |
| 1143 | self:backReward(reward, {roomId = room.roomId, blockId = block.blockId}) | 1198 | self:backReward(reward, {roomId = room.roomId, blockId = block.blockId}) |
| @@ -1159,9 +1214,9 @@ local function clickTrader(self, room, block, params) | @@ -1159,9 +1214,9 @@ local function clickTrader(self, room, block, params) | ||
| 1159 | if not goodsData then return false, 5 end | 1214 | if not goodsData then return false, 5 end |
| 1160 | 1215 | ||
| 1161 | local costCount = math.ceil(goodsData.price * (block.event.shop[buyId][2] or 100) / 100) | 1216 | local costCount = math.ceil(goodsData.price * (block.event.shop[buyId][2] or 100) / 100) |
| 1162 | - if not self:cost({[goodsData.currency] = costCount}, {}) then return false, 6 end --不够 | 1217 | + if not self:cost({[goodsData.currency] = costCount}, {log = {desc = "clickTrader", int1 = block.event.id}}) then return false, 6 end --不够 |
| 1163 | self:backCost({[goodsData.currency] = costCount}) | 1218 | self:backCost({[goodsData.currency] = costCount}) |
| 1164 | - local reward = self:award({[goodsData.item] = goodsData.num}) | 1219 | + local reward = self:award({[goodsData.item] = goodsData.num}, {log = {desc = "clickTrader", int1 = block.event.id}}) |
| 1165 | if goodsData.restrict == 1 then | 1220 | if goodsData.restrict == 1 then |
| 1166 | self.shopStatus[goodsData.goods] = (self.shopStatus[goodsData.goods] or 0) + 1 | 1221 | self.shopStatus[goodsData.goods] = (self.shopStatus[goodsData.goods] or 0) + 1 |
| 1167 | elseif goodsData.restrict == 2 then | 1222 | elseif goodsData.restrict == 2 then |
| @@ -1214,7 +1269,7 @@ local function clickClick(self, room, block, params) | @@ -1214,7 +1269,7 @@ local function clickClick(self, room, block, params) | ||
| 1214 | local item = csvdb["event_dropCsv"][dropId]["range"]:randWeight(true) | 1269 | local item = csvdb["event_dropCsv"][dropId]["range"]:randWeight(true) |
| 1215 | reward[item[1]] = (reward[item[1]] or 0) + item[2] | 1270 | reward[item[1]] = (reward[item[1]] or 0) + item[2] |
| 1216 | end | 1271 | end |
| 1217 | - self:backReward(self:award(reward, {}), {roomId = room.roomId, blockId = block.blockId}) | 1272 | + self:backReward(self:award(reward, {log = {desc = "clickClick", int1 = block.event.id}}), {roomId = room.roomId, blockId = block.blockId}) |
| 1218 | end, | 1273 | end, |
| 1219 | [3] = function() | 1274 | [3] = function() |
| 1220 | for _, buffId in ipairs(clickData.effect:toArray(true, "=")) do | 1275 | for _, buffId in ipairs(clickData.effect:toArray(true, "=")) do |
| @@ -1249,13 +1304,6 @@ local function clickLayer(self, room, block, params) | @@ -1249,13 +1304,6 @@ local function clickLayer(self, room, block, params) | ||
| 1249 | return true | 1304 | return true |
| 1250 | end | 1305 | end |
| 1251 | 1306 | ||
| 1252 | -local function clickTask(self, room, block, params) | ||
| 1253 | - if self:addTask(block.event.id) then --增加任务 | ||
| 1254 | - block:clear() | ||
| 1255 | - return true | ||
| 1256 | - end | ||
| 1257 | -end | ||
| 1258 | - | ||
| 1259 | local eventCallFunc = { | 1307 | local eventCallFunc = { |
| 1260 | [AdvEventType.Out] = clickOut, | 1308 | [AdvEventType.Out] = clickOut, |
| 1261 | [AdvEventType.InOut] = clickOut, | 1309 | [AdvEventType.InOut] = clickOut, |
| @@ -1269,7 +1317,6 @@ local eventCallFunc = { | @@ -1269,7 +1317,6 @@ local eventCallFunc = { | ||
| 1269 | [AdvEventType.Build] = clickBuild, | 1317 | [AdvEventType.Build] = clickBuild, |
| 1270 | [AdvEventType.Click] = clickClick, | 1318 | [AdvEventType.Click] = clickClick, |
| 1271 | [AdvEventType.Layer] = clickLayer, | 1319 | [AdvEventType.Layer] = clickLayer, |
| 1272 | - [AdvEventType.Task] = clickTask, | ||
| 1273 | } | 1320 | } |
| 1274 | 1321 | ||
| 1275 | --点击处理 roomId, blockId | 1322 | --点击处理 roomId, blockId |
| @@ -1452,9 +1499,7 @@ function Adv:doActive(activeId, target) | @@ -1452,9 +1499,7 @@ function Adv:doActive(activeId, target) | ||
| 1452 | doActiveEffect[5] = function(_) | 1499 | doActiveEffect[5] = function(_) |
| 1453 | for _, target in ipairs(targers) do | 1500 | for _, target in ipairs(targers) do |
| 1454 | if not target.lock and not target.isDead then | 1501 | if not target.lock and not target.isDead then |
| 1455 | - self.battle:removeEnemyById(target.id) | ||
| 1456 | - local block = self:getBlock(target.roomId, target.blockId) | ||
| 1457 | - block:clear() | 1502 | + target.isDead = true |
| 1458 | self:backBlockChange(target.roomId, target.blockId) | 1503 | self:backBlockChange(target.roomId, target.blockId) |
| 1459 | end | 1504 | end |
| 1460 | end | 1505 | end |
src/adv/AdvBlock.lua
| @@ -198,7 +198,6 @@ function Block:getEventData() | @@ -198,7 +198,6 @@ function Block:getEventData() | ||
| 198 | [AdvEventType.Trap] = "event_trapCsv", | 198 | [AdvEventType.Trap] = "event_trapCsv", |
| 199 | [AdvEventType.Click] = "event_clickCsv", | 199 | [AdvEventType.Click] = "event_clickCsv", |
| 200 | [AdvEventType.Layer] = "event_layerCsv", | 200 | [AdvEventType.Layer] = "event_layerCsv", |
| 201 | - [AdvEventType.Task] = "event_questCsv", | ||
| 202 | [AdvEventType.LinkChoose] = "event_linkchooseCsv", | 201 | [AdvEventType.LinkChoose] = "event_linkchooseCsv", |
| 203 | } | 202 | } |
| 204 | 203 |
src/adv/AdvBuff.lua
| @@ -303,22 +303,14 @@ local BuffFactory = { | @@ -303,22 +303,14 @@ local BuffFactory = { | ||
| 303 | 303 | ||
| 304 | [Buff.SP_MAX_CHANGE] = function(_Buff) | 304 | [Buff.SP_MAX_CHANGE] = function(_Buff) |
| 305 | _Buff._init = function(self) --初始化变化值 | 305 | _Buff._init = function(self) --初始化变化值 |
| 306 | - self:_spChange() | 306 | + self.owner:reSetSpMax() |
| 307 | end | 307 | end |
| 308 | _Buff._overlay = function(self) | 308 | _Buff._overlay = function(self) |
| 309 | - self:_spChange() | ||
| 310 | - end | ||
| 311 | - | ||
| 312 | - _Buff._uncover = function(self) | ||
| 313 | self.owner:reSetSpMax() | 309 | self.owner:reSetSpMax() |
| 314 | end | 310 | end |
| 315 | 311 | ||
| 316 | - _Buff._spChange = function(self) | ||
| 317 | - local oldSpMax = self.owner.spMax | 312 | + _Buff._uncover = function(self) |
| 318 | self.owner:reSetSpMax() | 313 | self.owner:reSetSpMax() |
| 319 | - | ||
| 320 | - local curValue = self.owner.spMax - oldSpMax | ||
| 321 | - self.owner:changeSp(curValue) | ||
| 322 | end | 314 | end |
| 323 | 315 | ||
| 324 | _Buff._endBuff = function(self) | 316 | _Buff._endBuff = function(self) |
src/adv/AdvMap.lua
| @@ -60,7 +60,7 @@ function Map:checkOver() | @@ -60,7 +60,7 @@ function Map:checkOver() | ||
| 60 | local mapCsv = csvdb["mapCsv"][self.mapId] | 60 | local mapCsv = csvdb["mapCsv"][self.mapId] |
| 61 | 61 | ||
| 62 | if mapCsv.clearType == 1 then -- 消耗 | 62 | if mapCsv.clearType == 1 then -- 消耗 |
| 63 | - if self.adv:cost(mapCsv.clear:toNumMap()) then return true end | 63 | + if self.adv:cost(mapCsv.clear:toNumMap(), {log = {desc = "overCost", int1 = self.mapId}}) then return true end |
| 64 | elseif mapCsv.clearType == 2 then -- 杀光 | 64 | elseif mapCsv.clearType == 2 then -- 杀光 |
| 65 | if #self.adv.battle.player:getTeam(2) == 0 then return true end | 65 | if #self.adv.battle.player:getTeam(2) == 0 then return true end |
| 66 | elseif mapCsv.clearType == 3 then -- 持有 | 66 | elseif mapCsv.clearType == 3 then -- 持有 |
| @@ -224,8 +224,6 @@ function Map:getBlocksBySize(roomId, blockId, size) | @@ -224,8 +224,6 @@ function Map:getBlocksBySize(roomId, blockId, size) | ||
| 224 | return blocks | 224 | return blocks |
| 225 | end | 225 | end |
| 226 | 226 | ||
| 227 | - | ||
| 228 | - | ||
| 229 | -----------------------------随机地图----------------------------- | 227 | -----------------------------随机地图----------------------------- |
| 230 | 228 | ||
| 231 | -- isEnter isNewRelay 区分中继层的类型 --是否是开始进入 是否是第一次进入 | 229 | -- isEnter isNewRelay 区分中继层的类型 --是否是开始进入 是否是第一次进入 |
| @@ -245,6 +243,7 @@ createMap = function(self, mapId, isEnter, isNewRelay) | @@ -245,6 +243,7 @@ createMap = function(self, mapId, isEnter, isNewRelay) | ||
| 245 | local haveBoss = false | 243 | local haveBoss = false |
| 246 | local haveLChoose = false | 244 | local haveLChoose = false |
| 247 | 245 | ||
| 246 | + local eventLimit = self.adv.owner:getProperty("advLimit") | ||
| 248 | 247 | ||
| 249 | local function randomEvent(roomId, blockId, eventType) | 248 | local function randomEvent(roomId, blockId, eventType) |
| 250 | if mapInfo.rooms[roomId]["event"][blockId] then return end --已经有事件了 不覆盖 | 249 | if mapInfo.rooms[roomId]["event"][blockId] then return end --已经有事件了 不覆盖 |
| @@ -261,6 +260,14 @@ createMap = function(self, mapId, isEnter, isNewRelay) | @@ -261,6 +260,14 @@ createMap = function(self, mapId, isEnter, isNewRelay) | ||
| 261 | if not eventLib[etype] or not next(eventLib[etype]) or not eventLib[etype][especial] or not next(eventLib[etype][especial]) then return false end | 260 | if not eventLib[etype] or not next(eventLib[etype]) or not eventLib[etype][especial] or not next(eventLib[etype][especial]) then return false end |
| 262 | event.id = math.randWeight(eventLib[etype][especial], "showup") | 261 | event.id = math.randWeight(eventLib[etype][especial], "showup") |
| 263 | if not event.id then return false end | 262 | if not event.id then return false end |
| 263 | + | ||
| 264 | + -- 不是 0 才会记录 | ||
| 265 | + if eventLib[etype][especial][event.id].dlimit ~= 0 then | ||
| 266 | + eventLimit[etype] = eventLimit[etype] or {} | ||
| 267 | + eventLimit[etype][event.id] = (eventLimit[etype][event.id] or 0) + 1 | ||
| 268 | + end | ||
| 269 | + | ||
| 270 | + -- 消除 | ||
| 264 | if eventLib[etype][especial][event.id].limit > 1 then | 271 | if eventLib[etype][especial][event.id].limit > 1 then |
| 265 | eventLib[etype][especial][event.id].limit = eventLib[etype][especial][event.id].limit - 1 | 272 | eventLib[etype][especial][event.id].limit = eventLib[etype][especial][event.id].limit - 1 |
| 266 | elseif eventLib[etype][especial][event.id].limit == 1 then | 273 | elseif eventLib[etype][especial][event.id].limit == 1 then |
| @@ -295,6 +302,7 @@ createMap = function(self, mapId, isEnter, isNewRelay) | @@ -295,6 +302,7 @@ createMap = function(self, mapId, isEnter, isNewRelay) | ||
| 295 | return false | 302 | return false |
| 296 | end | 303 | end |
| 297 | haveBoss = true | 304 | haveBoss = true |
| 305 | + self.haveBoss = true -- 刷新任务用的临时变量 | ||
| 298 | end | 306 | end |
| 299 | randomFunc[AdvEventType.LinkChoose] = function() | 307 | randomFunc[AdvEventType.LinkChoose] = function() |
| 300 | if haveLChoose then return false end | 308 | if haveLChoose then return false end |
| @@ -337,9 +345,6 @@ createMap = function(self, mapId, isEnter, isNewRelay) | @@ -337,9 +345,6 @@ createMap = function(self, mapId, isEnter, isNewRelay) | ||
| 337 | randomFunc[AdvEventType.Click] = randomCommon | 345 | randomFunc[AdvEventType.Click] = randomCommon |
| 338 | --跨层点 | 346 | --跨层点 |
| 339 | randomFunc[AdvEventType.Layer] = randomCommon | 347 | randomFunc[AdvEventType.Layer] = randomCommon |
| 340 | - --层级任务 | ||
| 341 | - randomFunc[AdvEventType.Task] = randomCommon | ||
| 342 | - | ||
| 343 | 348 | ||
| 344 | if randomFunc[etype] then | 349 | if randomFunc[etype] then |
| 345 | if randomFunc[etype]() ~= false then | 350 | if randomFunc[etype]() ~= false then |
| @@ -499,6 +504,7 @@ createMap = function(self, mapId, isEnter, isNewRelay) | @@ -499,6 +504,7 @@ createMap = function(self, mapId, isEnter, isNewRelay) | ||
| 499 | event.item = mapCsvData.clear:toArray(true, "=") --掉落钥匙 | 504 | event.item = mapCsvData.clear:toArray(true, "=") --掉落钥匙 |
| 500 | end | 505 | end |
| 501 | end | 506 | end |
| 507 | + self.adv.owner:setProperty("advLimit", eventLimit) | ||
| 502 | return mapInfo | 508 | return mapInfo |
| 503 | end | 509 | end |
| 504 | 510 | ||
| @@ -517,14 +523,14 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 | @@ -517,14 +523,14 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 | ||
| 517 | ["event_trapCsv"] = AdvEventType.Trap, | 523 | ["event_trapCsv"] = AdvEventType.Trap, |
| 518 | ["event_clickCsv"] = AdvEventType.Click, | 524 | ["event_clickCsv"] = AdvEventType.Click, |
| 519 | ["event_layerCsv"] = AdvEventType.Layer, | 525 | ["event_layerCsv"] = AdvEventType.Layer, |
| 520 | - ["event_questCsv"] = AdvEventType.Task, | ||
| 521 | ["event_linkchooseCsv"] = AdvEventType.LinkChoose, | 526 | ["event_linkchooseCsv"] = AdvEventType.LinkChoose, |
| 522 | - | ||
| 523 | } | 527 | } |
| 524 | local eventLib = {} | 528 | local eventLib = {} |
| 525 | 529 | ||
| 526 | local advEventOpenStatus = self.adv.owner:advEventOpenStatus() | 530 | local advEventOpenStatus = self.adv.owner:advEventOpenStatus() |
| 527 | 531 | ||
| 532 | + local eventLimit = self.adv.owner:getProperty("advLimit") | ||
| 533 | + | ||
| 528 | for lib, eventType in pairs(libsToType) do | 534 | for lib, eventType in pairs(libsToType) do |
| 529 | -- init eventLib | 535 | -- init eventLib |
| 530 | if type(eventType) == "table" then | 536 | if type(eventType) == "table" then |
| @@ -546,10 +552,24 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 | @@ -546,10 +552,24 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 | ||
| 546 | add = false | 552 | add = false |
| 547 | end | 553 | end |
| 548 | end | 554 | end |
| 555 | + | ||
| 556 | + -- data.limit 改为 整个冒险全程 | ||
| 557 | + local limit = data.limit | ||
| 558 | + if data.limit ~= 0 then | ||
| 559 | + limit = data.limit - ((eventLimit[etype] or {})[id] or 0) | ||
| 560 | + if limit <= 0 then | ||
| 561 | + add = false | ||
| 562 | + end | ||
| 563 | + end | ||
| 564 | + | ||
| 565 | + if add and (etype == AdvEventType.LinkChoose or etype == AdvEventType.Choose) then --只能有一次 | ||
| 566 | + limit = 1 | ||
| 567 | + end | ||
| 568 | + | ||
| 549 | if add then | 569 | if add then |
| 550 | if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then | 570 | if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then |
| 551 | eventLib[etype][data.BlockEventType] = eventLib[etype][data.BlockEventType] or {} | 571 | eventLib[etype][data.BlockEventType] = eventLib[etype][data.BlockEventType] or {} |
| 552 | - eventLib[etype][data.BlockEventType][id] = {showup = data.showup, limit = data.limit} | 572 | + eventLib[etype][data.BlockEventType][id] = {showup = data.showup, limit = limit, dlimit = data.limit} |
| 553 | end | 573 | end |
| 554 | end | 574 | end |
| 555 | end | 575 | end |
src/adv/AdvPassive.lua
| @@ -447,7 +447,7 @@ function Passive:effect8(dropId) | @@ -447,7 +447,7 @@ function Passive:effect8(dropId) | ||
| 447 | skynet.error(string.format("CSVDATA Error adv_map_passive %s effect 8 not id %s in event_drop", self.id, dropId)) | 447 | skynet.error(string.format("CSVDATA Error adv_map_passive %s effect 8 not id %s in event_drop", self.id, dropId)) |
| 448 | end | 448 | end |
| 449 | local item = dropData["range"]:randWeight(true) | 449 | local item = dropData["range"]:randWeight(true) |
| 450 | - self.owner.battle.adv:award({[item[1]] = item[2]}) | 450 | + self.owner.battle.adv:award({[item[1]] = item[2]}, {log = {desc = "passive", int1 = self.id}}) |
| 451 | end | 451 | end |
| 452 | 452 | ||
| 453 | --9=直接获得item(可在结算触发时使用) | 453 | --9=直接获得item(可在结算触发时使用) |
| @@ -461,13 +461,13 @@ function Passive:effect9(itemId, triggerPms, ratio, max) | @@ -461,13 +461,13 @@ function Passive:effect9(itemId, triggerPms, ratio, max) | ||
| 461 | return | 461 | return |
| 462 | end | 462 | end |
| 463 | if not cond then return end | 463 | if not cond then return end |
| 464 | - self.owner.battle.adv:award({[itemId] = math.floor(math.max(0, math.min(max, cond / ratio)))}) | 464 | + self.owner.battle.adv:award({[itemId] = math.floor(math.max(0, math.min(max, cond / ratio)))}, {log = {desc = "passive", int1 = self.id}}) |
| 465 | end | 465 | end |
| 466 | 466 | ||
| 467 | --10=战斗额外掉落次数 | 467 | --10=战斗额外掉落次数 |
| 468 | function Passive:effect10(count, triggerPms) | 468 | function Passive:effect10(count, triggerPms) |
| 469 | if triggerPms.count then | 469 | if triggerPms.count then |
| 470 | - self.owner.battle.adv:award({[triggerPms.itemId] = triggerPms.count * count}) | 470 | + self.owner.battle.adv:award({[triggerPms.itemId] = triggerPms.count * count}, {log = {desc = "passive", int1 = self.id}}) |
| 471 | end | 471 | end |
| 472 | end | 472 | end |
| 473 | 473 |
src/adv/AdvPlayer.lua
| @@ -252,7 +252,7 @@ function BaseObject:getBuffEffectChange(classify) | @@ -252,7 +252,7 @@ function BaseObject:getBuffEffectChange(classify) | ||
| 252 | end | 252 | end |
| 253 | local effect = 0 | 253 | local effect = 0 |
| 254 | for _, buff in ipairs(self.buffs) do | 254 | for _, buff in ipairs(self.buffs) do |
| 255 | - if not buff.isDel and buff:getType() == Buff_EFFECT_CHANGE then | 255 | + if not buff.isDel and buff:getType() == Buff.Buff_EFFECT_CHANGE then |
| 256 | local cType, value = buff:effect() | 256 | local cType, value = buff:effect() |
| 257 | if cType and had[cType] then | 257 | if cType and had[cType] then |
| 258 | effect = effect + value | 258 | effect = effect + value |
src/adv/AdvTask.lua
| @@ -83,6 +83,7 @@ function AdvTask.bind(Adv) | @@ -83,6 +83,7 @@ function AdvTask.bind(Adv) | ||
| 83 | end | 83 | end |
| 84 | end | 84 | end |
| 85 | end | 85 | end |
| 86 | + self:addTask() | ||
| 86 | end | 87 | end |
| 87 | 88 | ||
| 88 | function Adv:checkTask(taskType, count, cond) | 89 | function Adv:checkTask(taskType, count, cond) |
| @@ -109,7 +110,26 @@ function AdvTask.bind(Adv) | @@ -109,7 +110,26 @@ function AdvTask.bind(Adv) | ||
| 109 | end | 110 | end |
| 110 | 111 | ||
| 111 | -- 点击任务地块领取任务 | 112 | -- 点击任务地块领取任务 |
| 112 | - function Adv:addTask(taskId) | 113 | + function Adv:addTask() |
| 114 | + if self.isRelay or self.haveBoss then return end | ||
| 115 | + | ||
| 116 | + local chapterId, level = self.chapterId, self.level | ||
| 117 | + if self:isEndless() then | ||
| 118 | + level = AdvCommon.getEndlessDataLv(chapterId, level) | ||
| 119 | + end | ||
| 120 | + local advEventOpenStatus = self.owner:advEventOpenStatus() | ||
| 121 | + local pool = {} | ||
| 122 | + for id, data in pairs(csvdb["event_questCsv"]) do | ||
| 123 | + if data.levelchapter == chapterId and (data.unlockType == 0 or (advEventOpenStatus[etype] or {})[data.unlockType]) then | ||
| 124 | + if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then | ||
| 125 | + pool[id] = {showup = data.showup} | ||
| 126 | + end | ||
| 127 | + end | ||
| 128 | + end | ||
| 129 | + | ||
| 130 | + if not next(pool) then return end | ||
| 131 | + | ||
| 132 | + local taskId = math.randWeight(pool, "showup") | ||
| 113 | local taskData = csvdb["event_questCsv"][taskId] | 133 | local taskData = csvdb["event_questCsv"][taskId] |
| 114 | if taskData then | 134 | if taskData then |
| 115 | self.advTask[taskId] = 0 | 135 | self.advTask[taskId] = 0 |
| @@ -137,7 +157,7 @@ function AdvTask.bind(Adv) | @@ -137,7 +157,7 @@ function AdvTask.bind(Adv) | ||
| 137 | 157 | ||
| 138 | local item = csvdb["event_dropCsv"][taskData.drop]["range"]:randWeight(true) | 158 | local item = csvdb["event_dropCsv"][taskData.drop]["range"]:randWeight(true) |
| 139 | reward[item[1]] = (reward[item[1]] or 0) + item[2] | 159 | reward[item[1]] = (reward[item[1]] or 0) + item[2] |
| 140 | - reward = self:award(reward) | 160 | + reward = self:award(reward, {log = {desc = "finishTask", int1 = taskId}}) |
| 141 | 161 | ||
| 142 | self:scoreChange(AdvScoreType.Task, taskData.advScore) --增加加分 | 162 | self:scoreChange(AdvScoreType.Task, taskData.advScore) --增加加分 |
| 143 | 163 | ||
| @@ -155,7 +175,7 @@ function AdvTask.bind(Adv) | @@ -155,7 +175,7 @@ function AdvTask.bind(Adv) | ||
| 155 | local mainTaskData = csvdb["adv_questCsv"][self.advMTask.id] | 175 | local mainTaskData = csvdb["adv_questCsv"][self.advMTask.id] |
| 156 | if not mainTaskData then return end | 176 | if not mainTaskData then return end |
| 157 | if mainTaskData.reward == 1 then | 177 | if mainTaskData.reward == 1 then |
| 158 | - reward = self.owner:award(mainTaskData.rewardValue) | 178 | + reward = self.owner:award(mainTaskData.rewardValue, {log = {desc = "advMainTask", int1 = self.advMTask.id}}) |
| 159 | end | 179 | end |
| 160 | self.advMTask.id = self.advMTask.id + 1 | 180 | self.advMTask.id = self.advMTask.id + 1 |
| 161 | self.advMTask.status = 0 | 181 | self.advMTask.status = 0 |
| @@ -347,7 +367,7 @@ function AdvTask.bind(Adv) | @@ -347,7 +367,7 @@ function AdvTask.bind(Adv) | ||
| 347 | insertChange(chapterId, -1, count) | 367 | insertChange(chapterId, -1, count) |
| 348 | 368 | ||
| 349 | -- 发放奖励 | 369 | -- 发放奖励 |
| 350 | - reward = self.owner:award(achievData.reward) | 370 | + reward = self.owner:award(achievData.reward, {log = {desc = "advAchiev", int1 = chapterId, int2 = taskId}}) |
| 351 | return true, reward | 371 | return true, reward |
| 352 | end | 372 | end |
| 353 | end | 373 | end |
| @@ -359,7 +379,7 @@ function AdvTask.bind(Adv) | @@ -359,7 +379,7 @@ function AdvTask.bind(Adv) | ||
| 359 | local status = ((self.owner:getProperty(achievField)[chapterId] or {})["pts"] or {})[taskId] or 0 | 379 | local status = ((self.owner:getProperty(achievField)[chapterId] or {})["pts"] or {})[taskId] or 0 |
| 360 | if status == -1 or count < achievData.pt then return end | 380 | if status == -1 or count < achievData.pt then return end |
| 361 | 381 | ||
| 362 | - local reward = self.owner:award(achievData.reward) | 382 | + local reward = self.owner:award(achievData.reward, {log = {desc = "advAchievReward", int1 = chapterId, int2 = taskId}}) |
| 363 | insertChange(chapterId, taskId, -1, true) | 383 | insertChange(chapterId, taskId, -1, true) |
| 364 | return true, reward | 384 | return true, reward |
| 365 | end | 385 | end |
src/agent.lua
| @@ -39,6 +39,7 @@ local function handle_timeout() | @@ -39,6 +39,7 @@ local function handle_timeout() | ||
| 39 | end | 39 | end |
| 40 | 40 | ||
| 41 | function start_agent_timer() | 41 | function start_agent_timer() |
| 42 | + if agentInfo.open_timer then return end | ||
| 42 | agentInfo.open_timer = true | 43 | agentInfo.open_timer = true |
| 43 | skynet.timeout(150, handle_timeout) | 44 | skynet.timeout(150, handle_timeout) |
| 44 | end | 45 | end |
| @@ -186,7 +187,18 @@ skynet.register_protocol { | @@ -186,7 +187,18 @@ skynet.register_protocol { | ||
| 186 | end | 187 | end |
| 187 | 188 | ||
| 188 | if #data > 0 then data = xxtea.decrypt(data, XXTEA_KEY) end | 189 | if #data > 0 then data = xxtea.decrypt(data, XXTEA_KEY) end |
| 190 | + | ||
| 191 | + -- 一次操作是一个关联操作 记录 ucode 是一样的 | ||
| 192 | + if agentInfo.role then | ||
| 193 | + agentInfo.role:startActionUcode() | ||
| 194 | + end | ||
| 195 | + | ||
| 189 | local result = method(agentInfo, data) | 196 | local result = method(agentInfo, data) |
| 197 | + | ||
| 198 | + if agentInfo.role then | ||
| 199 | + agentInfo.role:endActionUcode() | ||
| 200 | + end | ||
| 201 | + | ||
| 190 | if not result or type(result) == "number" then | 202 | if not result or type(result) == "number" then |
| 191 | SendPacket(actionCodes.Sys_innerErrorMsg, MsgPack.pack({id = cmd * 100 + (result or 0)})) | 203 | SendPacket(actionCodes.Sys_innerErrorMsg, MsgPack.pack({id = cmd * 100 + (result or 0)})) |
| 192 | end | 204 | end |
| @@ -275,7 +287,12 @@ local function routeGM(cmd, params) | @@ -275,7 +287,12 @@ local function routeGM(cmd, params) | ||
| 275 | return "指令失败" | 287 | return "指令失败" |
| 276 | end | 288 | end |
| 277 | local _M = require "actions.GmAction" | 289 | local _M = require "actions.GmAction" |
| 278 | - return _M[cmd](agentInfo.role, params) | 290 | + |
| 291 | + agentInfo.role:startActionUcode() | ||
| 292 | + local status = _M[cmd](agentInfo.role, params) | ||
| 293 | + agentInfo.role:endActionUcode() | ||
| 294 | + | ||
| 295 | + return status | ||
| 279 | end | 296 | end |
| 280 | 297 | ||
| 281 | skynet.start(function() | 298 | skynet.start(function() |
src/models/Diner.lua
| @@ -266,7 +266,7 @@ function Diner:expediteSell(slot) | @@ -266,7 +266,7 @@ function Diner:expediteSell(slot) | ||
| 266 | end | 266 | end |
| 267 | local dishData = csvdb["diner_dishCsv"][sell.dish][sell.level] | 267 | local dishData = csvdb["diner_dishCsv"][sell.dish][sell.level] |
| 268 | local expediteCount = 0 | 268 | local expediteCount = 0 |
| 269 | - local expediteTime = 7200 | 269 | + local expediteTime = globalCsv.diner_sell_expediteTime |
| 270 | local sellTime = dishData.sell_time | 270 | local sellTime = dishData.sell_time |
| 271 | expediteCount = math.floor(expediteTime / sellTime) | 271 | expediteCount = math.floor(expediteTime / sellTime) |
| 272 | expediteCount = math.min(expediteCount, sell.count) | 272 | expediteCount = math.min(expediteCount, sell.count) |
src/models/HeroPlugin.lua
| @@ -3,6 +3,17 @@ local HeroPlugin = {} | @@ -3,6 +3,17 @@ local HeroPlugin = {} | ||
| 3 | 3 | ||
| 4 | function HeroPlugin.bind(Hero) | 4 | function HeroPlugin.bind(Hero) |
| 5 | 5 | ||
| 6 | + function Hero:log(contents) | ||
| 7 | + contents = contents or {} | ||
| 8 | + if contents["cint1"] or contents["cint2"] or contents["cint3"] then | ||
| 9 | + print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 10 | + end | ||
| 11 | + contents["cint1"] = self:getProperty("id") | ||
| 12 | + contents["cint2"] = self:getProperty("type") | ||
| 13 | + | ||
| 14 | + self.owner:log("hero_action", contents) | ||
| 15 | + end | ||
| 16 | + | ||
| 6 | function Hero:getMaxLevel() | 17 | function Hero:getMaxLevel() |
| 7 | return math.min(#csvdb["unit_expCsv"], csvdb["unit_breakCsv"][self:getProperty("breakL")].levelLimit) | 18 | return math.min(#csvdb["unit_expCsv"], csvdb["unit_breakCsv"][self:getProperty("breakL")].levelLimit) |
| 8 | end | 19 | end |
src/models/Role.lua
| @@ -83,6 +83,7 @@ Role.schema = { | @@ -83,6 +83,7 @@ Role.schema = { | ||
| 83 | advEAchiev = {"table", {}}, -- 冒险无尽冒险手册 | 83 | advEAchiev = {"table", {}}, -- 冒险无尽冒险手册 |
| 84 | advRelay = {"table", {}}, -- 冒险中继点记录 {[chapter] = {[level] = 1}, [-1] = {[level] = 1}} -- -1 无尽 方便重置 | 84 | advRelay = {"table", {}}, -- 冒险中继点记录 {[chapter] = {[level] = 1}, [-1] = {[level] = 1}} -- -1 无尽 方便重置 |
| 85 | advSup = {"table", {}}, -- 冒险支援效果 待选项 | 85 | advSup = {"table", {}}, -- 冒险支援效果 待选项 |
| 86 | + advLimit = {"table", {}}, -- 冒险事件每次的limit | ||
| 86 | 87 | ||
| 87 | --挂机相关 | 88 | --挂机相关 |
| 88 | hangPass = {"table", {}}, -- 挂机通过的最大关卡 | 89 | hangPass = {"table", {}}, -- 挂机通过的最大关卡 |
src/models/RoleCross.lua
| @@ -73,7 +73,7 @@ RoleCross.bind = function (Role) | @@ -73,7 +73,7 @@ RoleCross.bind = function (Role) | ||
| 73 | for k , v in pairs(initData.items or {}) do | 73 | for k , v in pairs(initData.items or {}) do |
| 74 | reward[tonumber(k)] = v | 74 | reward[tonumber(k)] = v |
| 75 | end | 75 | end |
| 76 | - self:award(reward) | 76 | + self:award(reward, {log = {desc = "gm"}}) |
| 77 | 77 | ||
| 78 | -- 英雄 | 78 | -- 英雄 |
| 79 | local breakL = 0 | 79 | local breakL = 0 |
| @@ -95,7 +95,7 @@ RoleCross.bind = function (Role) | @@ -95,7 +95,7 @@ RoleCross.bind = function (Role) | ||
| 95 | local hero = self:isHaveHero(heroId) | 95 | local hero = self:isHaveHero(heroId) |
| 96 | local status | 96 | local status |
| 97 | if not hero then | 97 | if not hero then |
| 98 | - status, hero = self:addHero({type = heroId}) | 98 | + status, hero = self:addHero({type = heroId, log = {desc = "gm"}}) |
| 99 | else | 99 | else |
| 100 | status = true | 100 | status = true |
| 101 | end | 101 | end |
| @@ -103,7 +103,7 @@ RoleCross.bind = function (Role) | @@ -103,7 +103,7 @@ RoleCross.bind = function (Role) | ||
| 103 | local rune = "" | 103 | local rune = "" |
| 104 | for slot , runeId in pairs(initData.heros.rune) do | 104 | for slot , runeId in pairs(initData.heros.rune) do |
| 105 | slot = tonumber(slot) | 105 | slot = tonumber(slot) |
| 106 | - local status, rune_ = self:addRune({type = slot, id = runeId}) | 106 | + local status, rune_ = self:addRune({type = slot, id = runeId, log = {desc = "gm"}}) |
| 107 | if status == 0 then | 107 | if status == 0 then |
| 108 | rune = rune:setv(slot, rune_:getProperty("uid")) | 108 | rune = rune:setv(slot, rune_:getProperty("uid")) |
| 109 | if initData.heros.runeL and initData.heros.runeL > 0 then | 109 | if initData.heros.runeL and initData.heros.runeL > 0 then |
src/models/RoleLog.lua
| @@ -4,7 +4,34 @@ local LogType = { | @@ -4,7 +4,34 @@ local LogType = { | ||
| 4 | create = "common", | 4 | create = "common", |
| 5 | login = "common", | 5 | login = "common", |
| 6 | logout = "common", | 6 | logout = "common", |
| 7 | - gm = "common", | 7 | + guide = "common", |
| 8 | + | ||
| 9 | + in_item = "common", | ||
| 10 | + out_item = "common", | ||
| 11 | + in_diamond = "common", | ||
| 12 | + out_diamond = "common", | ||
| 13 | + in_hero = "common", | ||
| 14 | + out_hero = "common", | ||
| 15 | + in_equip = "common", | ||
| 16 | + out_equip = "common", | ||
| 17 | + in_rune = "common", | ||
| 18 | + out_rune = "common", | ||
| 19 | + player_exp = "common", | ||
| 20 | + func_open = "common", | ||
| 21 | + in_adv = "common", | ||
| 22 | + out_adv = "common", | ||
| 23 | + in_artifact = "common", | ||
| 24 | + | ||
| 25 | + mail_action = "common", | ||
| 26 | + role_action = "common", | ||
| 27 | + hang_action = "common", | ||
| 28 | + hero_action = "common", | ||
| 29 | + adv_action = "common", | ||
| 30 | + rune_action = "common", | ||
| 31 | + pvp_action = "common", | ||
| 32 | + diner_action = "common", | ||
| 33 | + tower_action = "common", | ||
| 34 | + gm_action = "common", | ||
| 8 | } | 35 | } |
| 9 | 36 | ||
| 10 | -- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* | 37 | -- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* |
| @@ -23,6 +50,11 @@ local Mapping = { | @@ -23,6 +50,11 @@ local Mapping = { | ||
| 23 | int2 = "integer", | 50 | int2 = "integer", |
| 24 | long1 = "long", | 51 | long1 = "long", |
| 25 | float1 = "float", | 52 | float1 = "float", |
| 53 | + | ||
| 54 | + -- 底层使用的 一些参数 | ||
| 55 | + cint1 = "integer", | ||
| 56 | + cint2 = "integer", | ||
| 57 | + cint3 = "integer", | ||
| 26 | } | 58 | } |
| 27 | } | 59 | } |
| 28 | 60 | ||
| @@ -156,6 +188,9 @@ function RoleLog.bind(Role) | @@ -156,6 +188,9 @@ function RoleLog.bind(Role) | ||
| 156 | end | 188 | end |
| 157 | 189 | ||
| 158 | local mapping = Mapping[_logType] | 190 | local mapping = Mapping[_logType] |
| 191 | + if mapping["ucode"] and not contents["ucode"] then | ||
| 192 | + contents["ucode"] = self:getActionUcode() | ||
| 193 | + end | ||
| 159 | 194 | ||
| 160 | for field, value in pairs(contents) do | 195 | for field, value in pairs(contents) do |
| 161 | local ftype = mapping[field] | 196 | local ftype = mapping[field] |
| @@ -168,5 +203,24 @@ function RoleLog.bind(Role) | @@ -168,5 +203,24 @@ function RoleLog.bind(Role) | ||
| 168 | if not logd then return end | 203 | if not logd then return end |
| 169 | pcall(skynet.send, logd, "lua", "log", logType, doc, _logType) | 204 | pcall(skynet.send, logd, "lua", "log", logType, doc, _logType) |
| 170 | end | 205 | end |
| 206 | + | ||
| 207 | + function Role:startActionUcode() | ||
| 208 | + if not self._uniqueCount then | ||
| 209 | + self._uniqueCount = 0 | ||
| 210 | + end | ||
| 211 | + local action = {self:getProperty("id"), skynet.timex(), self._uniqueCount} | ||
| 212 | + self._uniqueCount = self._uniqueCount + 1 | ||
| 213 | + | ||
| 214 | + self._actionUcode = table.concat(action, "_") | ||
| 215 | + end | ||
| 216 | + | ||
| 217 | + function Role:endActionUcode() | ||
| 218 | + self._actionUcode = nil | ||
| 219 | + end | ||
| 220 | + | ||
| 221 | + function Role:getActionUcode() | ||
| 222 | + return self._actionUcode | ||
| 223 | + end | ||
| 224 | + | ||
| 171 | end | 225 | end |
| 172 | return RoleLog | 226 | return RoleLog |
| 173 | \ No newline at end of file | 227 | \ No newline at end of file |
src/models/RolePlugin.lua
| @@ -59,7 +59,7 @@ function RolePlugin.bind(Role) | @@ -59,7 +59,7 @@ function RolePlugin.bind(Role) | ||
| 59 | 59 | ||
| 60 | local itemIdAward = { | 60 | local itemIdAward = { |
| 61 | [ItemId.PlayerExp] = function() | 61 | [ItemId.PlayerExp] = function() |
| 62 | - self:addPlayExp(count) | 62 | + self:addPlayExp(count, pms) |
| 63 | end, | 63 | end, |
| 64 | } | 64 | } |
| 65 | 65 | ||
| @@ -80,14 +80,14 @@ function RolePlugin.bind(Role) | @@ -80,14 +80,14 @@ function RolePlugin.bind(Role) | ||
| 80 | [ItemType.Rune] = function() | 80 | [ItemType.Rune] = function() |
| 81 | local typ = math.floor((itemId-10000)/1000) | 81 | local typ = math.floor((itemId-10000)/1000) |
| 82 | for _= 1, count do | 82 | for _= 1, count do |
| 83 | - self:addRune({type = typ,id = itemId, pms.notNotify}) | 83 | + self:addRune({type = typ,id = itemId, notNotify = pms.notNotify, log = pms.log}) |
| 84 | end | 84 | end |
| 85 | end, | 85 | end, |
| 86 | [ItemType.AdvItem] = function() --冒险道具不会进入 玩家仓库 | 86 | [ItemType.AdvItem] = function() --冒险道具不会进入 玩家仓库 |
| 87 | count = 0 | 87 | count = 0 |
| 88 | end, | 88 | end, |
| 89 | [ItemType.FuncOpen] = function() | 89 | [ItemType.FuncOpen] = function() |
| 90 | - self:funcOpen(itemId, count) | 90 | + self:funcOpen(itemId, count, pms) |
| 91 | end, | 91 | end, |
| 92 | } | 92 | } |
| 93 | -- 对数量筛查 | 93 | -- 对数量筛查 |
| @@ -139,7 +139,7 @@ function RolePlugin.bind(Role) | @@ -139,7 +139,7 @@ function RolePlugin.bind(Role) | ||
| 139 | return reward, allChange --实际获得的奖励 和 最高级奖励转化过程 | 139 | return reward, allChange --实际获得的奖励 和 最高级奖励转化过程 |
| 140 | end | 140 | end |
| 141 | 141 | ||
| 142 | - function Role:addPlayExp(addExp) | 142 | + function Role:addPlayExp(addExp, params) |
| 143 | local level = self:getProperty("level") | 143 | local level = self:getProperty("level") |
| 144 | if not csvdb["player_expCsv"][level + 1] then | 144 | if not csvdb["player_expCsv"][level + 1] then |
| 145 | return | 145 | return |
| @@ -155,6 +155,22 @@ function RolePlugin.bind(Role) | @@ -155,6 +155,22 @@ function RolePlugin.bind(Role) | ||
| 155 | newExp = csvdb["player_expCsv"][level].exp - 1 -- 没有下一级了 经验溢出太多 扣除 | 155 | newExp = csvdb["player_expCsv"][level].exp - 1 -- 没有下一级了 经验溢出太多 扣除 |
| 156 | end | 156 | end |
| 157 | end | 157 | end |
| 158 | + | ||
| 159 | + if params.log then | ||
| 160 | + local log = clone(params.log) | ||
| 161 | + if log["cint1"] or log["cint2"] then | ||
| 162 | + print("addPlayExp error log have cint1 or cint2 or cint3", debug.traceback()) | ||
| 163 | + end | ||
| 164 | + | ||
| 165 | + log["cint1"] = addExp | ||
| 166 | + log["cint2"] = newExp | ||
| 167 | + log["cint3"] = level | ||
| 168 | + | ||
| 169 | + self:log("player_exp", log) | ||
| 170 | + else | ||
| 171 | + print("addPlayExp no log ", debug.traceback()) | ||
| 172 | + end | ||
| 173 | + | ||
| 158 | self:updateProperties({level = level, exp = newExp}) | 174 | self:updateProperties({level = level, exp = newExp}) |
| 159 | self:changeCrossServerPvpSelfInfo("level") | 175 | self:changeCrossServerPvpSelfInfo("level") |
| 160 | end | 176 | end |
| @@ -174,6 +190,23 @@ function RolePlugin.bind(Role) | @@ -174,6 +190,23 @@ function RolePlugin.bind(Role) | ||
| 174 | else | 190 | else |
| 175 | items = items:incrv(params.itemId, params.count) | 191 | items = items:incrv(params.itemId, params.count) |
| 176 | end | 192 | end |
| 193 | + | ||
| 194 | + if params.log then | ||
| 195 | + local log = clone(params.log) | ||
| 196 | + if log["cint1"] or log["cint2"] then | ||
| 197 | + print("addItem error log have cint1 or cint2 ", debug.traceback()) | ||
| 198 | + end | ||
| 199 | + log["cint1"] = params.itemId | ||
| 200 | + log["cint2"] = math.abs(params.count) | ||
| 201 | + if params.count <= 0 then | ||
| 202 | + self:log("out_item", log) | ||
| 203 | + else | ||
| 204 | + self:log("in_item", log) | ||
| 205 | + end | ||
| 206 | + else | ||
| 207 | + print("addItem no log ", debug.traceback()) | ||
| 208 | + end | ||
| 209 | + | ||
| 177 | self:setProperty("items", items) | 210 | self:setProperty("items", items) |
| 178 | if not params.notNotify then | 211 | if not params.notNotify then |
| 179 | SendPacket(actionCodes.Role_updateItems, MsgPack.pack({[params.itemId] = nums})) | 212 | SendPacket(actionCodes.Role_updateItems, MsgPack.pack({[params.itemId] = nums})) |
| @@ -241,6 +274,19 @@ function RolePlugin.bind(Role) | @@ -241,6 +274,19 @@ function RolePlugin.bind(Role) | ||
| 241 | else | 274 | else |
| 242 | self:incrProperty("diamond", count) | 275 | self:incrProperty("diamond", count) |
| 243 | end | 276 | end |
| 277 | + | ||
| 278 | + if params.log then | ||
| 279 | + local log = clone(params.log) | ||
| 280 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 281 | + print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 282 | + end | ||
| 283 | + log["cint1"] = origin | ||
| 284 | + log["cint2"] = count | ||
| 285 | + self:log("in_diamond", log) | ||
| 286 | + else | ||
| 287 | + print("gainDiamond no log ", debug.traceback()) | ||
| 288 | + end | ||
| 289 | + | ||
| 244 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) | 290 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) |
| 245 | return true | 291 | return true |
| 246 | end | 292 | end |
| @@ -277,6 +323,18 @@ function RolePlugin.bind(Role) | @@ -277,6 +323,18 @@ function RolePlugin.bind(Role) | ||
| 277 | self:incrProperty(costFirst[2], -last) | 323 | self:incrProperty(costFirst[2], -last) |
| 278 | end | 324 | end |
| 279 | 325 | ||
| 326 | + if params.log then | ||
| 327 | + local log = clone(params.log) | ||
| 328 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 329 | + print("costDiamond error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 330 | + end | ||
| 331 | + log["cint1"] = origin | ||
| 332 | + log["cint2"] = count | ||
| 333 | + self:log("out_diamond", log) | ||
| 334 | + else | ||
| 335 | + print("costDiamond no log ", debug.traceback()) | ||
| 336 | + end | ||
| 337 | + | ||
| 280 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) | 338 | self:notifyUpdateProperty("diamond", self:getAllDiamond()) |
| 281 | return true | 339 | return true |
| 282 | end | 340 | end |
| @@ -311,6 +369,17 @@ function RolePlugin.bind(Role) | @@ -311,6 +369,17 @@ function RolePlugin.bind(Role) | ||
| 311 | local bin = MsgPack.pack(heroResponse) | 369 | local bin = MsgPack.pack(heroResponse) |
| 312 | SendPacket(actionCodes.Hero_loadInfos, bin) | 370 | SendPacket(actionCodes.Hero_loadInfos, bin) |
| 313 | end | 371 | end |
| 372 | + if params.log then | ||
| 373 | + local log = clone(params.log) | ||
| 374 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 375 | + print("addHero error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 376 | + end | ||
| 377 | + log["cint1"] = heroId | ||
| 378 | + log["cint2"] = heroType | ||
| 379 | + self:log("in_hero", log) | ||
| 380 | + else | ||
| 381 | + print("addHero no log ", debug.traceback()) | ||
| 382 | + end | ||
| 314 | return true, newHero | 383 | return true, newHero |
| 315 | end | 384 | end |
| 316 | 385 | ||
| @@ -323,9 +392,11 @@ function RolePlugin.bind(Role) | @@ -323,9 +392,11 @@ function RolePlugin.bind(Role) | ||
| 323 | end | 392 | end |
| 324 | end | 393 | end |
| 325 | 394 | ||
| 326 | - function Role:delHero(heroId) | 395 | + function Role:delHero(heroId, params) |
| 396 | + params = params or {} | ||
| 327 | local roleId = self:getProperty('id') | 397 | local roleId = self:getProperty('id') |
| 328 | local hero = self.heros[heroId] | 398 | local hero = self.heros[heroId] |
| 399 | + local heroType = hero:getProperty("type") | ||
| 329 | if not hero then return end | 400 | if not hero then return end |
| 330 | 401 | ||
| 331 | self.heros[heroId] = nil | 402 | self.heros[heroId] = nil |
| @@ -333,6 +404,19 @@ function RolePlugin.bind(Role) | @@ -333,6 +404,19 @@ function RolePlugin.bind(Role) | ||
| 333 | red:del(string.format(R_HERO, roleId, heroId)) | 404 | red:del(string.format(R_HERO, roleId, heroId)) |
| 334 | red:srem(string.format(R_HEROS, roleId), heroId) | 405 | red:srem(string.format(R_HEROS, roleId), heroId) |
| 335 | end) | 406 | end) |
| 407 | + | ||
| 408 | + if params.log then | ||
| 409 | + local log = clone(params.log) | ||
| 410 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 411 | + print("delHero error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 412 | + end | ||
| 413 | + log["cint1"] = heroId | ||
| 414 | + log["cint2"] = heroType | ||
| 415 | + self:log("out_hero", log) | ||
| 416 | + else | ||
| 417 | + print("delHero no log ", debug.traceback()) | ||
| 418 | + end | ||
| 419 | + | ||
| 336 | SendPacket(actionCodes.Hero_loadInfos, MsgPack.pack({{id = heroId, bDel = true}})) | 420 | SendPacket(actionCodes.Hero_loadInfos, MsgPack.pack({{id = heroId, bDel = true}})) |
| 337 | end | 421 | end |
| 338 | 422 | ||
| @@ -406,6 +490,24 @@ function RolePlugin.bind(Role) | @@ -406,6 +490,24 @@ function RolePlugin.bind(Role) | ||
| 406 | end | 490 | end |
| 407 | 491 | ||
| 408 | self:setProperty("equips", equips) | 492 | self:setProperty("equips", equips) |
| 493 | + | ||
| 494 | + if pms.log then | ||
| 495 | + local log = clone(pms.log) | ||
| 496 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 497 | + print("addEquip error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 498 | + end | ||
| 499 | + log["cint1"] = equipType | ||
| 500 | + log["cint2"] = equipLv | ||
| 501 | + log["cint3"] = math.abs(count) | ||
| 502 | + if count < 0 then | ||
| 503 | + self:log("out_equip", log) | ||
| 504 | + else | ||
| 505 | + self:log("in_equip", log) | ||
| 506 | + end | ||
| 507 | + else | ||
| 508 | + print("addEquip no log ", debug.traceback()) | ||
| 509 | + end | ||
| 510 | + | ||
| 409 | if not pms.notNotify then | 511 | if not pms.notNotify then |
| 410 | self:changeUpdates({{type = "equips", field = {equipType, equipLv}, value = curCount, isOnlyToC = true}}) -- 通知客户端 | 512 | self:changeUpdates({{type = "equips", field = {equipType, equipLv}, value = curCount, isOnlyToC = true}}) -- 通知客户端 |
| 411 | end | 513 | end |
| @@ -463,18 +565,51 @@ function RolePlugin.bind(Role) | @@ -463,18 +565,51 @@ function RolePlugin.bind(Role) | ||
| 463 | SendPacket(actionCodes.Role_loadRunes, MsgPack.pack(response)) | 565 | SendPacket(actionCodes.Role_loadRunes, MsgPack.pack(response)) |
| 464 | end | 566 | end |
| 465 | self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) | 567 | self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) |
| 568 | + | ||
| 569 | + if params.log then | ||
| 570 | + local log = clone(params.log) | ||
| 571 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 572 | + print("addRune error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 573 | + end | ||
| 574 | + | ||
| 575 | + log["cint1"] = runeUid | ||
| 576 | + log["cint2"] = params.type | ||
| 577 | + log["cint3"] = params.id | ||
| 578 | + | ||
| 579 | + self:log("in_rune", log) | ||
| 580 | + else | ||
| 581 | + print("addRune no log ", debug.traceback()) | ||
| 582 | + end | ||
| 583 | + | ||
| 466 | return 0, newRune | 584 | return 0, newRune |
| 467 | else | 585 | else |
| 468 | return 1 | 586 | return 1 |
| 469 | end | 587 | end |
| 470 | end | 588 | end |
| 471 | 589 | ||
| 472 | - function Role:delRunes(runeIds) -- 批量删除 {id, } | 590 | + function Role:delRunes(runeIds, params) -- 批量删除 {id, } |
| 591 | + params = params or {} | ||
| 473 | local roleId = self:getProperty('id') | 592 | local roleId = self:getProperty('id') |
| 474 | local bDel = {} | 593 | local bDel = {} |
| 475 | for _, runeId in pairs(runeIds) do | 594 | for _, runeId in pairs(runeIds) do |
| 476 | local rune = self.runeBag[runeId] | 595 | local rune = self.runeBag[runeId] |
| 477 | if rune and rune:getProperty("refer") == 0 then | 596 | if rune and rune:getProperty("refer") == 0 then |
| 597 | + | ||
| 598 | + if params.log then | ||
| 599 | + local log = clone(params.log) | ||
| 600 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 601 | + print("delRunes error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 602 | + end | ||
| 603 | + | ||
| 604 | + log["cint1"] = runeId | ||
| 605 | + log["cint2"] = rune:getProperty("type") | ||
| 606 | + log["cint3"] = rune:getProperty("id") | ||
| 607 | + | ||
| 608 | + self:log("out_rune", log) | ||
| 609 | + else | ||
| 610 | + print("delRunes no log ", debug.traceback()) | ||
| 611 | + end | ||
| 612 | + | ||
| 478 | self.runeBag[runeId] = nil | 613 | self.runeBag[runeId] = nil |
| 479 | table.insert(bDel, runeId) | 614 | table.insert(bDel, runeId) |
| 480 | end | 615 | end |
| @@ -528,14 +663,13 @@ function RolePlugin.bind(Role) | @@ -528,14 +663,13 @@ function RolePlugin.bind(Role) | ||
| 528 | heartWarning = heartWarning + 1 | 663 | heartWarning = heartWarning + 1 |
| 529 | self:setProperty("heartWarning", heartWarning) | 664 | self:setProperty("heartWarning", heartWarning) |
| 530 | if heartWarning == 50 then | 665 | if heartWarning == 50 then |
| 531 | - self:setProperty("delete", 1) | 666 | + self:setBan(30, 1) --封禁 30天 |
| 532 | self:sendGmMsg("server_accountBanned_inGame_1") | 667 | self:sendGmMsg("server_accountBanned_inGame_1") |
| 533 | - self:log("gm",{desc = "ban"}) | ||
| 534 | return | 668 | return |
| 535 | end | 669 | end |
| 536 | if heartWarning < 50 and heartWarning % 5 == 0 then | 670 | if heartWarning < 50 and heartWarning % 5 == 0 then |
| 537 | self:sendGmMsg("server_accountBanned_warning") | 671 | self:sendGmMsg("server_accountBanned_warning") |
| 538 | - self:log("gm",{desc = "heartWarning", int1 = heartWarning}) | 672 | + self:log("role_action",{desc = "heartWarning", int1 = heartWarning}) |
| 539 | end | 673 | end |
| 540 | end | 674 | end |
| 541 | 675 | ||
| @@ -548,11 +682,11 @@ function RolePlugin.bind(Role) | @@ -548,11 +682,11 @@ function RolePlugin.bind(Role) | ||
| 548 | self:setProperty("banType", 0) | 682 | self:setProperty("banType", 0) |
| 549 | self:setProperty("heartWarning", 0) | 683 | self:setProperty("heartWarning", 0) |
| 550 | 684 | ||
| 551 | - self:log("gm", {desc = "ban_rm"}) | 685 | + self:log("role_action", {desc = "ban_rm"}) |
| 552 | else | 686 | else |
| 553 | self:setProperty("banTime", now + 86400 * time) | 687 | self:setProperty("banTime", now + 86400 * time) |
| 554 | self:setProperty("banType", banType) | 688 | self:setProperty("banType", banType) |
| 555 | - self:log("gm",{desc = "ban", int1 = time, int2 = banType}) | 689 | + self:log("role_action", {desc = "ban", int1 = time, int2 = banType}) |
| 556 | end | 690 | end |
| 557 | end | 691 | end |
| 558 | 692 | ||
| @@ -687,8 +821,25 @@ function RolePlugin.bind(Role) | @@ -687,8 +821,25 @@ function RolePlugin.bind(Role) | ||
| 687 | return true | 821 | return true |
| 688 | end | 822 | end |
| 689 | 823 | ||
| 690 | - function Role:funcOpen(func, count) | 824 | + function Role:funcOpen(func, count, params) |
| 825 | + params = params or {} | ||
| 826 | + | ||
| 691 | count = count or 1 | 827 | count = count or 1 |
| 828 | + | ||
| 829 | + if params.log then | ||
| 830 | + local log = clone(params.log) | ||
| 831 | + if log["cint1"] or log["cint2"] or log["cint3"] then | ||
| 832 | + print("funcOpen error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 833 | + end | ||
| 834 | + | ||
| 835 | + log["cint1"] = func | ||
| 836 | + log["cint2"] = count | ||
| 837 | + | ||
| 838 | + self:log("func_open", log) | ||
| 839 | + else | ||
| 840 | + print("funcOpen no log ", debug.traceback()) | ||
| 841 | + end | ||
| 842 | + | ||
| 692 | if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then | 843 | if csvdb["itemCsv"][func] and csvdb["itemCsv"][func].type == ItemType.FuncOpen then |
| 693 | local unlockData = csvdb["unlockCsv"][func] | 844 | local unlockData = csvdb["unlockCsv"][func] |
| 694 | if unlockData.type == 4 then -- 解锁神器 | 845 | if unlockData.type == 4 then -- 解锁神器 |
src/models/RolePvp.lua
| @@ -467,7 +467,7 @@ function Role:getCrossServerPvpBetInfo() | @@ -467,7 +467,7 @@ function Role:getCrossServerPvpBetInfo() | ||
| 467 | end | 467 | end |
| 468 | end | 468 | end |
| 469 | 469 | ||
| 470 | -function Role:getCrossServerPvpBet(idx) | 470 | +function Role:setCrossServerPvpBet(idx) |
| 471 | if not self:isTimeResetOpen(TimeReset.PvpCross) then return end | 471 | if not self:isTimeResetOpen(TimeReset.PvpCross) then return end |
| 472 | local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) | 472 | local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) |
| 473 | local aday = 3600 * 24 | 473 | local aday = 3600 * 24 |
| @@ -486,7 +486,7 @@ function Role:getCrossServerPvpBet(idx) | @@ -486,7 +486,7 @@ function Role:getCrossServerPvpBet(idx) | ||
| 486 | local ok, result = pcall(skynet.call, pvpd, "lua", "setBet", idx) | 486 | local ok, result = pcall(skynet.call, pvpd, "lua", "setBet", idx) |
| 487 | if ok then | 487 | if ok then |
| 488 | if result then | 488 | if result then |
| 489 | - self:costItems(cost) | 489 | + self:costItems(cost, {log = {desc = "crossPvpBet", short1 = day}}) |
| 490 | pvpBet[day] = {idx, cost[ItemId.Gold]} | 490 | pvpBet[day] = {idx, cost[ItemId.Gold]} |
| 491 | self:setProperty("pvpBet", pvpBet) | 491 | self:setProperty("pvpBet", pvpBet) |
| 492 | end | 492 | end |
src/models/Rune.lua
| @@ -26,6 +26,18 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) | @@ -26,6 +26,18 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) | ||
| 26 | self:notifyUpdateProperties(datas) | 26 | self:notifyUpdateProperties(datas) |
| 27 | end | 27 | end |
| 28 | 28 | ||
| 29 | +function Rune:log(contents) | ||
| 30 | + contents = contents or {} | ||
| 31 | + if contents["cint1"] or contents["cint2"] or contents["cint3"] then | ||
| 32 | + print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback()) | ||
| 33 | + end | ||
| 34 | + contents["cint1"] = self:getProperty("uid") | ||
| 35 | + contents["cint2"] = self:getProperty("type") | ||
| 36 | + contents["cint3"] = self:getProperty("id") | ||
| 37 | + | ||
| 38 | + self.owner:log("rune_action", contents) | ||
| 39 | +end | ||
| 40 | + | ||
| 29 | function Rune:notifyUpdateProperties(params) | 41 | function Rune:notifyUpdateProperties(params) |
| 30 | local updateData = { | 42 | local updateData = { |
| 31 | uid = self:getProperty("uid"), | 43 | uid = self:getProperty("uid"), |
src/python/adv_season.py deleted
src/python/redisCommon.py deleted
| @@ -1,78 +0,0 @@ | @@ -1,78 +0,0 @@ | ||
| 1 | -from redis import Redis | ||
| 2 | -import msgpack | ||
| 3 | - | ||
| 4 | -redisConf = { | ||
| 5 | - "host" : "127.0.0.1", | ||
| 6 | - "port" : 6100, | ||
| 7 | - "db" : 1, | ||
| 8 | - "password" : None, | ||
| 9 | -} | ||
| 10 | - | ||
| 11 | - | ||
| 12 | -def numberUnpack(n) : | ||
| 13 | - if isinstance(n, bytes) : | ||
| 14 | - try: | ||
| 15 | - return int(n) | ||
| 16 | - except ValueError: | ||
| 17 | - try: | ||
| 18 | - return float(n) | ||
| 19 | - except ValueError: | ||
| 20 | - pass | ||
| 21 | - return n.decode() | ||
| 22 | - else : | ||
| 23 | - return n | ||
| 24 | - | ||
| 25 | -def stringUnpack(s) : | ||
| 26 | - if isinstance(s, bytes) : | ||
| 27 | - return n.decode() | ||
| 28 | - else : | ||
| 29 | - return s | ||
| 30 | - | ||
| 31 | -def tableUnpack(t) : | ||
| 32 | - if isinstance(t, bytes) : | ||
| 33 | - return msgpack.unpackb(t, raw = False) #解包 | ||
| 34 | - else : | ||
| 35 | - return t | ||
| 36 | - | ||
| 37 | -redisUnpack = { | ||
| 38 | - "number" : numberUnpack, | ||
| 39 | - "string" : stringUnpack, | ||
| 40 | - "table" : tableUnpack, | ||
| 41 | - "default" : numberUnpack, | ||
| 42 | -} | ||
| 43 | -def commonPack(w) : | ||
| 44 | - return w | ||
| 45 | - | ||
| 46 | -def tablePack(t): | ||
| 47 | - return msgpack.packb(t, use_bin_type = True) | ||
| 48 | - | ||
| 49 | -redisPack = { | ||
| 50 | - "default" : commonPack, | ||
| 51 | - "table" : tablePack, | ||
| 52 | -} | ||
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | -redis = Redis( | ||
| 58 | - host = redisConf["host"], | ||
| 59 | - port = redisConf["port"], | ||
| 60 | - db = redisConf["db"], | ||
| 61 | - password = redisConf["password"] | ||
| 62 | -) | ||
| 63 | - | ||
| 64 | -pipe = redis.pipeline() | ||
| 65 | - | ||
| 66 | -def decode(w, t = "default"): | ||
| 67 | - return redisUnpack[t](w) | ||
| 68 | - | ||
| 69 | -def encode(w, t = "default") : | ||
| 70 | - return redisPack[t](w) | ||
| 71 | - | ||
| 72 | - | ||
| 73 | - | ||
| 74 | - | ||
| 75 | - | ||
| 76 | - | ||
| 77 | - | ||
| 78 | - |
src/python/requirements.txt deleted