Commit 3133cb766a39345ff914219e3560d5a4c8df6bf2
1 parent
388036be
日志
Showing
23 changed files
with
451 additions
and
152 deletions
Show diff stats
src/actions/AdvAction.lua
... | ... | @@ -163,6 +163,8 @@ function _M.startAdvRpc( agent, data ) |
163 | 163 | role:checkTaskEnter("AdvStart", {id = chapterId}) |
164 | 164 | role:checkTaskEnter("AdvStartSelf", {id = chapterId}) |
165 | 165 | role:getAdvData():popBackEvents() -- 清一下事件 |
166 | + role:getAdvData():log({desc = "start", int1 = supportIdx}) | |
167 | + | |
166 | 168 | SendPacket(actionCodes.Adv_startAdvRpc, '') |
167 | 169 | return true |
168 | 170 | end |
... | ... | @@ -215,6 +217,8 @@ function _M.startHangRpc(agent, data) |
215 | 217 | |
216 | 218 | role.dailyData:updateProperty({field = "advC", delta = 1}) |
217 | 219 | role:checkTaskEnter("AdvStart", {id = chapterId}) |
220 | + role:log("adv_action", {desc = "startHang", int1 = chapterId}) | |
221 | + | |
218 | 222 | SendPacket(actionCodes.Adv_startHangRpc, '') |
219 | 223 | return true |
220 | 224 | end |
... | ... | @@ -238,10 +242,12 @@ function _M.quickHangRpc(agent, data) |
238 | 242 | local cost = math.ceil((info.time - skynet.timex()) / chapterData.idleTime * chapterData.accelerate) |
239 | 243 | |
240 | 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 | 246 | info.time = 0 |
243 | 247 | role:changeUpdates({{type = "advHang", field = chapterId, value = info}}) |
244 | 248 | |
249 | + role:log("adv_action", {desc = "quickHang", int1 = chapterId}) | |
250 | + | |
245 | 251 | SendPacket(actionCodes.Adv_quickHangRpc, '') |
246 | 252 | return true |
247 | 253 | end |
... | ... | @@ -262,7 +268,7 @@ function _M.endHangRpc(agent, data) |
262 | 268 | |
263 | 269 | local reward, isFull |
264 | 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 | 272 | else |
267 | 273 | if cancel then |
268 | 274 | if role.dailyData:getProperty("advC") <= 0 then |
... | ... | @@ -277,6 +283,8 @@ function _M.endHangRpc(agent, data) |
277 | 283 | |
278 | 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 | 288 | SendPacket(actionCodes.Adv_endHangRpc, MsgPack.pack({reward = reward, isFull = isFull})) |
281 | 289 | return true |
282 | 290 | end |
... | ... | @@ -298,7 +306,7 @@ function _M.buyAdvCountRpc(agent , data) |
298 | 306 | |
299 | 307 | |
300 | 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 | 310 | if isEl then |
303 | 311 | role.dailyData:updateProperty({field = "advElC", delta = -count}) |
304 | 312 | role.dailyData:updateProperty({field = "advElBC", delta = count}) |
... | ... | @@ -306,6 +314,7 @@ function _M.buyAdvCountRpc(agent , data) |
306 | 314 | role.dailyData:updateProperty({field = "advC", delta = -count}) |
307 | 315 | role.dailyData:updateProperty({field = "advBC", delta = count}) |
308 | 316 | end |
317 | + role:log("adv_action", {desc = "buyAdvCount", short1 = isEl and 1 or 0, int1 = count}) | |
309 | 318 | |
310 | 319 | SendPacket(actionCodes.Adv_buyAdvCountRpc, '') |
311 | 320 | return true |
... | ... | @@ -329,6 +338,9 @@ function _M.finishTaskRpc(agent, data) |
329 | 338 | adv:updateTask() |
330 | 339 | if not status then return end |
331 | 340 | role:checkTaskEnter("AdvOverTask", {id = taskId}) |
341 | + | |
342 | + adv:log({desc = "finishTask", int1 = taskId}) | |
343 | + | |
332 | 344 | SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack({reward = reward})) |
333 | 345 | return true |
334 | 346 | end |
... | ... | @@ -342,8 +354,12 @@ function _M.clickBlockRpc(agent, data) |
342 | 354 | local adv = role:getAdvData() |
343 | 355 | |
344 | 356 | if adv:isWaitChooseArtifact() then return end |
357 | + | |
358 | + adv:log({desc = "clickBlock", int1 = msg.roomId, int2 = msg.blockId}) | |
359 | + | |
345 | 360 | local status, errorCode = adv:clickBlock(msg.roomId, msg.blockId, msg) |
346 | 361 | if not status then return errorCode end |
362 | + | |
347 | 363 | SendPacket(actionCodes.Adv_clickBlockRpc, MsgPack.pack({events = adv:popBackEvents()})) |
348 | 364 | return true |
349 | 365 | end |
... | ... | @@ -374,6 +390,7 @@ function _M.useItemRpc(agent, data) |
374 | 390 | end |
375 | 391 | |
376 | 392 | adv:checkAchievement(adv.AchievType.UseItem, count, itemId) |
393 | + adv:log({desc = "useItem", int1 = itemId, int2 = count}) | |
377 | 394 | |
378 | 395 | for i = 1, count do |
379 | 396 | adv:doActive(itemData.effect, target) -- target |
... | ... | @@ -409,6 +426,8 @@ function _M.usePotionRpc(agent, data) |
409 | 426 | local adv = role:getAdvData() |
410 | 427 | if adv:isWaitChooseArtifact() then return end |
411 | 428 | |
429 | + adv:log({desc = "usePotion", int1 = potionId}) | |
430 | + | |
412 | 431 | local status = adv:doActive(potionData.effect, target) -- target |
413 | 432 | if not status then return end |
414 | 433 | |
... | ... | @@ -436,7 +455,7 @@ function _M.chooseArtifactRpc(agent, data) |
436 | 455 | local status = adv:chooseArtifact(msg.idx) |
437 | 456 | if not status then return end |
438 | 457 | adv:saveDB() |
439 | - | |
458 | + | |
440 | 459 | SendPacket(actionCodes.Adv_chooseArtifactRpc, '') |
441 | 460 | return true |
442 | 461 | end |
... | ... | @@ -497,6 +516,7 @@ function _M.exitAdvRpc(agent, data) |
497 | 516 | if not isCanContinue(role) then return end |
498 | 517 | |
499 | 518 | local adv = role:getAdvData() |
519 | + adv:log({desc = "exit"}) | |
500 | 520 | local status = adv:exit() -- target {roomId = 1, blockId = 1} 选择的目标 |
501 | 521 | SendPacket(actionCodes.Adv_exitAdvRpc, MsgPack.pack({events = adv:popBackEvents()})) |
502 | 522 | return true |
... | ... | @@ -555,8 +575,9 @@ function _M.endBattleRpc(agent, data) |
555 | 575 | if enemy.monsterId ~= monsterId or enemy.roomId ~= roomId or enemy.blockId ~= blockId then return end |
556 | 576 | adv.__battleCache = nil |
557 | 577 | |
558 | - | |
578 | + adv:log({desc = "endBattle"}) | |
559 | 579 | local status = adv:clickBlock(roomId, blockId, {player = player, bySkill = bySkill}) |
580 | + | |
560 | 581 | if not status then return end |
561 | 582 | SendPacket(actionCodes.Adv_endBattleRpc, MsgPack.pack({events = adv:popBackEvents()})) |
562 | 583 | return true |
... | ... | @@ -621,7 +642,7 @@ function _M.wheelSurfRpc(agent, data) |
621 | 642 | end |
622 | 643 | |
623 | 644 | if not role:checkItemEnough(costs) then return 5 end |
624 | - role:costItems(costs) | |
645 | + role:costItems(costs, {log = {desc = "advWheelSurf", int1 = ptype}}) | |
625 | 646 | role:addAdvLvExp(costs[ItemId.OldCoin] or 0) |
626 | 647 | local advDrawB = role:getProperty("advDrawB") |
627 | 648 | advDrawB[ptype] = (advDrawB[ptype] or 0) + count |
... | ... | @@ -635,8 +656,11 @@ function _M.wheelSurfRpc(agent, data) |
635 | 656 | reward[gift[1]] = (reward[gift[1]] or 0) + gift[2] |
636 | 657 | table.insert(backReward, gift) |
637 | 658 | end |
638 | - role:award(reward) | |
659 | + role:award(reward, {log = {desc = "advWheelSurf", int1 = ptype}}) | |
660 | + | |
639 | 661 | role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype}) |
662 | + role:log("adv_action", {desc = "advWheelSurf", int1 = ptype, int2 = count}) | |
663 | + | |
640 | 664 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) |
641 | 665 | return true |
642 | 666 | end |
... | ... | @@ -663,7 +687,8 @@ function _M.repayWheelSurfRpc(agent, data) |
663 | 687 | role:updateProperty({field = "advDrawB", value = advDrawB}) |
664 | 688 | local gift = drawData["pool3"]:randWeight(true) |
665 | 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 | 693 | SendPacket(actionCodes.Adv_repayWheelSurfRpc, MsgPack.pack({reward = reward})) |
669 | 694 | return true |
... | ... | @@ -686,6 +711,8 @@ function _M.finishAchievRpc(agent, data) |
686 | 711 | end |
687 | 712 | if not status then return end |
688 | 713 | adv:updateAchievement() |
714 | + role:log("adv_action", {desc = "finishAchiev", short1 = ctype, int1 = chapterId, int2 = taskId}) | |
715 | + | |
689 | 716 | SendPacket(actionCodes.Adv_finishAchievRpc, MsgPack.pack({reward = reward})) |
690 | 717 | return true |
691 | 718 | end |
... | ... | @@ -737,10 +764,11 @@ function _M.refreshSupportRpc(agent, data) |
737 | 764 | role.dailyData:updateProperty({field = "advSupRe", delta = 1}) |
738 | 765 | else -- 付费 |
739 | 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 | 768 | end |
742 | 769 | |
743 | 770 | role:advRandomSupportEffect() |
771 | + role:log("adv_action", {desc = "advSupRe", short1 = cr < al and 0 or 1}) | |
744 | 772 | |
745 | 773 | SendPacket(actionCodes.Adv_refreshSupportRpc, '') |
746 | 774 | return true | ... | ... |
src/actions/CarAction.lua
... | ... | @@ -35,10 +35,12 @@ function _M.makePotionRpc( agent, data ) |
35 | 35 | return 5 |
36 | 36 | end |
37 | 37 | |
38 | - role:costItems(cost) | |
38 | + role:costItems(cost, {log = {desc = "makePotion", int1 = potionId, int2 = count}}) | |
39 | 39 | potionBag[potionId] = own + count |
40 | 40 | role:updateProperty({field = "potionBag", value = potionBag}) |
41 | 41 | role:checkTaskEnter("PotionMake", {count = count, id = potionId}) |
42 | + | |
43 | + role:log("role_action", {desc = "makePotion", int1 = potionId, int2 = count}) | |
42 | 44 | SendPacket(actionCodes.Car_makePotionRpc, MsgPack.pack({potionBag = potionBag})) |
43 | 45 | return true |
44 | 46 | end |
... | ... | @@ -84,10 +86,13 @@ function _M.equipUpRpc( agent, data ) |
84 | 86 | return 4 |
85 | 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 | 92 | role:checkTaskEnter("EquipUp", {count = count}) |
93 | + | |
94 | + role:log("role_action", {desc = "equipUp", int1 = id, int2 = count}) | |
95 | + | |
91 | 96 | SendPacket(actionCodes.Car_equipUpRpc, '') |
92 | 97 | return true |
93 | 98 | end |
... | ... | @@ -117,9 +122,12 @@ function _M.runeUpRpc( agent, data ) |
117 | 122 | return 7 |
118 | 123 | end |
119 | 124 | |
120 | - role:costItems(cost) | |
125 | + role:costItems(cost, {log = {desc = "runeUp", int1 = uid, int2 = level}}) | |
121 | 126 | ownRune:updateProperty({field = "level",value = level+1}) |
122 | 127 | role:checkTaskEnter("RuneUp") |
128 | + | |
129 | + ownRune:log({desc = "runeUp", int1 = level + 1}) | |
130 | + | |
123 | 131 | SendPacket(actionCodes.Car_runeUpRpc, '') |
124 | 132 | return true |
125 | 133 | end |
... | ... | @@ -143,7 +151,7 @@ function _M.saleEquipRpc(agent, data ) |
143 | 151 | local itemData = csvdb["itemCsv"][id] |
144 | 152 | local typ = math.floor((id-7000)/100) |
145 | 153 | local lv = (id-7000)%100 |
146 | - role:addEquip(typ, lv, -count) -- 删掉装备 | |
154 | + role:addEquip(typ, lv, -count, {log = {desc = "saleEquip"}}) -- 删掉装备 | |
147 | 155 | -- 发奖励 |
148 | 156 | local one = itemData.sell_effect:toNumMap() |
149 | 157 | for k ,v in pairs(one) do |
... | ... | @@ -151,7 +159,10 @@ function _M.saleEquipRpc(agent, data ) |
151 | 159 | end |
152 | 160 | end |
153 | 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 | 166 | SendPacket(actionCodes.Car_saleEquipRpc, MsgPack.pack({reward = reward})) |
156 | 167 | return true |
157 | 168 | end |
... | ... | @@ -177,10 +188,10 @@ function _M.saleRuneRpc(agent, data ) |
177 | 188 | end |
178 | 189 | end |
179 | 190 | |
180 | - role:delRunes(backs) | |
191 | + role:delRunes(backs, {log = {desc = "saleRune"}}) | |
181 | 192 | role:checkTaskEnter("DecoRune", {count = count}) |
182 | - reward = role:award(reward) | |
183 | - | |
193 | + reward = role:award(reward, {log = {desc = "saleRune"}}) | |
194 | + | |
184 | 195 | SendPacket(actionCodes.Car_saleRuneRpc, MsgPack.pack({reward = reward})) |
185 | 196 | return true |
186 | 197 | end | ... | ... |
src/actions/DinerAction.lua
... | ... | @@ -54,7 +54,7 @@ function _M.addSellRpc( agent, data ) |
54 | 54 | return 6 |
55 | 55 | end |
56 | 56 | |
57 | - role:costItems(cost) | |
57 | + role:costItems(cost, {log = {desc = "addSell"}}) | |
58 | 58 | role.dinerData:updateSell(slot) |
59 | 59 | |
60 | 60 | role:checkTaskEnter("MakeFood", {id = dish, count = count}) |
... | ... | @@ -105,6 +105,8 @@ function _M.addSellRpc( agent, data ) |
105 | 105 | role.dinerData:updateProperty({field = "customer", value = customer}) |
106 | 106 | end |
107 | 107 | |
108 | + role:log("diner_action", {desc = "addSell", int1 = dish, int2 = count}) | |
109 | + | |
108 | 110 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
109 | 111 | SendPacket(actionCodes.Diner_addSellRpc, "") |
110 | 112 | return true |
... | ... | @@ -143,10 +145,13 @@ function _M.removeSellRpc( agent, data ) |
143 | 145 | local cost = dishData.material:toNumMap() |
144 | 146 | for k, n in pairs(cost) do |
145 | 147 | local sum = n*sell.count |
146 | - role:addItem({itemId = k,count = sum}) | |
147 | 148 | reward[k] = sum |
148 | 149 | end |
150 | + reward = role:award(reward, {log = {desc = "removeSell"}}) | |
149 | 151 | sells[slot].count = 0 |
152 | + | |
153 | + role:log("diner_action", {desc = "removeSell", int1 = dish}) | |
154 | + | |
150 | 155 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
151 | 156 | SendPacket(actionCodes.Diner_removeSellRpc, MsgPack.pack({reward = reward})) |
152 | 157 | return true |
... | ... | @@ -184,18 +189,23 @@ function _M.getSellRewardRpc( agent, data ) |
184 | 189 | sells[slot].popular = 0 |
185 | 190 | end |
186 | 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 | 194 | if k == ItemId.Gold then |
190 | 195 | role:checkTaskEnter("FoodSellGold", {count = v}) |
191 | 196 | end |
192 | 197 | end |
198 | + role:award(gift, {log = {desc = "dinerSell"}}) | |
199 | + | |
193 | 200 | |
194 | 201 | role.dinerData:popularAdd(popular) |
195 | 202 | |
196 | 203 | if dirty then |
197 | 204 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) |
198 | 205 | end |
206 | + | |
207 | + role:log("diner_action", {desc = "sell"}) | |
208 | + | |
199 | 209 | SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward})) |
200 | 210 | return true |
201 | 211 | end |
... | ... | @@ -213,7 +223,7 @@ function _M.expediteSellRpc( agent, data ) |
213 | 223 | if not role:checkItemEnough(cost) then |
214 | 224 | return 2 |
215 | 225 | end |
216 | - role:costItems(cost) | |
226 | + role:costItems(cost, {log = {desc = "dinerSellQ"}}) | |
217 | 227 | end |
218 | 228 | |
219 | 229 | local dirty = false |
... | ... | @@ -250,12 +260,14 @@ function _M.expediteSellRpc( agent, data ) |
250 | 260 | role.dinerData:notifyUpdateProperty("sells", role.dinerData:getProperty("sells")) |
251 | 261 | role.dinerData:setProperty("expedite",count+1) |
252 | 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 | 265 | if k == ItemId.Gold then |
256 | 266 | role:checkTaskEnter("FoodSellGold", {count = v}) |
257 | 267 | end |
258 | 268 | end |
269 | + role:award(gift, {log = {desc = "dinerSell"}}) | |
270 | + | |
259 | 271 | |
260 | 272 | role.dinerData:popularAdd(popular) |
261 | 273 | |
... | ... | @@ -263,6 +275,9 @@ function _M.expediteSellRpc( agent, data ) |
263 | 275 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) |
264 | 276 | end |
265 | 277 | role:checkTaskEnter("FoodSellQuick") |
278 | + | |
279 | + role:log("diner_action", {desc = "sellQ"}) | |
280 | + | |
266 | 281 | SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward,popular = popular})) |
267 | 282 | return true |
268 | 283 | end |
... | ... | @@ -298,9 +313,12 @@ function _M.levelUpRpc( agent, data ) |
298 | 313 | return |
299 | 314 | end |
300 | 315 | |
301 | - role:costItems(cost) | |
316 | + role:costItems(cost, {log = {desc = "dinerBuildUp", int1 = index}}) | |
302 | 317 | role.dinerData:updateProperty({field = "buildL", value = buildL:setv(index, curLevel + 1)}) |
303 | 318 | role:checkTaskEnter("DinerLevelUp", {type = index, level = curLevel + 1}) |
319 | + | |
320 | + role:log("diner_action", {desc = "buildUp", int1 = index, int2 = curLevel + 1}) | |
321 | + | |
304 | 322 | SendPacket(actionCodes.Diner_levelUpRpc, '') |
305 | 323 | return true |
306 | 324 | end |
... | ... | @@ -374,7 +392,7 @@ function _M.talentUpRpc( agent, data ) |
374 | 392 | -- if next(role:getProperty("advTeam")) then return 8 end |
375 | 393 | -- end |
376 | 394 | |
377 | - role:costItems(cost) | |
395 | + role:costItems(cost, {log = {desc = "talentUp", int1 = dish, int2 = dishLevel + 1}}) | |
378 | 396 | role.dinerData:updateProperty({field = "dishTree", value = dishTree:setv(dish, dishLevel + 1)}) |
379 | 397 | -- local treePoint = talentData.tree_point:toNumMap() |
380 | 398 | -- if next(treePoint) then |
... | ... | @@ -383,6 +401,8 @@ function _M.talentUpRpc( agent, data ) |
383 | 401 | |
384 | 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 | 406 | SendPacket(actionCodes.Diner_talentUpRpc, '') |
387 | 407 | return true |
388 | 408 | end |
... | ... | @@ -414,8 +434,9 @@ function _M.skillUpRpc( agent, data ) |
414 | 434 | return |
415 | 435 | end |
416 | 436 | |
417 | - role:costItems(cost) | |
437 | + role:costItems(cost, {log = {desc = "dinerSkillUp", int1 = skill, int2 = skillLevel + 1}}) | |
418 | 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 | 441 | SendPacket(actionCodes.Diner_skillUpRpc, '') |
421 | 442 | return true |
... | ... | @@ -442,6 +463,9 @@ function _M.lockTaskRpc( agent, data ) |
442 | 463 | order.lock = 0 |
443 | 464 | end |
444 | 465 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
466 | + | |
467 | + role:log("diner_action", {desc = "lockTask", int1 = order.id}) | |
468 | + | |
445 | 469 | SendPacket(actionCodes.Diner_lockTaskRpc, MsgPack.pack({lock = order.lock})) |
446 | 470 | return true |
447 | 471 | end |
... | ... | @@ -477,6 +501,9 @@ function _M.updateTaskRpc( agent, data ) |
477 | 501 | end |
478 | 502 | orders[index].status = 1 |
479 | 503 | orders[index].lock = 1 |
504 | + | |
505 | + role:log("diner_action", {desc = "getTask", int1 = order.id}) | |
506 | + | |
480 | 507 | role:checkTaskEnter("GetOderTask", {rarity = taskSet.rarity}) |
481 | 508 | elseif cmd == 1 then |
482 | 509 | if order.status ~= 1 then |
... | ... | @@ -484,6 +511,9 @@ function _M.updateTaskRpc( agent, data ) |
484 | 511 | end |
485 | 512 | orders[index].status = 0 |
486 | 513 | orders[index].lock = 0 |
514 | + | |
515 | + role:log("diner_action", {desc = "deleteTask", int1 = order.id}) | |
516 | + | |
487 | 517 | elseif cmd == 2 then |
488 | 518 | if order.status ~= 1 then |
489 | 519 | return 32 |
... | ... | @@ -491,9 +521,9 @@ function _M.updateTaskRpc( agent, data ) |
491 | 521 | if order.n < taskData.value then |
492 | 522 | return 6 |
493 | 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 | 527 | table.remove(orders,index) |
498 | 528 | role:checkTaskEnter("OverOderTask", {rarity = taskSet.rarity}) |
499 | 529 | else |
... | ... | @@ -550,7 +580,7 @@ function _M.refreshTaskRpc( agent, data ) |
550 | 580 | end |
551 | 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 | 586 | for idx, order in ipairs(orders) do |
... | ... | @@ -565,6 +595,8 @@ function _M.refreshTaskRpc( agent, data ) |
565 | 595 | end |
566 | 596 | end |
567 | 597 | |
598 | + role:log("diner_action", {desc = "reTask"}) | |
599 | + | |
568 | 600 | role.dinerData:updateProperty({field = "order", value = json.encode(orders)}) |
569 | 601 | |
570 | 602 | SendPacket(actionCodes.Diner_refreshTaskRpc, '') |
... | ... | @@ -605,6 +637,8 @@ function _M.addWantFoodRpc(agent , data) |
605 | 637 | gfood[slot] = {id = itemId, st = skynet.timex()} |
606 | 638 | end |
607 | 639 | |
640 | + role:log("diner_action", {desc = "wantFood"}) | |
641 | + | |
608 | 642 | role.dinerData:updateProperty({field = "gfood", value = gfood}) |
609 | 643 | |
610 | 644 | SendPacket(actionCodes.Diner_addWantFoodRpc, '') |
... | ... | @@ -640,8 +674,11 @@ function _M.getGreenhouseRpc( agent, data ) |
640 | 674 | end |
641 | 675 | end |
642 | 676 | role.dinerData:updateProperty({field = "gfood", value = gfood}) |
643 | - local reward = role:award(reward) | |
677 | + local reward = role:award(reward, {log = {desc = "greenHourse"}}) | |
644 | 678 | role:checkTaskEnter("FoodMGet") |
679 | + | |
680 | + role:log("diner_action", {desc = "greenHourse"}) | |
681 | + | |
645 | 682 | SendPacket(actionCodes.Diner_getGreenhouseRpc, MsgPack.pack({reward = reward})) |
646 | 683 | return true |
647 | 684 | end |
... | ... | @@ -751,24 +788,25 @@ function _M.entrustRpc(agent , data) |
751 | 788 | local ctype = msg.ctype |
752 | 789 | |
753 | 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 | 794 | local reward |
757 | 795 | if ctype == 1 then -- 完成 |
758 | - local curData = csvdb["diner_missionCsv"][entrust[1]] | |
796 | + local curData = csvdb["diner_missionCsv"][entrustId] | |
759 | 797 | if not curData then return end |
760 | 798 | |
761 | 799 | if curData.type == 1 then |
762 | 800 | local cost = curData.condition:toNumMap() |
763 | 801 | if not role:checkItemEnough(cost) then return end |
764 | - role:costItems(cost) | |
802 | + role:costItems(cost, {log = {desc = "dinerEntrus", int1 = entrustId}}) | |
765 | 803 | elseif curData.type == 2 then |
766 | 804 | -- todo 数据校验 |
767 | 805 | else |
768 | 806 | return |
769 | 807 | end |
770 | 808 | |
771 | - reward = role:award(curData.reward) | |
809 | + reward = role:award(curData.reward, {log = {desc = "dinerEntrus", int1 = entrustId}}) | |
772 | 810 | table.remove(entrust, 1) |
773 | 811 | elseif ctype == 2 then -- 放弃 |
774 | 812 | table.remove(entrust, 1) |
... | ... | @@ -777,6 +815,8 @@ function _M.entrustRpc(agent , data) |
777 | 815 | end |
778 | 816 | role.dinerData:updateProperty({field = "entrust", value = entrust}) |
779 | 817 | |
818 | + role:log("diner_action", {desc = "entrus", short1 = ctype, int1 = entrustId}) | |
819 | + | |
780 | 820 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward})) |
781 | 821 | return true |
782 | 822 | end |
... | ... | @@ -798,9 +838,10 @@ function _M.collectRpc(agent , data) |
798 | 838 | for slot, _ in pairs(sells) do |
799 | 839 | role.dinerData:updateSell(slot) |
800 | 840 | end |
801 | - local reward = role:award(customerData.reward) | |
841 | + local reward = role:award(customerData.reward, {log = {desc = "dinerCollect", int1 = id}}) | |
802 | 842 | customer[id] = 1 |
803 | 843 | role.dinerData:updateProperty({field = "customer", value = customer}) -- 解锁了 |
844 | + role:log("diner_action", {desc = "collect", int1 = id}) | |
804 | 845 | |
805 | 846 | SendPacket(actionCodes.Diner_collectRpc, MsgPack.pack({reward = reward})) |
806 | 847 | return true |
... | ... | @@ -826,10 +867,12 @@ function _M.comboRewardRpc(agent , data) |
826 | 867 | end |
827 | 868 | |
828 | 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 | 872 | role.dinerData:updateProperty({field = "comboStatus", value = comboStatus}) -- 解锁了 |
832 | 873 | |
874 | + role:log("diner_action", {desc = "combo", int1 = id}) | |
875 | + | |
833 | 876 | SendPacket(actionCodes.Diner_comboRewardRpc, MsgPack.pack({reward = reward})) |
834 | 877 | return true |
835 | 878 | end | ... | ... |
src/actions/EmailAction.lua
... | ... | @@ -53,7 +53,7 @@ function _M.listRpc(agent, data) |
53 | 53 | content = email.content, |
54 | 54 | attachments = email.attachments |
55 | 55 | }) |
56 | - role:log("mail_actions", {desc = "get_global", key1 = email.title, key2 = email.attachments}) | |
56 | + role:log("mail_action", {desc = "get_global", key1 = email.title, key2 = email.attachments}) | |
57 | 57 | end |
58 | 58 | end |
59 | 59 | end |
... | ... | @@ -95,10 +95,10 @@ function _M.drawAllAttachRpc(agent, data) |
95 | 95 | local attachments = getEmailAttachments(email) |
96 | 96 | if attachments ~= "" then |
97 | 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 | 99 | ids[emailId] = 1 |
100 | 100 | red:hset(string.format(R_EMAIL_ITEM, roleId, emailId), "status", 2) |
101 | - role:log("mail_actions", {desc = "draw_attach", int1 = emailId, key1 = email:getProperty("title"), key2 = attachments}) | |
101 | + role:log("mail_action", {desc = "draw_attach", int1 = emailId, key1 = email:getProperty("title"), key2 = attachments}) | |
102 | 102 | |
103 | 103 | for key, v in pairs(items) do |
104 | 104 | reward[key] = (reward[key] or 0) + v |
... | ... | @@ -125,11 +125,11 @@ function _M.drawAttachRpc(agent, data) |
125 | 125 | local attachments = getEmailAttachments(email) |
126 | 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 | 129 | redisproxy:hset(rds, "status", 2) -- 领取标记 |
130 | 130 | SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward})) |
131 | 131 | |
132 | - role:log("mail_actions", {desc = "draw_attach", int1 = id, key1 = email:getProperty("title"), key2 = attachments}) | |
132 | + role:log("mail_action", {desc = "draw_attach", int1 = id, key1 = email:getProperty("title"), key2 = attachments}) | |
133 | 133 | return true |
134 | 134 | end |
135 | 135 | |
... | ... | @@ -144,7 +144,7 @@ function _M.checkRpc(agent, data) |
144 | 144 | if not redisproxy:exists(rds) then return end |
145 | 145 | |
146 | 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 | 149 | SendPacket(actionCodes.Email_checkRpc, '') |
150 | 150 | return true |
... | ... | @@ -180,7 +180,7 @@ function _M.delRpc(agent, data) |
180 | 180 | end |
181 | 181 | end) |
182 | 182 | for delId, _ in ipairs(result) do |
183 | - role:log("mail_actions", {desc = "del_mail", int1 = delId}) | |
183 | + role:log("mail_action", {desc = "del_mail", int1 = delId}) | |
184 | 184 | end |
185 | 185 | SendPacket(actionCodes.Email_delRpc, MsgPack.pack({result = result})) |
186 | 186 | return true | ... | ... |
src/actions/FriendAction.lua
... | ... | @@ -110,6 +110,8 @@ function _M.searchRpc(agent, data) |
110 | 110 | |
111 | 111 | })) |
112 | 112 | end |
113 | + | |
114 | + role:log("role_action", {desc = "searchFriend"}) | |
113 | 115 | SendPacket(actionCodes.Friend_searchRpc, MsgPack.pack({searchList = searchList})) |
114 | 116 | return true |
115 | 117 | end |
... | ... | @@ -175,8 +177,14 @@ function _M.applyRpc(agent, data) |
175 | 177 | myInfo.roleId = roleId |
176 | 178 | myInfo.online = true |
177 | 179 | myInfo.hadApply = true |
180 | + | |
181 | + role:log("role_action", {desc = "addFriend", int1 = 1}) | |
182 | + | |
178 | 183 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方 |
179 | 184 | end |
185 | + | |
186 | + | |
187 | + | |
180 | 188 | SendPacket(actionCodes.Friend_applyRpc, MsgPack.pack({result = result})) |
181 | 189 | return true |
182 | 190 | end |
... | ... | @@ -268,6 +276,9 @@ function _M.handleApplyRpc(agent, data) |
268 | 276 | otherInfo.isFriend = true |
269 | 277 | otherInfo.pGet = redret[2] == 1 and 1 or nil |
270 | 278 | SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {otherInfo}})) |
279 | + | |
280 | + role:log("role_action", {desc = "addFriend", int1 = 1}) | |
281 | + | |
271 | 282 | end |
272 | 283 | |
273 | 284 | elseif cmd == 0 then -- 不同意 |
... | ... | @@ -322,6 +333,8 @@ function _M.handleApplyRpc(agent, data) |
322 | 333 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = {myInfo}})) -- 通知对方 |
323 | 334 | end |
324 | 335 | if next(needAdd) then |
336 | + role:log("role_action", {desc = "addFriend", int1 = #needAdd}) | |
337 | + | |
325 | 338 | SendPacket(actionCodes.Friend_updateProperty, MsgPack.pack({newFriend = 1, info = needAddInfo})) |
326 | 339 | else |
327 | 340 | result = 1 |
... | ... | @@ -520,6 +533,8 @@ function _M.pointRpc(agent, data) |
520 | 533 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) |
521 | 534 | role:checkTaskEnter("GiveFriendP", {count = 1}) |
522 | 535 | rpcRole(objId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newPoint = 1, roleId = roleId})) |
536 | + | |
537 | + role:log("role_action", {desc = "giveFPoint", int1 = 1}) | |
523 | 538 | end |
524 | 539 | elseif cmd == 2 then -- 领取 |
525 | 540 | local objId = msg.roleId |
... | ... | @@ -535,9 +550,11 @@ function _M.pointRpc(agent, data) |
535 | 550 | end |
536 | 551 | if not result then |
537 | 552 | getP[objId] = 1 |
538 | - reward = role:award({[ItemId.FriendPoint] = 1}) | |
553 | + reward = role:award({[ItemId.FriendPoint] = 1}, {log = {desc = "friendPoint"}}) | |
539 | 554 | role.dailyData:updateProperty({field = "getFP", value = getP}) |
540 | 555 | role:checkTaskEnter("GetFriendP", {count = 1}) |
556 | + | |
557 | + role:log("role_action", {desc = "getFPoint", int1 = 1}) | |
541 | 558 | end |
542 | 559 | elseif cmd == 3 then -- 一键赠送领取 |
543 | 560 | -- 赠送 |
... | ... | @@ -558,6 +575,9 @@ function _M.pointRpc(agent, data) |
558 | 575 | if change > 0 then |
559 | 576 | role.dailyData:updateProperty({field = "giveFP", value = giveP}) |
560 | 577 | role:checkTaskEnter("GiveFriendP", {count = change}) |
578 | + | |
579 | + role:log("role_action", {desc = "giveFPoint", int1 = change}) | |
580 | + | |
561 | 581 | else |
562 | 582 | result = 1 |
563 | 583 | end |
... | ... | @@ -579,9 +599,10 @@ function _M.pointRpc(agent, data) |
579 | 599 | end |
580 | 600 | end |
581 | 601 | if getCount > 0 then |
582 | - reward = role:award({[ItemId.FriendPoint] = getCount}) | |
602 | + reward = role:award({[ItemId.FriendPoint] = getCount}, {log = {desc = "friendPoint"}}) | |
583 | 603 | role.dailyData:updateProperty({field = "getFP", value = getP}) |
584 | 604 | role:checkTaskEnter("GetFriendP", {count = getCount}) |
605 | + role:log("role_action", {desc = "getFPoint", int1 = getCount}) | |
585 | 606 | else |
586 | 607 | result = (result or 0) + 2 |
587 | 608 | end | ... | ... |
src/actions/GmAction.lua
... | ... | @@ -19,14 +19,15 @@ function _M.testhotfix(role, pms) |
19 | 19 | return csvdb["itemCsv"][1]["name"] .. " -=- " .. csvdb["itemCsv"][2]["name"] .. " -=- " .. role:getItemCount(123) .. " -=- " .. table.pack(next(role.heros))[2]:getBattleValue() |
20 | 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 | 25 | if status == 1 then -- 忽视 |
26 | 26 | role:updateProperty({field = "ignoreMt", value = 1}) |
27 | 27 | else -- 解除 |
28 | 28 | role:updateProperty({field = "ignoreMt", value = 0}) |
29 | 29 | end |
30 | + role:log("gm_action", {desc = "ignoreout", key1 = pms.sender}) | |
30 | 31 | return "指令生效" |
31 | 32 | end |
32 | 33 | |
... | ... | @@ -46,11 +47,17 @@ function _M.ban(role, pms) |
46 | 47 | end) |
47 | 48 | end |
48 | 49 | end |
50 | + | |
51 | + role:log("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender}) | |
52 | + | |
49 | 53 | return isBan and "解封杀成功" or "封杀成功" |
50 | 54 | end |
51 | 55 | |
52 | 56 | function _M.unban(role, pms) |
53 | 57 | role:setBan(0, 0) |
58 | + | |
59 | + role:log("gm_action", {desc = "unban", key1 = pms.sender}) | |
60 | + | |
54 | 61 | return "解封杀成功" |
55 | 62 | end |
56 | 63 | |
... | ... | @@ -63,6 +70,7 @@ function _M.gmmsg(role, pms) |
63 | 70 | skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd) |
64 | 71 | end) |
65 | 72 | end |
73 | + role:log("gm_action", {desc = "gmmsg", text1 = pms.pm1, key1 = pms.sender}) | |
66 | 74 | |
67 | 75 | return "指令成功" |
68 | 76 | end |
... | ... | @@ -74,6 +82,8 @@ function _M.silent(role, pms) |
74 | 82 | return "解禁言成功" |
75 | 83 | end |
76 | 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 | 87 | return "禁言成功" |
78 | 88 | end |
79 | 89 | |
... | ... | @@ -83,9 +93,11 @@ local helpDes = {{"描述", "指令", "参数1", "参数2" ,"参数3"}} |
83 | 93 | table.insert(helpDes, {"获得角色" , "hero", "角色类型"}) |
84 | 94 | function _M.hero(role, pms) |
85 | 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 | 97 | return "失败" |
88 | 98 | end |
99 | + | |
100 | + role:log("gm_action", {desc = "hero", int1 = heroType, key1 = pms.sender}) | |
89 | 101 | return "成功" |
90 | 102 | end |
91 | 103 | |
... | ... | @@ -117,6 +129,9 @@ function _M.herol(role, pms) |
117 | 129 | addLevel = math.min(hero:getMaxLevel() - hero:getProperty("level"), addLevel) |
118 | 130 | hero:updateProperty({field = "level", delta = addLevel}) |
119 | 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 | 135 | return "成功" |
121 | 136 | end |
122 | 137 | |
... | ... | @@ -127,6 +142,9 @@ function _M.herola(role, pms) |
127 | 142 | for _, hero in pairs(role.heros) do |
128 | 143 | _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel}) |
129 | 144 | end |
145 | + | |
146 | + role:log("gm_action", {desc = "herola", int1 = addLevel, key1 = pms.sender}) | |
147 | + | |
130 | 148 | return "成功" |
131 | 149 | end |
132 | 150 | |
... | ... | @@ -136,7 +154,8 @@ function _M.equip(role, pms) |
136 | 154 | local typ = tonum(pms.pm1) |
137 | 155 | local level = tonum(pms.pm2) |
138 | 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 | 159 | return "成功" |
141 | 160 | end |
142 | 161 | |
... | ... | @@ -144,7 +163,9 @@ table.insert(helpDes, {"获得零件" , "rune", "零件类型", "零件id"}) |
144 | 163 | function _M.rune(role, pms) |
145 | 164 | local typ = tonum(pms.pm1) |
146 | 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 | 169 | return result |
149 | 170 | end |
150 | 171 | |
... | ... | @@ -165,6 +186,9 @@ function _M.fb(role, pms) -- 直接通关 |
165 | 186 | passCarbon[carbonId] = 1 |
166 | 187 | addPre(carbonId) |
167 | 188 | role:updateProperty({field = "hangPass", value = passCarbon}) |
189 | + | |
190 | + role:log("gm_action", {desc = "fb", int1 = carbonId, key1 = pms.sender}) | |
191 | + | |
168 | 192 | role:checkTaskEnter("HangPass", {id = carbonId}) |
169 | 193 | return "成功" |
170 | 194 | end |
... | ... | @@ -187,6 +211,9 @@ function _M.fbc(role, pms) -- 直接通关 |
187 | 211 | role:updateProperty({field = "hangInfo", value = {}}) |
188 | 212 | role:updateProperty({field = "hangPass", value = passCarbon}) |
189 | 213 | role:checkTaskEnter("HangPass", {id = carbonId}) |
214 | + | |
215 | + role:log("gm_action", {desc = "fbc", int1 = carbonId, key1 = pms.sender}) | |
216 | + | |
190 | 217 | return "成功" |
191 | 218 | end |
192 | 219 | |
... | ... | @@ -217,7 +244,10 @@ table.insert(helpDes, {"玩家经验", "exp", "经验"}) |
217 | 244 | function _M.exp(role, pms) |
218 | 245 | local exp = tonum(pms.pm1) |
219 | 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 | 251 | return "成功" |
222 | 252 | end |
223 | 253 | |
... | ... | @@ -236,35 +266,35 @@ function _M.get(role, pms) |
236 | 266 | reward[id] = data.number |
237 | 267 | end |
238 | 268 | end |
239 | - role:award(reward) | |
269 | + role:award(reward, {log = {desc = "gm"}}) | |
240 | 270 | elseif pms.pm1 == "EQUIP" then |
241 | 271 | for itemId = 7000 , 8000 do |
242 | 272 | if csvdb["itemCsv"][itemId] then |
243 | - role:award({[itemId] = 100}) | |
273 | + role:award({[itemId] = 100}, {log = {desc = "gm"}}) | |
244 | 274 | end |
245 | 275 | end |
246 | 276 | elseif pms.pm1 == "RUNE" then |
247 | 277 | for itemId = 2000 , 3000 do |
248 | 278 | if csvdb["itemCsv"][itemId] then |
249 | - role:award({[itemId] = 1}) | |
279 | + role:award({[itemId] = 1}, {log = {desc = "gm"}}) | |
250 | 280 | end |
251 | 281 | end |
252 | 282 | elseif pms.pm1 == "FRAG" then |
253 | 283 | for itemId = 100 , 400 do |
254 | 284 | if csvdb["itemCsv"][itemId] then |
255 | - role:award({[itemId] = 100}) | |
285 | + role:award({[itemId] = 100}, {log = {desc = "gm"}}) | |
256 | 286 | end |
257 | 287 | end |
258 | 288 | elseif pms.pm1 == "FOOD" then |
259 | 289 | for itemId = 4000 , 5000 do |
260 | 290 | if csvdb["itemCsv"][itemId] then |
261 | - role:award({[itemId] = 100}) | |
291 | + role:award({[itemId] = 100}, {log = {desc = "gm"}}) | |
262 | 292 | end |
263 | 293 | end |
264 | 294 | elseif pms.pm1 == "HERO" then |
265 | 295 | for itemId = 400 , 700 do |
266 | 296 | if csvdb["itemCsv"][itemId] then |
267 | - role:award({[itemId] = 1}) | |
297 | + role:award({[itemId] = 1}, {log = {desc = "gm"}}) | |
268 | 298 | end |
269 | 299 | end |
270 | 300 | else |
... | ... | @@ -273,7 +303,8 @@ function _M.get(role, pms) |
273 | 303 | return "物品不存在" |
274 | 304 | end |
275 | 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 | 308 | end |
278 | 309 | return "成功" |
279 | 310 | end |
... | ... | @@ -287,7 +318,7 @@ function _M.advc(role, pms) |
287 | 318 | for itemId, count in pairs(reward) do |
288 | 319 | reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 |
289 | 320 | end |
290 | - role:award(reward) | |
321 | + role:award(reward, {log = {desc = "gm"}}) | |
291 | 322 | |
292 | 323 | role:updateProperties({ |
293 | 324 | advInfo = {}, |
... | ... | @@ -297,6 +328,9 @@ function _M.advc(role, pms) |
297 | 328 | advAFWear = {}, |
298 | 329 | }, notNotify) |
299 | 330 | role.advData = nil |
331 | + | |
332 | + role:log("gm_action", {desc = "advc", key1 = pms.sender}) | |
333 | + | |
300 | 334 | return "成功" |
301 | 335 | end |
302 | 336 | |
... | ... | @@ -304,6 +338,9 @@ table.insert(helpDes, {"冒险次数恢复", "advf"}) |
304 | 338 | function _M.advf(role, pms) |
305 | 339 | role.dailyData:updateProperty({field = "advC", value = 0}) |
306 | 340 | role.dailyData:updateProperty({field = "advElC", value = 0}) |
341 | + | |
342 | + role:log("gm_action", {desc = "advf", key1 = pms.sender}) | |
343 | + | |
307 | 344 | return "成功" |
308 | 345 | end |
309 | 346 | |
... | ... | @@ -331,6 +368,7 @@ function _M.adv(role, pms) |
331 | 368 | addPre(chapterId) |
332 | 369 | role:updateProperty({field = "advPass", value = advPass}) |
333 | 370 | end |
371 | + role:log("gm_action", {desc = "advf", int1 = chapterId, int2 = layer, key1 = pms.sender}) | |
334 | 372 | |
335 | 373 | return "成功" |
336 | 374 | end |
... | ... | @@ -355,6 +393,7 @@ function _M.advt(role, pms) |
355 | 393 | advData.level = layer |
356 | 394 | |
357 | 395 | advData:saveDB() |
396 | + role:log("gm_action", {desc = "advt", int1 = chapterId, int2 = layer, key1 = pms.sender}) | |
358 | 397 | |
359 | 398 | return "成功" |
360 | 399 | end |
... | ... | @@ -363,6 +402,9 @@ table.insert(helpDes, {"冒险队等级增加", "advl", "经验"}) |
363 | 402 | function _M.advl(role, pms) |
364 | 403 | local exp = tonum(pms.pm1) |
365 | 404 | role:addAdvLvExp(math.max(0, exp)) |
405 | + | |
406 | + role:log("gm_action", {desc = "advl", int1 = exp, key1 = pms.sender}) | |
407 | + | |
366 | 408 | return "成功" |
367 | 409 | end |
368 | 410 | |
... | ... | @@ -376,7 +418,8 @@ function _M.advcl(role, pms) |
376 | 418 | end |
377 | 419 | advData.battle.player:addExp(exp) |
378 | 420 | advData:saveDB() |
379 | - | |
421 | + role:log("gm_action", {desc = "advcl", int1 = exp, key1 = pms.sender}) | |
422 | + | |
380 | 423 | return "成功" |
381 | 424 | end |
382 | 425 | |
... | ... | @@ -385,6 +428,8 @@ function _M.idlec(role, pms) |
385 | 428 | role:updateProperty({field = "hangTeam", value = {}}) |
386 | 429 | role:updateProperty({field = "hangInfo", value = {}}) |
387 | 430 | role:updateProperty({field = "hangBag", value = {}}) |
431 | + role:log("gm_action", {desc = "idlec", key1 = pms.sender}) | |
432 | + | |
388 | 433 | role.advData = nil |
389 | 434 | return "成功" |
390 | 435 | end |
... | ... | @@ -408,11 +453,13 @@ function _M.advit(role, pms) |
408 | 453 | local itemId = tonum(pms.pm1) |
409 | 454 | local count = tonum(pms.pm2) |
410 | 455 | reward[itemId] = count |
456 | + | |
457 | + role:log("gm_action", {desc = "advit", int1 = itemId, int2 = count, key1 = pms.sender}) | |
411 | 458 | end |
412 | 459 | |
413 | 460 | |
414 | 461 | local adv = role:getAdvData() |
415 | - adv:award(reward) | |
462 | + adv:award(reward, {log = {desc = "gm"}}) | |
416 | 463 | return "成功" |
417 | 464 | end |
418 | 465 | |
... | ... | @@ -422,6 +469,9 @@ function _M.tower(role, pms) |
422 | 469 | local level = tonum(pms.pm1, 1) |
423 | 470 | if not csvdb["tower_battleCsv"][level] then return "不存在" end |
424 | 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 | 475 | return "成功" |
426 | 476 | end |
427 | 477 | |
... | ... | @@ -439,6 +489,9 @@ function _M.email(role, pms) |
439 | 489 | attachments = id == 0 and reward or nil, |
440 | 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 | 495 | return "成功" |
443 | 496 | end |
444 | 497 | |
... | ... | @@ -455,6 +508,8 @@ function _M.cguide(role, pms) |
455 | 508 | elseif id == 2 then |
456 | 509 | role:updateProperty({field = "funcGuide", value = ""}) |
457 | 510 | end |
511 | + | |
512 | + role:log("gm_action", {desc = "cguide", int1 = id, key1 = pms.sender}) | |
458 | 513 | return "成功" |
459 | 514 | end |
460 | 515 | ... | ... |
src/actions/HangAction.lua
... | ... | @@ -102,6 +102,8 @@ function _M.startRpc( agent, data ) |
102 | 102 | end |
103 | 103 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
104 | 104 | |
105 | + role:log("hang_action", {desc = "startHang", int1 = carbonId}) | |
106 | + | |
105 | 107 | SendPacket(actionCodes.Hang_startRpc, '') |
106 | 108 | return true |
107 | 109 | end |
... | ... | @@ -184,12 +186,15 @@ function _M.endBattleRpc(agent, data) |
184 | 186 | for itemId, count in pairs(carbonData.item_clear:toNumMap()) do |
185 | 187 | reward[itemId] = count |
186 | 188 | end |
187 | - reward = role:award(reward) | |
189 | + reward = role:award(reward, {log = {desc = "hangBattle", int1 = carbonId}}) | |
188 | 190 | |
189 | 191 | role:checkTaskEnter("HangPass", {id = carbonId}) |
190 | 192 | end |
191 | 193 | hangInfo.key = nil |
192 | 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 | 198 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ |
194 | 199 | starNum = msg.starNum, |
195 | 200 | reward = reward, |
... | ... | @@ -232,7 +237,7 @@ function _M.getRewardRpc(agent , data) |
232 | 237 | checkReward(role) |
233 | 238 | local items = role:getProperty("hangBag") |
234 | 239 | if not next(items) then return end |
235 | - local reward = role:award(items) | |
240 | + local reward = role:award(items, {log = {desc = "hangReward"}}) | |
236 | 241 | table.clear(items) |
237 | 242 | local hangInfo = role:getProperty("hangInfo") |
238 | 243 | local nowTime = skynet.timex() |
... | ... | @@ -323,7 +328,7 @@ function _M.quickRpc(agent , data) |
323 | 328 | if not costs[curCount] then return end |
324 | 329 | if costs[curCount] > 0 then |
325 | 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 | 332 | end |
328 | 333 | |
329 | 334 | role.dailyData:updateProperty({field = "hangQC", value = curCount}) |
... | ... | @@ -345,7 +350,7 @@ function _M.quickRpc(agent , data) |
345 | 350 | reward[cur[1]] = (reward[cur[1]] or 0) + cur[2] |
346 | 351 | end |
347 | 352 | |
348 | - reward = role:award(reward) | |
353 | + reward = role:award(reward, {log = {desc = "quickHang", int1 = hangInfo.carbonId}}) | |
349 | 354 | if reward[ItemId.Gold] then |
350 | 355 | role:checkTaskEnter("HangGetGold", {count = reward[ItemId.Gold]}) |
351 | 356 | end |
... | ... | @@ -393,16 +398,16 @@ function _M.buyBonusCountRpc(agent, data) |
393 | 398 | local count = msg.count |
394 | 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 | 403 | local bonusC = role.dailyData:getProperty("bonusC") |
399 | 404 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} |
400 | 405 | local lastCount = globalCsv.bonus_daily_buy_count - bonusC[btype]["b"] |
401 | 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 | 411 | bonusC[btype]["b"] = bonusC[btype]["b"] + count |
407 | 412 | bonusC[btype]["c"] = bonusC[btype]["c"] - count |
408 | 413 | |
... | ... | @@ -457,10 +462,12 @@ function _M.endBonusBattleRpc(agent, data) |
457 | 462 | |
458 | 463 | local reward |
459 | 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 | 466 | role:checkTaskEnter("BonusPass", {id = id}) |
462 | 467 | end |
463 | 468 | |
469 | + role:log("hang_action", {desc = "bonusBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id}) | |
470 | + | |
464 | 471 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ |
465 | 472 | starNum = starNum, |
466 | 473 | reward = reward})) | ... | ... |
src/actions/HeroAction.lua
... | ... | @@ -27,9 +27,11 @@ function _M.levelUpRpc( agent, data ) |
27 | 27 | local curData = csvdb["unit_expCsv"][hero:getProperty("level")] |
28 | 28 | local cost = {[ItemId.Exp] = curData.exp, [ItemId.Gold] = curData.gold} |
29 | 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 | 31 | hero:updateProperty({field = "level", delta = 1}) |
32 | 32 | |
33 | + hero:log({desc = "levelUp", int1 = hero:getProperty("level")}) | |
34 | + | |
33 | 35 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) |
34 | 36 | SendPacket(actionCodes.Hero_levelUpRpc, '') |
35 | 37 | return true |
... | ... | @@ -46,9 +48,11 @@ function _M.breakRpc( agent, data ) |
46 | 48 | local curData = csvdb["unit_breakCsv"][hero:getProperty("breakL")] |
47 | 49 | local cost = {[ItemId.BreakCost] = curData.cost, [ItemId.Gold] = curData.gold} |
48 | 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 | 52 | hero:updateProperty({field = "breakL", delta = 1}) |
51 | 53 | |
54 | + hero:log({desc = "break", int1 = hero:getProperty("breakL")}) | |
55 | + | |
52 | 56 | SendPacket(actionCodes.Hero_breakRpc, '') |
53 | 57 | return true |
54 | 58 | end |
... | ... | @@ -82,7 +86,7 @@ function _M.wakeRpc(agent, data) |
82 | 86 | end |
83 | 87 | end |
84 | 88 | |
85 | - role:costItems(cost) | |
89 | + role:costItems(cost, {log = {desc = "heroWake", int1 = msg.id, int2 = hero:getProperty("type")}}) | |
86 | 90 | for k,v in pairs(skills) do |
87 | 91 | hero:updateProperty({field = "skillL", value = hero:getProperty("skillL"):setv(k, v)}) |
88 | 92 | end |
... | ... | @@ -93,6 +97,8 @@ function _M.wakeRpc(agent, data) |
93 | 97 | if curLevel == 4 then -- 解锁cg |
94 | 98 | role:checkTaskEnter("WakeCG", {heroType = typ}) |
95 | 99 | end |
100 | + hero:log({desc = "wake", int1 = hero:getProperty("wakeL")}) | |
101 | + | |
96 | 102 | |
97 | 103 | SendPacket(actionCodes.Hero_wakeRpc, '') |
98 | 104 | return true |
... | ... | @@ -109,6 +115,8 @@ function _M.skillUpRpc(agent, data) |
109 | 115 | if hero:getLSPoint() <= 0 or curLevel >= #hero:getSkillData(index) then return end |
110 | 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 | 120 | SendPacket(actionCodes.Hero_skillUpRpc, '') |
113 | 121 | return true |
114 | 122 | end |
... | ... | @@ -141,7 +149,7 @@ function _M.talentRpc(agent, data) |
141 | 149 | cost[globalCsv.unit_talent_cost[csvdb["unitCsv"][hero:getProperty("type")].camp][k]] = v |
142 | 150 | end |
143 | 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 | 153 | talent = talent:incrv(index, 1) |
146 | 154 | |
147 | 155 | --是否进阶 |
... | ... | @@ -167,6 +175,8 @@ function _M.talentRpc(agent, data) |
167 | 175 | |
168 | 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 | 180 | SendPacket(actionCodes.Hero_talentRpc, '') |
171 | 181 | return true |
172 | 182 | end |
... | ... | @@ -491,8 +501,8 @@ function _M.createHeroRpc(agent, data) |
491 | 501 | if hero:getProperty("type") == heroType then return end |
492 | 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 | 507 | SendPacket(actionCodes.Hero_createHeroRpc, "") |
498 | 508 | return true |
... | ... | @@ -522,12 +532,12 @@ function _M.referEquipsRpc(agent, data) |
522 | 532 | if equips[typ] == 0 then |
523 | 533 | curEquip = curEquip:delk(typ) |
524 | 534 | else |
525 | - role:addEquip(typ, equips[typ], -1) -- 穿上 | |
535 | + role:addEquip(typ, equips[typ], -1, {log = {desc = "refer"}}) -- 穿上 | |
526 | 536 | curEquip = curEquip:setv(typ, equips[typ]) |
527 | 537 | end |
528 | 538 | |
529 | 539 | if cur ~= 0 then |
530 | - role:addEquip(typ, cur, 1) -- 脱掉 | |
540 | + role:addEquip(typ, cur, 1, {log = {desc = "refer"}}) -- 脱掉 | |
531 | 541 | end |
532 | 542 | end |
533 | 543 | end |
... | ... | @@ -602,8 +612,8 @@ function _M.createHeroRandomRpc(agent, data) |
602 | 612 | else |
603 | 613 | reward = {[temp[1] + ItemStartId.Hero] = 1} |
604 | 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 | 617 | SendPacket(actionCodes.Hero_createHeroRandomRpc, MsgPack.pack({reward = reward})) |
608 | 618 | return true |
609 | 619 | end |
... | ... | @@ -668,11 +678,12 @@ function _M.getResetRewardRpc(agent, data) |
668 | 678 | hero:updateProperty({field = "level", value = level}) |
669 | 679 | hero:updateProperty({field = "breakL", value = breakL}) |
670 | 680 | hero:updateProperty({field = "talent", value = ""}) |
681 | + hero:log({desc = "resetHero"}) | |
671 | 682 | |
672 | 683 | for itemId, count in pairs(reward) do |
673 | 684 | reward[itemId] = math.floor(count * globalCsv.unit_back_discount) |
674 | 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 | 688 | SendPacket(actionCodes.Hero_getResetRewardRpc, MsgPack.pack({reward = reward})) |
678 | 689 | return true |
... | ... | @@ -784,7 +795,7 @@ function _M.drawHeroRpc(agent, data) |
784 | 795 | end, |
785 | 796 | } |
786 | 797 | |
787 | - role:costItems(cost) | |
798 | + role:costItems(cost, {log = {desc = "drawHero", short1 = pool}}) | |
788 | 799 | local floorHeroCount = role:getProperty("floorHero")[pool] or 0 |
789 | 800 | |
790 | 801 | local ssrCount = 0 |
... | ... | @@ -823,10 +834,10 @@ function _M.drawHeroRpc(agent, data) |
823 | 834 | local fragId = itemData.id - ItemStartId.Hero |
824 | 835 | local heroData = csvdb["unitCsv"][fragId] |
825 | 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 | 838 | table.insert(reward, {id = fragId, count = count, from = temp[1], fcount = temp[2]}) |
828 | 839 | else |
829 | - role:award({[temp[1]] = temp[2]}) | |
840 | + role:award({[temp[1]] = temp[2]}, {log = {desc = "drawHero", short1 = pool}}) | |
830 | 841 | table.insert(reward, {id = temp[1], count = temp[2]}) |
831 | 842 | end |
832 | 843 | end |
... | ... | @@ -847,7 +858,7 @@ function _M.drawHeroRpc(agent, data) |
847 | 858 | if ssrCount > 0 then |
848 | 859 | role:checkTaskEnter("DrawSSR", {count = ssrCount}) |
849 | 860 | end |
850 | - | |
861 | + role:log("hero_action", {desc = "drawHero", short1 = pool, int1 = drawCount[drawType]}) | |
851 | 862 | SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 |
852 | 863 | return true |
853 | 864 | end |
... | ... | @@ -869,13 +880,13 @@ function _M.repayHeroRpc(agent, data) |
869 | 880 | local fragId = itemData.id - ItemStartId.Hero |
870 | 881 | local heroData = csvdb["unitCsv"][fragId] |
871 | 882 | local count = globalCsv.draw_unit_tofragment[heroData.rare] |
872 | - role:award({[fragId] = count}) | |
883 | + role:award({[fragId] = count}, {log = {desc = "heroRepay"}}) | |
873 | 884 | reward = {id = fragId, count = count, from = id, fcount = 1} |
874 | 885 | else |
875 | - role:award({[id] = 1}) | |
886 | + role:award({[id] = 1}, {log = {desc = "heroRepay"}}) | |
876 | 887 | reward = {id = id, count = 1} |
877 | 888 | end |
878 | - | |
889 | + role:log("hero_action", {desc = "heroRepay"}) | |
879 | 890 | SendPacket(actionCodes.Hero_repayHeroRpc, MsgPack.pack({reward = reward})) |
880 | 891 | return true |
881 | 892 | end | ... | ... |
src/actions/HttpAction.lua
... | ... | @@ -179,7 +179,11 @@ function _M.gm_action(query) |
179 | 179 | return "角色不存在" |
180 | 180 | end |
181 | 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 | 187 | end |
184 | 188 | |
185 | 189 | function _M.broadcast(query) | ... | ... |
src/actions/PvpAction.lua
... | ... | @@ -235,8 +235,8 @@ function _M.buyCountRpc(agent, data) |
235 | 235 | |
236 | 236 | local cost = {[ItemId.Diamond] = globalCsv.pvp_buy_cost * count} |
237 | 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 | 241 | SendPacket(actionCodes.Pvp_buyCountRpc, '') |
242 | 242 | return true |
... | ... | @@ -287,7 +287,7 @@ function _M.startBattleRpc(agent, data) |
287 | 287 | if pvpFree >= globalCsv.pvp_battle_free_count then |
288 | 288 | local cost = {[ItemId.PvpKey] = 1} |
289 | 289 | if not role:checkItemEnough(cost) then return 5 end |
290 | - role:costItems(cost) | |
290 | + role:costItems(cost, {log = {desc = "startPvp", short1 = 1}}) | |
291 | 291 | else |
292 | 292 | role.dailyData:updateProperty({field = "pvpFree", delta = 1}) |
293 | 293 | end |
... | ... | @@ -296,6 +296,9 @@ function _M.startBattleRpc(agent, data) |
296 | 296 | _pvpStartBattleCacheC = {idx = idx, key = key, revenge = revenge} |
297 | 297 | |
298 | 298 | role:checkTaskEnter("PvpBattle") |
299 | + | |
300 | + | |
301 | + role:log("pvp_action", {desc = "startBattle", short1 = 1, int1 = revenge and 1 or 0}) | |
299 | 302 | end |
300 | 303 | |
301 | 304 | SendPacket(actionCodes.Pvp_startBattleRpc, MsgPack.pack({matchInfo = matchInfo, key = key, result = result, wait = wait})) |
... | ... | @@ -331,7 +334,7 @@ function _M.endBattleRpc(agent, data) |
331 | 334 | if not match then return end |
332 | 335 | |
333 | 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 | 338 | local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreCommon(match.t == 1 and match.id or -1, isWin) |
336 | 339 | |
337 | 340 | _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 |
... | ... | @@ -384,6 +387,8 @@ function _M.endBattleRpc(agent, data) |
384 | 387 | if isWin then |
385 | 388 | role:checkTaskEnter("PvpWin", {score = myScore}) |
386 | 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 | 393 | SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({ |
389 | 394 | reward = reward, |
... | ... | @@ -483,7 +488,7 @@ function _M.startBattleHRpc(agent, data) |
483 | 488 | if pvpFreeH >= globalCsv.pvp_battle_free_count_high then |
484 | 489 | local cost = {[ItemId.PvpKey] = globalCsv.pvp_battle_high_cost} |
485 | 490 | if not role:checkItemEnough(cost) then return 5 end |
486 | - role:costItems(cost) | |
491 | + role:costItems(cost, {log = {desc = "startPvp", short1 = 2}}) | |
487 | 492 | else |
488 | 493 | role.dailyData:updateProperty({field = "pvpFreeH", delta = 1}) |
489 | 494 | end |
... | ... | @@ -508,6 +513,9 @@ function _M.startBattleHRpc(agent, data) |
508 | 513 | } |
509 | 514 | |
510 | 515 | role:checkTaskEnter("PvpBattle") |
516 | + | |
517 | + role:log("pvp_action", {desc = "startBattle", short1 = 2, int1 = revenge and 1 or 0}) | |
518 | + | |
511 | 519 | end |
512 | 520 | |
513 | 521 | SendPacket(actionCodes.Pvp_startBattleHRpc, MsgPack.pack({ |
... | ... | @@ -607,7 +615,7 @@ function _M.endBattleHRpc(agent, data) |
607 | 615 | |
608 | 616 | -- 战斗结束了发奖 |
609 | 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 | 619 | local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = 0, 0, 0, 0, 0, 0 |
612 | 620 | if role:isTimeResetOpen(TimeReset.PvpHight) then |
613 | 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 | 683 | if isWin then |
676 | 684 | role:checkTaskEnter("PvpWin", {score = myScore}) |
677 | 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 | 688 | SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ |
680 | 689 | reward = reward, |
... | ... | @@ -829,7 +838,8 @@ function _M.highDivisionGiftRpc(agent, data) |
829 | 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 | 844 | SendPacket(actionCodes.Pvp_highDivisionGiftRpc, MsgPack.pack({reward = reward})) |
835 | 845 | return true |
... | ... | @@ -853,7 +863,7 @@ function _M.shopBuyRpc(agent, data) |
853 | 863 | |
854 | 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 | 867 | if csvData.limit > 0 then |
858 | 868 | role:changeUpdates({{type = "pvpShop", field = id, value = (pvpShop[id] or 0) + count}}) |
859 | 869 | end |
... | ... | @@ -862,8 +872,9 @@ function _M.shopBuyRpc(agent, data) |
862 | 872 | for id, c in pairs(gift) do |
863 | 873 | gift[id] = c * count |
864 | 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 | 879 | SendPacket(actionCodes.Pvp_shopBuyRpc, MsgPack.pack({reward = reward})) |
869 | 880 | return true |
... | ... | @@ -953,9 +964,10 @@ function _M.crossBetRpc(agent, data) |
953 | 964 | if not role:isTimeResetOpen(TimeReset.PvpCross) then return end |
954 | 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 | 968 | if not result then return end |
958 | - | |
969 | + | |
970 | + role:log("pvp_action", {desc = "crossBet"}) | |
959 | 971 | SendPacket(actionCodes.Pvp_crossBetRpc, MsgPack.pack(result)) |
960 | 972 | return true |
961 | 973 | end | ... | ... |
src/actions/RoleAction.lua
... | ... | @@ -293,7 +293,7 @@ function _M.createRpc(agent, data) |
293 | 293 | return true |
294 | 294 | end |
295 | 295 | newRole:startActionUcode() |
296 | - newRole:award(globalCsv.birthItem) | |
296 | + newRole:award(globalCsv.birthItem, {log = {desc = "birth"}}) | |
297 | 297 | -- 欢迎邮件 |
298 | 298 | redisproxy:insertEmail({roleId = roleId, emailId = 1}) |
299 | 299 | |
... | ... | @@ -900,7 +900,7 @@ function _M.drawCodeRpc(agent, data) |
900 | 900 | if ret == 0 then |
901 | 901 | local giftId = tonumber(result.giftId) |
902 | 902 | role:setProperty("codeStr", codestr:setv(giftId, 1)) |
903 | - local reward = role:award(result.gift, {desc = "drawCode", key1 = code, int1 = giftId}) | |
903 | + local reward = role:award(result.gift, {log = {desc = "drawCode", key1 = code, int1 = giftId}}) | |
904 | 904 | |
905 | 905 | SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ |
906 | 906 | result = ret, |
... | ... | @@ -965,7 +965,7 @@ function _M.guideRpc(agent, data) |
965 | 965 | if master < 0 or slave < 0 then return end |
966 | 966 | newerGuide = string.format("%d=%d",master,slave) |
967 | 967 | role:updateProperty({field = "newerGuide", value = newerGuide}) |
968 | - role:log("guide", {int1 = master*1000+slave}) | |
968 | + role:log("guide", {desc = "guide_new",int1 = master*1000+slave}) | |
969 | 969 | elseif cmdType == 2 then |
970 | 970 | -- 系统引导 |
971 | 971 | if not msg.skip then return end |
... | ... | @@ -978,7 +978,7 @@ function _M.guideRpc(agent, data) |
978 | 978 | |
979 | 979 | if msg.funcType then |
980 | 980 | funcGuide = funcGuide:setv(msg.funcType, 1) |
981 | - role:log("guide_sys", {int1 = msg.funcType}) | |
981 | + role:log("guide", {desc = "guide_sys", int1 = msg.funcType}) | |
982 | 982 | end |
983 | 983 | role:updateProperty({field = "funcGuide", value = funcGuide}) |
984 | 984 | elseif cmdType == 3 then |
... | ... | @@ -986,7 +986,7 @@ function _M.guideRpc(agent, data) |
986 | 986 | if msg.funcType then |
987 | 987 | local value = msg.value or 1 |
988 | 988 | for _, funcIdx in pairs(msg.funcType:toArray(true,"=")) do |
989 | - role:log("guide_weak", {int1 = funcIdx}) | |
989 | + role:log("guide", {desc = "guide_weak", int1 = funcIdx}) | |
990 | 990 | funcGuide = funcGuide:setv(funcIdx, value) |
991 | 991 | end |
992 | 992 | role:updateProperty({field = "funcGuide", value = funcGuide}) | ... | ... |
src/actions/StoreAction.lua
... | ... | @@ -15,7 +15,7 @@ function _M.rechargeRpc(agent , data) |
15 | 15 | rechargeF[id] = 1 |
16 | 16 | role:updateProperty({field = "rechargeF", value = rechargeF}) |
17 | 17 | end |
18 | - role:gainDiamond({count = diamondCount, isRecharge = true}) | |
18 | + role:gainDiamond({count = diamondCount, isRecharge = true, log = {desc = "recharge", int1 = id}}) | |
19 | 19 | elseif dataSet.type == 1 then --月卡 |
20 | 20 | return |
21 | 21 | elseif dataSet.type == 2 then -- 赛季通行证 |
... | ... | @@ -28,6 +28,8 @@ function _M.rechargeRpc(agent , data) |
28 | 28 | local rmb = dataSet.rmb |
29 | 29 | role:updateProperty({field = "rmbC", delta = rmb}) |
30 | 30 | |
31 | + role:log("role_action", {desc = "recharge", int1 = id}) | |
32 | + | |
31 | 33 | SendPacket(actionCodes.Store_rechargeRpc, MsgPack.pack({diamond = diamondCount})) |
32 | 34 | return true |
33 | 35 | end |
... | ... | @@ -57,7 +59,7 @@ function _M.dailyBuyRpc(agent , data) |
57 | 59 | return 3 |
58 | 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 | 63 | return 4 |
62 | 64 | end |
63 | 65 | |
... | ... | @@ -65,7 +67,9 @@ function _M.dailyBuyRpc(agent , data) |
65 | 67 | dailySDC[id] = (dailySDC[id] or 0) + count |
66 | 68 | role.dailyData:updateProperty({field = "dailySDC", value = dailySDC}) |
67 | 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 | 74 | SendPacket(actionCodes.Store_dailyBuyRpc, MsgPack.pack({reward = reward})) |
71 | 75 | return true |
... | ... | @@ -92,13 +96,15 @@ function _M.dinerBuyRpc(agent , data) |
92 | 96 | role:updateProperty({field = "dinerS", value = dinerS}) |
93 | 97 | end |
94 | 98 | |
95 | - role:costItems(cost) | |
99 | + role:costItems(cost, {log = {desc = "dinerShop", int1 = id, int2 = count}}) | |
96 | 100 | |
97 | 101 | local gift = {} |
98 | 102 | for _id, _count in pairs(dataSet.gift:toNumMap()) do |
99 | 103 | gift[_id] = _count * count |
100 | 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 | 109 | SendPacket(actionCodes.Store_dinerBuyRpc, MsgPack.pack({reward = reward})) |
104 | 110 | return true | ... | ... |
src/actions/TowerAction.lua
... | ... | @@ -32,6 +32,7 @@ function _M.roleFormatRpc(agent , data) |
32 | 32 | towerTeam.leader = msg.leader |
33 | 33 | towerTeam.supports = supports |
34 | 34 | |
35 | + | |
35 | 36 | role:updateProperty({field = "towerF", value = towerTeam}) |
36 | 37 | SendPacket(actionCodes.Tower_roleFormatRpc, '') |
37 | 38 | return true |
... | ... | @@ -74,6 +75,9 @@ function _M.startBattleRpc(agent, data) |
74 | 75 | |
75 | 76 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
76 | 77 | role:checkTaskEnter("TowerBattle", {level = towerInfo.l}) |
78 | + | |
79 | + role:log("tower_action", {desc = "startBattle", int1 = id}) | |
80 | + | |
77 | 81 | SendPacket(actionCodes.Tower_startBattleRpc, '') |
78 | 82 | return true |
79 | 83 | end |
... | ... | @@ -100,7 +104,7 @@ function _M.endBattleRpc(agent, data) |
100 | 104 | role:setTowerRank(towerInfo.l) |
101 | 105 | |
102 | 106 | towerInfo.l = towerInfo.l + 1 |
103 | - reward = role:award(curTower.reward) | |
107 | + reward = role:award(curTower.reward, {log = {desc = "towerBattle", int1 = id}}) | |
104 | 108 | role:checkTaskEnter("TowerPass", {level = towerInfo.l - 1}) |
105 | 109 | end |
106 | 110 | |
... | ... | @@ -108,6 +112,9 @@ function _M.endBattleRpc(agent, data) |
108 | 112 | towerInfo.t = nextTime |
109 | 113 | towerInfo.k = nil |
110 | 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 | 118 | SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward})) |
112 | 119 | return true |
113 | 120 | end |
... | ... | @@ -124,12 +131,14 @@ function _M.bugCountRpc(agent, data) |
124 | 131 | cost[k] = v * needCount |
125 | 132 | end |
126 | 133 | if not role:checkItemEnough(cost) then return end |
127 | - role:costItems(cost) | |
134 | + role:costItems(cost, {log = {desc = "towerCount"}}) | |
128 | 135 | curCount = globalCsv.tower_count_limit |
129 | 136 | end |
130 | 137 | towerInfo.c = curCount |
131 | 138 | towerInfo.t = nextTime |
132 | 139 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
140 | + role:log("tower_action", {desc = "bugCount"}) | |
141 | + | |
133 | 142 | SendPacket(actionCodes.Tower_bugCountRpc, '') |
134 | 143 | return true |
135 | 144 | end | ... | ... |
src/adv/Adv.lua
... | ... | @@ -23,6 +23,17 @@ function Adv:ctor(owner) |
23 | 23 | self:initByInfo(self.owner:getProperty("advInfo")) |
24 | 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 | 37 | --初始化adv 信息 |
27 | 38 | function Adv:initByInfo(advInfo) |
28 | 39 | if not next(advInfo) then return end --还没有 开始新地图 |
... | ... | @@ -244,7 +255,7 @@ end |
244 | 255 | function Adv:activeSomeSupport() |
245 | 256 | -- 奖励物品 |
246 | 257 | if self.support[1] then |
247 | - self:award(self.support[1]) | |
258 | + self:award(self.support[1], {log = {desc = "support"}}) | |
248 | 259 | self.support[1] = nil |
249 | 260 | end |
250 | 261 | |
... | ... | @@ -274,7 +285,7 @@ function Adv:activeSomeSupport() |
274 | 285 | end |
275 | 286 | for i = 1, math.min(self.support[6], #pool) do |
276 | 287 | local idx = math.randomInt(1, #pool) |
277 | - self:award({[pool[idx]] = 1}) | |
288 | + self:award({[pool[idx]] = 1}, {log = {desc = "support"}}) | |
278 | 289 | table.remove(pool, idx) |
279 | 290 | end |
280 | 291 | self.support[6] = nil |
... | ... | @@ -317,7 +328,7 @@ end |
317 | 328 | -- 强制结束 |
318 | 329 | function Adv:forceOver(notNotify) |
319 | 330 | if self:isRunning() then |
320 | - self:clear() | |
331 | + | |
321 | 332 | local advTeam = self.owner:getProperty("advTeam") |
322 | 333 | advTeam.player = nil |
323 | 334 | |
... | ... | @@ -325,8 +336,9 @@ function Adv:forceOver(notNotify) |
325 | 336 | for itemId, count in pairs(reward) do |
326 | 337 | reward[itemId] = math.ceil(count * globalCsv.adv_fail_reward_ratio / 100) -- 奖励相当于失败 |
327 | 338 | end |
328 | - self.owner:award(reward) | |
339 | + self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}}) | |
329 | 340 | |
341 | + self:clear() | |
330 | 342 | self.owner:updateProperties({ |
331 | 343 | advInfo = {}, |
332 | 344 | advTeam = advTeam, |
... | ... | @@ -355,7 +367,7 @@ function Adv:checkAdvUnlock(utype, value) |
355 | 367 | end |
356 | 368 | end |
357 | 369 | if next(reward) then |
358 | - self.owner:award(reward) | |
370 | + self.owner:award(reward, {log = {desc = "advUnlock", int1 = self.chapterId}}) | |
359 | 371 | end |
360 | 372 | end |
361 | 373 | |
... | ... | @@ -365,7 +377,7 @@ function Adv:clearAdvUnlockCache() |
365 | 377 | reward[itemId] = 1 |
366 | 378 | end |
367 | 379 | if next(reward) then |
368 | - self.owner:award(reward) | |
380 | + self.owner:award(reward, {log = {desc = "advUnlock", int1 = self.chapterId}}) | |
369 | 381 | end |
370 | 382 | self.cacheUnlock = {} |
371 | 383 | end |
... | ... | @@ -427,6 +439,21 @@ function Adv:awardArtifact(id, params) |
427 | 439 | if self:isHaveArtifact(id) then return end |
428 | 440 | self.owner:changeUpdates({{type = "advAFGet", field = id, value = 1}}, params.notNotify) |
429 | 441 | self:checkAchievement(Adv.AchievType.GetMWeapon, 1, id) |
442 | + | |
443 | + | |
444 | + if params.log then | |
445 | + local log = clone(params.log) | |
446 | + if log["cint1"] or log["cint2"] or log["cint3"] then | |
447 | + print("awardArtifact error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
448 | + end | |
449 | + log["cint1"] = self.chapterId | |
450 | + log["cint2"] = self.level | |
451 | + log["cint3"] = id | |
452 | + self.owner:log("in_artifact", log) | |
453 | + else | |
454 | + print("awardArtifact no log ", debug.traceback()) | |
455 | + end | |
456 | + | |
430 | 457 | self:pushBackEvent(AdvBackEventType.Artifact, {id = id}) |
431 | 458 | end |
432 | 459 | |
... | ... | @@ -513,6 +540,7 @@ function Adv:wearArtifact(slot, id) |
513 | 540 | else |
514 | 541 | id = nil |
515 | 542 | end |
543 | + self:log({desc = "wearArtifact", int1 = id}) | |
516 | 544 | |
517 | 545 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) |
518 | 546 | return true |
... | ... | @@ -571,6 +599,9 @@ function Adv:artifactLevelUp(id, level) |
571 | 599 | end |
572 | 600 | if newLv == advAFGet[id] then return end |
573 | 601 | |
602 | + self:log({desc = "artifactLevelUp", int1 = id, int2 = level}) | |
603 | + | |
604 | + | |
574 | 605 | local status = 0 |
575 | 606 | if curWear[id] then -- 穿着呢 |
576 | 607 | local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] |
... | ... | @@ -595,7 +626,7 @@ function Adv:waitChooseArtifact() |
595 | 626 | end |
596 | 627 | end |
597 | 628 | if #pool == 0 then |
598 | - self:award({[ItemId.AdvPoint] = 48}) | |
629 | + self:award({[ItemId.AdvPoint] = 48}, {log = {desc = "chooseArtifact"}}) | |
599 | 630 | else |
600 | 631 | for i = 1, math.min(count, #pool) do |
601 | 632 | local idx = math.randomInt(1, #pool) |
... | ... | @@ -613,7 +644,10 @@ end |
613 | 644 | |
614 | 645 | function Adv:chooseArtifact(index) |
615 | 646 | if not self.waitArtifact or not self.waitArtifact[index] then return end |
616 | - self:award({[self.waitArtifact[index]] = 1}) | |
647 | + self:award({[self.waitArtifact[index]] = 1}, {log = {desc = "chooseArtifact"}}) | |
648 | + | |
649 | + self:log({desc = "chooseArtifact", int1 = self.waitArtifact[index]}) | |
650 | + | |
617 | 651 | self.waitArtifact = nil |
618 | 652 | |
619 | 653 | -- 支援效果继续选择 |
... | ... | @@ -657,7 +691,7 @@ function Adv:over(success, rewardRatio, overType) |
657 | 691 | local scoreInfo = self.score |
658 | 692 | |
659 | 693 | local scoreReward = math.floor(score / chapterData.scoreAward) |
660 | - self.owner:award({[ItemId.OldCoin] = scoreReward}) | |
694 | + self.owner:award({[ItemId.OldCoin] = scoreReward}, {log = {desc = "advOver", int1 = self.chapterId}}) | |
661 | 695 | |
662 | 696 | -- 被动技会影响奖励 |
663 | 697 | self.battle.player:triggerPassive(Passive.ADV_OVER, {score = score, level = self.level}) |
... | ... | @@ -671,7 +705,7 @@ function Adv:over(success, rewardRatio, overType) |
671 | 705 | reward[itemId] = math.ceil(count * rewardRatio / 100) |
672 | 706 | end |
673 | 707 | end |
674 | - reward = self.owner:award(reward) | |
708 | + reward = self.owner:award(reward, {log = {desc = "advOver", int1 = self.chapterId}}) | |
675 | 709 | |
676 | 710 | if success then |
677 | 711 | self.owner:checkTaskEnter("AdvPass", {id = self.chapterId, level = self.level, score = score}) |
... | ... | @@ -699,6 +733,9 @@ function Adv:over(success, rewardRatio, overType) |
699 | 733 | end |
700 | 734 | end |
701 | 735 | self:clearAdvUnlockCache() |
736 | + | |
737 | + self:log({desc = "over", short1 = success and 1 or 0, int1 = overType}) | |
738 | + | |
702 | 739 | self:clear() |
703 | 740 | self.owner:checkTaskEnter("AdvScore", {score = score}) |
704 | 741 | |
... | ... | @@ -788,6 +825,22 @@ function Adv:award(gift, params) |
788 | 825 | else |
789 | 826 | items = items:setv(itemId, nums) |
790 | 827 | end |
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("addAdvItem error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
833 | + end | |
834 | + log["cint1"] = origin | |
835 | + log["cint2"] = math.abs(count) | |
836 | + if count >= 0 then | |
837 | + self.owner:log("in_adv", log) | |
838 | + else | |
839 | + self.owner:log("out_adv", log) | |
840 | + end | |
841 | + else | |
842 | + print("addAdvItem no log ", debug.traceback()) | |
843 | + end | |
791 | 844 | end |
792 | 845 | end |
793 | 846 | if items ~= oldItems then |
... | ... | @@ -862,7 +915,7 @@ local function clickOut(self, room, block, params) |
862 | 915 | self.battle.player:triggerPassive(Passive.DOWN_LAYER) |
863 | 916 | |
864 | 917 | if curFloorData then |
865 | - self:backReward(self:award({[ItemId.AdvPoint] = curFloorData.exp})) | |
918 | + self:backReward(self:award({[ItemId.AdvPoint] = curFloorData.exp}, {log = {desc = "passReward", int1 = self.chapterId, int2 = self.level}})) | |
866 | 919 | end |
867 | 920 | local isHaveRelay = self:isHaveRelay(self.level) |
868 | 921 | |
... | ... | @@ -870,6 +923,7 @@ local function clickOut(self, room, block, params) |
870 | 923 | if isHaveRelay and not self.isRelay then |
871 | 924 | self:initByChapter(self.chapterId, self.level, true, true, true, false) |
872 | 925 | else |
926 | + self:log({desc = "pass"}) | |
873 | 927 | self:initByChapter(self.chapterId, self.level + 1, true, true, false, false) |
874 | 928 | end |
875 | 929 | self:backNext() --下一关 |
... | ... | @@ -985,7 +1039,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) |
985 | 1039 | local item = csvdb["event_dropCsv"][effect[2]]["range"]:randWeight(true) |
986 | 1040 | reward[item[1]] = (reward[item[1]] or 0) + item[2] |
987 | 1041 | end |
988 | - self:backReward(self:award(reward, {}), {roomId = room.roomId, blockId = block.blockId}) | |
1042 | + self:backReward(self:award(reward, {log = {desc = "chooseEvent", key1 = tag, int1 = chooseData.id}}), {roomId = room.roomId, blockId = block.blockId}) | |
989 | 1043 | end, |
990 | 1044 | [2] = function() --获得冒险buff |
991 | 1045 | local layer = effect[3] or 1 |
... | ... | @@ -1137,7 +1191,7 @@ local function clickDrop(self, room, block, params) |
1137 | 1191 | local reward = {} |
1138 | 1192 | if not block.event.item then return end |
1139 | 1193 | self.battle.player:triggerPassive(Passive.CLICK_DROP) |
1140 | - local reward = self:award({[block.event.item[1]] = block.event.item[2]}) | |
1194 | + local reward = self:award({[block.event.item[1]] = block.event.item[2]}, {log = {desc = "clickDrop"}}) | |
1141 | 1195 | -- local reward = self:award({[5801] = 1}) |
1142 | 1196 | block:clear() |
1143 | 1197 | self:backReward(reward, {roomId = room.roomId, blockId = block.blockId}) |
... | ... | @@ -1161,7 +1215,7 @@ local function clickTrader(self, room, block, params) |
1161 | 1215 | local costCount = math.ceil(goodsData.price * (block.event.shop[buyId][2] or 100) / 100) |
1162 | 1216 | if not self:cost({[goodsData.currency] = costCount}, {}) then return false, 6 end --不够 |
1163 | 1217 | self:backCost({[goodsData.currency] = costCount}) |
1164 | - local reward = self:award({[goodsData.item] = goodsData.num}) | |
1218 | + local reward = self:award({[goodsData.item] = goodsData.num}, {log = {desc = "clickTrader", int1 = block.event.id}}) | |
1165 | 1219 | if goodsData.restrict == 1 then |
1166 | 1220 | self.shopStatus[goodsData.goods] = (self.shopStatus[goodsData.goods] or 0) + 1 |
1167 | 1221 | elseif goodsData.restrict == 2 then |
... | ... | @@ -1214,7 +1268,7 @@ local function clickClick(self, room, block, params) |
1214 | 1268 | local item = csvdb["event_dropCsv"][dropId]["range"]:randWeight(true) |
1215 | 1269 | reward[item[1]] = (reward[item[1]] or 0) + item[2] |
1216 | 1270 | end |
1217 | - self:backReward(self:award(reward, {}), {roomId = room.roomId, blockId = block.blockId}) | |
1271 | + self:backReward(self:award(reward, {log = {desc = "clickClick", int1 = block.event.id}}), {roomId = room.roomId, blockId = block.blockId}) | |
1218 | 1272 | end, |
1219 | 1273 | [3] = function() |
1220 | 1274 | for _, buffId in ipairs(clickData.effect:toArray(true, "=")) do | ... | ... |
src/adv/AdvPassive.lua
... | ... | @@ -447,7 +447,7 @@ function Passive:effect8(dropId) |
447 | 447 | skynet.error(string.format("CSVDATA Error adv_map_passive %s effect 8 not id %s in event_drop", self.id, dropId)) |
448 | 448 | end |
449 | 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 | 451 | end |
452 | 452 | |
453 | 453 | --9=直接获得item(可在结算触发时使用) |
... | ... | @@ -461,13 +461,13 @@ function Passive:effect9(itemId, triggerPms, ratio, max) |
461 | 461 | return |
462 | 462 | end |
463 | 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 | 465 | end |
466 | 466 | |
467 | 467 | --10=战斗额外掉落次数 |
468 | 468 | function Passive:effect10(count, triggerPms) |
469 | 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 | 471 | end |
472 | 472 | end |
473 | 473 | ... | ... |
src/adv/AdvTask.lua
... | ... | @@ -137,7 +137,7 @@ function AdvTask.bind(Adv) |
137 | 137 | |
138 | 138 | local item = csvdb["event_dropCsv"][taskData.drop]["range"]:randWeight(true) |
139 | 139 | reward[item[1]] = (reward[item[1]] or 0) + item[2] |
140 | - reward = self:award(reward) | |
140 | + reward = self:award(reward, {log = {desc = "finishTask", int1 = taskId}}) | |
141 | 141 | |
142 | 142 | self:scoreChange(AdvScoreType.Task, taskData.advScore) --增加加分 |
143 | 143 | |
... | ... | @@ -155,7 +155,7 @@ function AdvTask.bind(Adv) |
155 | 155 | local mainTaskData = csvdb["adv_questCsv"][self.advMTask.id] |
156 | 156 | if not mainTaskData then return end |
157 | 157 | if mainTaskData.reward == 1 then |
158 | - reward = self.owner:award(mainTaskData.rewardValue) | |
158 | + reward = self.owner:award(mainTaskData.rewardValue, {log = {desc = "advMainTask", int1 = self.advMTask.id}}) | |
159 | 159 | end |
160 | 160 | self.advMTask.id = self.advMTask.id + 1 |
161 | 161 | self.advMTask.status = 0 |
... | ... | @@ -347,7 +347,7 @@ function AdvTask.bind(Adv) |
347 | 347 | insertChange(chapterId, -1, count) |
348 | 348 | |
349 | 349 | -- 发放奖励 |
350 | - reward = self.owner:award(achievData.reward) | |
350 | + reward = self.owner:award(achievData.reward, {log = {desc = "advAchiev", int1 = chapterId, int2 = taskId}}) | |
351 | 351 | return true, reward |
352 | 352 | end |
353 | 353 | end |
... | ... | @@ -359,7 +359,7 @@ function AdvTask.bind(Adv) |
359 | 359 | local status = ((self.owner:getProperty(achievField)[chapterId] or {})["pts"] or {})[taskId] or 0 |
360 | 360 | if status == -1 or count < achievData.pt then return end |
361 | 361 | |
362 | - local reward = self.owner:award(achievData.reward) | |
362 | + local reward = self.owner:award(achievData.reward, {log = {desc = "advAchievReward", int1 = chapterId, int2 = taskId}}) | |
363 | 363 | insertChange(chapterId, taskId, -1, true) |
364 | 364 | return true, reward |
365 | 365 | end | ... | ... |
src/agent.lua
... | ... | @@ -287,7 +287,12 @@ local function routeGM(cmd, params) |
287 | 287 | return "指令失败" |
288 | 288 | end |
289 | 289 | local _M = require "actions.GmAction" |
290 | - 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 | |
291 | 296 | end |
292 | 297 | |
293 | 298 | skynet.start(function() | ... | ... |
src/models/HeroPlugin.lua
... | ... | @@ -3,6 +3,17 @@ local HeroPlugin = {} |
3 | 3 | |
4 | 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 | 17 | function Hero:getMaxLevel() |
7 | 18 | return math.min(#csvdb["unit_expCsv"], csvdb["unit_breakCsv"][self:getProperty("breakL")].levelLimit) |
8 | 19 | end | ... | ... |
src/models/RoleCross.lua
... | ... | @@ -73,7 +73,7 @@ RoleCross.bind = function (Role) |
73 | 73 | for k , v in pairs(initData.items or {}) do |
74 | 74 | reward[tonumber(k)] = v |
75 | 75 | end |
76 | - self:award(reward) | |
76 | + self:award(reward, {log = {desc = "gm"}}) | |
77 | 77 | |
78 | 78 | -- 英雄 |
79 | 79 | local breakL = 0 |
... | ... | @@ -95,7 +95,7 @@ RoleCross.bind = function (Role) |
95 | 95 | local hero = self:isHaveHero(heroId) |
96 | 96 | local status |
97 | 97 | if not hero then |
98 | - status, hero = self:addHero({type = heroId}) | |
98 | + status, hero = self:addHero({type = heroId, log = {desc = "gm"}}) | |
99 | 99 | else |
100 | 100 | status = true |
101 | 101 | end |
... | ... | @@ -103,7 +103,7 @@ RoleCross.bind = function (Role) |
103 | 103 | local rune = "" |
104 | 104 | for slot , runeId in pairs(initData.heros.rune) do |
105 | 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 | 107 | if status == 0 then |
108 | 108 | rune = rune:setv(slot, rune_:getProperty("uid")) |
109 | 109 | if initData.heros.runeL and initData.heros.runeL > 0 then | ... | ... |
src/models/RoleLog.lua
... | ... | @@ -4,8 +4,8 @@ local LogType = { |
4 | 4 | create = "common", |
5 | 5 | login = "common", |
6 | 6 | logout = "common", |
7 | - gm = "common", | |
8 | - mail_actions = "common", | |
7 | + guide = "common", | |
8 | + | |
9 | 9 | in_item = "common", |
10 | 10 | out_item = "common", |
11 | 11 | in_diamond = "common", |
... | ... | @@ -18,10 +18,20 @@ local LogType = { |
18 | 18 | out_rune = "common", |
19 | 19 | player_exp = "common", |
20 | 20 | func_open = "common", |
21 | + in_adv = "common", | |
22 | + out_adv = "common", | |
23 | + in_artifact = "common", | |
24 | + | |
25 | + mail_action = "common", | |
21 | 26 | role_action = "common", |
22 | - guide = "common", | |
23 | - guide_sys = "common", | |
24 | - guide_weak = "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", | |
25 | 35 | } |
26 | 36 | |
27 | 37 | -- 如要修改 要提前修改 _template mapping -- 对应 mapping 为 gamelog-* | ... | ... |
src/models/RolePlugin.lua
... | ... | @@ -669,7 +669,7 @@ function RolePlugin.bind(Role) |
669 | 669 | end |
670 | 670 | if heartWarning < 50 and heartWarning % 5 == 0 then |
671 | 671 | self:sendGmMsg("server_accountBanned_warning") |
672 | - self:log("gm",{desc = "heartWarning", int1 = heartWarning}) | |
672 | + self:log("role_action",{desc = "heartWarning", int1 = heartWarning}) | |
673 | 673 | end |
674 | 674 | end |
675 | 675 | |
... | ... | @@ -682,11 +682,11 @@ function RolePlugin.bind(Role) |
682 | 682 | self:setProperty("banType", 0) |
683 | 683 | self:setProperty("heartWarning", 0) |
684 | 684 | |
685 | - self:log("gm", {desc = "ban_rm"}) | |
685 | + self:log("role_action", {desc = "ban_rm"}) | |
686 | 686 | else |
687 | 687 | self:setProperty("banTime", now + 86400 * time) |
688 | 688 | self:setProperty("banType", banType) |
689 | - self:log("gm",{desc = "ban", int1 = time, int2 = banType}) | |
689 | + self:log("role_action", {desc = "ban", int1 = time, int2 = banType}) | |
690 | 690 | end |
691 | 691 | end |
692 | 692 | ... | ... |
src/models/RolePvp.lua
... | ... | @@ -467,7 +467,7 @@ function Role:getCrossServerPvpBetInfo() |
467 | 467 | end |
468 | 468 | end |
469 | 469 | |
470 | -function Role:getCrossServerPvpBet(idx) | |
470 | +function Role:setCrossServerPvpBet(idx) | |
471 | 471 | if not self:isTimeResetOpen(TimeReset.PvpCross) then return end |
472 | 472 | local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) |
473 | 473 | local aday = 3600 * 24 |
... | ... | @@ -486,7 +486,7 @@ function Role:getCrossServerPvpBet(idx) |
486 | 486 | local ok, result = pcall(skynet.call, pvpd, "lua", "setBet", idx) |
487 | 487 | if ok then |
488 | 488 | if result then |
489 | - self:costItems(cost) | |
489 | + self:costItems(cost, {log = {desc = "crossPvpBet", short1 = day}}) | |
490 | 490 | pvpBet[day] = {idx, cost[ItemId.Gold]} |
491 | 491 | self:setProperty("pvpBet", pvpBet) |
492 | 492 | end | ... | ... |
src/models/Rune.lua
... | ... | @@ -26,6 +26,18 @@ function Rune:notifyUpdateProperty(field, newValue, oldValue) |
26 | 26 | self:notifyUpdateProperties(datas) |
27 | 27 | end |
28 | 28 | |
29 | +function Rune:log(contents) | |
30 | + contents = contents or {} | |
31 | + if contents["cint1"] or contents["cint2"] or contents["cint3"] then | |
32 | + print("heroLog error log have cint1 or cint2 or cint3 ", debug.traceback()) | |
33 | + end | |
34 | + contents["cint1"] = self:getProperty("uid") | |
35 | + contents["cint2"] = self:getProperty("type") | |
36 | + contents["cint3"] = self:getProperty("id") | |
37 | + | |
38 | + self.owner:log("rune_action", contents) | |
39 | +end | |
40 | + | |
29 | 41 | function Rune:notifyUpdateProperties(params) |
30 | 42 | local updateData = { |
31 | 43 | uid = self:getProperty("uid"), | ... | ... |