Commit e84a1bebb1b40e1bef2b531f1bac77224af355bc

Authored by liuzujun
1 parent be5f29fa

gm后台查询日志,公告相关协议

src/ProtocolCode.lua
@@ -8,6 +8,7 @@ actionCodes = { @@ -8,6 +8,7 @@ actionCodes = {
8 Sys_maintainNotice = 6, 8 Sys_maintainNotice = 6,
9 Sys_customNotice = 7, 9 Sys_customNotice = 7,
10 Sys_checkQueue = 8, 10 Sys_checkQueue = 8,
  11 + Sys_gameNotice = 9,
11 12
12 Gm_clientRequest = 20, 13 Gm_clientRequest = 20,
13 Gm_receiveResponse = 21, 14 Gm_receiveResponse = 21,
src/actions/ActivityAction.lua
@@ -1434,7 +1434,7 @@ function _M.returnerTaskRpc(agent, data) @@ -1434,7 +1434,7 @@ function _M.returnerTaskRpc(agent, data)
1434 local TaskCsv = csvdb["activity_taskCsv"][76] or {} 1434 local TaskCsv = csvdb["activity_taskCsv"][76] or {}
1435 local taskData = TaskCsv[taskId] 1435 local taskData = TaskCsv[taskId]
1436 if not taskData then return 2 end 1436 if not taskData then return 2 end
1437 - if curAllDay < taskData.day then return 2 end 1437 + if curAllDay < taskData.day then return 5 end
1438 1438
1439 local status = returner.status or {} 1439 local status = returner.status or {}
1440 if status[taskId] then return 3 end 1440 if status[taskId] then return 3 end
src/actions/DinerAction.lua
@@ -112,6 +112,8 @@ function _M.addSellRpc( agent, data ) @@ -112,6 +112,8 @@ function _M.addSellRpc( agent, data )
112 112
113 role:mylog("diner_action", {desc = "addSell", int1 = dish, int2 = count}) 113 role:mylog("diner_action", {desc = "addSell", int1 = dish, int2 = count})
114 114
  115 + role:mylog("diner_action", {desc = "onSell", short1 = 1, int1 = dish, int2 = count, cint1 = msg.slot, cint2 = count, cint3 = dishLevel})
  116 +
115 role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) 117 role.dinerData:updateProperty({field = "sells", value = json.encode(sells)})
116 SendPacket(actionCodes.Diner_addSellRpc, "") 118 SendPacket(actionCodes.Diner_addSellRpc, "")
117 return true 119 return true
@@ -192,7 +194,10 @@ function _M.getSellRewardRpc( agent, data ) @@ -192,7 +194,10 @@ function _M.getSellRewardRpc( agent, data )
192 } 194 }
193 deltaTimes[slot] = temp.deltaTime 195 deltaTimes[slot] = temp.deltaTime
194 local sellCount = oldCount - temp.lastCount 196 local sellCount = oldCount - temp.lastCount
195 - role:mylog("diner_action", {desc = "sell", int1 = sellDish, int2 = sellCount}) 197 + if sellCount > 0 then
  198 + role:mylog("diner_action", {desc = "sell", int1 = sellDish, int2 = sellCount})
  199 + role:mylog("diner_action", {desc = "onSell", short1 = 2, int1 = sellDish, int2 = sellCount, cint1 = tonumber(slot), cint2 = temp.lastCount, cint3 = sell.level})
  200 + end
196 end 201 end
197 sells = json.decode(role.dinerData:getProperty("sells")) 202 sells = json.decode(role.dinerData:getProperty("sells"))
198 for slot, sell in pairs(sells) do 203 for slot, sell in pairs(sells) do
@@ -310,6 +315,9 @@ function _M.expediteSellRpc( agent, data ) @@ -310,6 +315,9 @@ function _M.expediteSellRpc( agent, data )
310 restaurant_sale_coin = rewards[ItemId.DinerCoin] or 0, -- 售卖获得美食币 315 restaurant_sale_coin = rewards[ItemId.DinerCoin] or 0, -- 售卖获得美食币
311 restaurant_sale_gear = rewards[ItemId.Gold] or 0, -- 售卖获得齿轮 316 restaurant_sale_gear = rewards[ItemId.Gold] or 0, -- 售卖获得齿轮
312 }) 317 })
  318 + if result.expediteCount > 0 then
  319 + role:mylog("diner_action", {desc = "onSell", short1 = 3, int1 = sell.dish, int2 = result.expediteCount, cint1 = tonumber(slot), cint2 = result.lastCount, cint3 = sell.level})
  320 + end
313 end 321 end
314 end 322 end
315 323
src/actions/EmailAction.lua
@@ -129,7 +129,7 @@ function _M.drawAllAttachRpc(agent, data) @@ -129,7 +129,7 @@ function _M.drawAllAttachRpc(agent, data)
129 for key, v in pairs(attachments:toNumMap()) do 129 for key, v in pairs(attachments:toNumMap()) do
130 reward[key] = (reward[key] or 0) + v 130 reward[key] = (reward[key] or 0) + v
131 end 131 end
132 - role:mylog("mail_action", {desc = "draw_attach", int1 = email:getProperty("emailId"), key1 = email:getProperty("title"), key2 = attachments}) 132 + --role:mylog("mail_action", {desc = "draw_attach", int1 = email:getProperty("emailId"), key1 = email:getProperty("title"), key2 = attachments})
133 end 133 end
134 end 134 end
135 if role:checkRuneFullyByReward(reward) then return 1 end 135 if role:checkRuneFullyByReward(reward) then return 1 end
@@ -168,7 +168,7 @@ function _M.drawAttachRpc(agent, data) @@ -168,7 +168,7 @@ function _M.drawAttachRpc(agent, data)
168 email:setProperty("status", 2, true) 168 email:setProperty("status", 2, true)
169 email:log(role, 2) 169 email:log(role, 2)
170 SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward, change = change})) 170 SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward, change = change}))
171 - role:mylog("mail_action", {desc = "draw_attach", int1 = email:getProperty("emailId"), key1 = email:getProperty("title"), key2 = attachments}) 171 + --role:mylog("mail_action", {desc = "draw_attach", int1 = email:getProperty("emailId"), key1 = email:getProperty("title"), key2 = attachments})
172 return true 172 return true
173 end 173 end
174 174
@@ -184,7 +184,7 @@ function _M.checkRpc(agent, data) @@ -184,7 +184,7 @@ function _M.checkRpc(agent, data)
184 184
185 email:setProperty("status", 1, true) 185 email:setProperty("status", 1, true)
186 email:log(role, 1) 186 email:log(role, 1)
187 - role:mylog("mail_action", {desc = "check_mail", int1 = id}) 187 + --role:mylog("mail_action", {desc = "check_mail", int1 = id})
188 188
189 SendPacket(actionCodes.Email_checkRpc, '') 189 SendPacket(actionCodes.Email_checkRpc, '')
190 return true 190 return true
src/actions/GmAction.lua
@@ -38,6 +38,7 @@ function _M.ban(role, pms) @@ -38,6 +38,7 @@ function _M.ban(role, pms)
38 38
39 role:setBan(time, ctype) 39 role:setBan(time, ctype)
40 role:mylog("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender}) 40 role:mylog("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender})
  41 +
41 return "封杀成功" 42 return "封杀成功"
42 end 43 end
43 44
@@ -64,14 +65,16 @@ function _M.reset_rank(role, pms) @@ -64,14 +65,16 @@ function _M.reset_rank(role, pms)
64 end 65 end
65 66
66 function _M.silent(role, pms) 67 function _M.silent(role, pms)
67 - local pm1 = tonum(pms.pm1) 68 + local pm1 = tonum(pms.pm1, 0)
  69 + dump(pms, pm1)
68 if pm1 < 1 then 70 if pm1 < 1 then
69 role:updateProperty({field = "silent", value = 0}) 71 role:updateProperty({field = "silent", value = 0})
  72 + role:setProperty("silentType", 0)
70 return "解禁言成功" 73 return "解禁言成功"
71 end 74 end
72 role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400}) 75 role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400})
73 -  
74 - role:mylog("gm_action", {desc = "silent", int1 = pms.pm1, key1 = pms.sender}) 76 + role:setProperty("silentType", pms.pm2 or 0)
  77 + role:mylog("gm_action", {desc = "silent", int1 = pm1, key1 = pms.sender})
75 return "禁言成功" 78 return "禁言成功"
76 end 79 end
77 80
src/actions/HangAction.lua
@@ -353,10 +353,12 @@ function _M.endBattleRpc(agent, data) @@ -353,10 +353,12 @@ function _M.endBattleRpc(agent, data)
353 reward = reward, 353 reward = reward,
354 }) 354 })
355 355
356 - local team = role:getProperty("pvpTC") 356 + --local team = role:getProperty("pvpTC")
  357 + local team = role:getTeamFormatByType(TeamSystemType.Hang)
357 358
358 local battleTime = skynet.timex() - role._StartBattleTs 359 local battleTime = skynet.timex() - role._StartBattleTs
359 - role:mylog("hang_action", {desc = "hangBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = carbonId, int2 = role:getProperty("hangTBV"), cint1 = role:getHerosCamp(team.heros), cint2 = battleTime}) 360 + role:mylog("hang_action", {desc = "hangBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = carbonId, int2 = role:getProperty("hangTBV"),
  361 + cint1 = role:getHerosCamp(team.heros), cint2 = battleTime, key1 = role:getHerosLogStr(team.heros), key2 = role:getRewardLogStr(reward)})
360 362
361 SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ 363 SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({
362 starNum = msg.starNum, 364 starNum = msg.starNum,
src/actions/HeroAction.lua
@@ -1040,6 +1040,7 @@ function _M.drawHeroRpc(agent, data) @@ -1040,6 +1040,7 @@ function _M.drawHeroRpc(agent, data)
1040 end 1040 end
1041 end 1041 end
1042 1042
  1043 + local itemCount = 1
1043 if role:isHaveHero(itemData.id - ItemStartId.Hero) then 1044 if role:isHaveHero(itemData.id - ItemStartId.Hero) then
1044 local fragId = itemData.id - ItemStartId.Hero 1045 local fragId = itemData.id - ItemStartId.Hero
1045 local heroData = csvdb["unitCsv"][fragId] 1046 local heroData = csvdb["unitCsv"][fragId]
@@ -1047,6 +1048,7 @@ function _M.drawHeroRpc(agent, data) @@ -1047,6 +1048,7 @@ function _M.drawHeroRpc(agent, data)
1047 role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId, short1=isFloorBack and 1 or 0}}) 1048 role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId, short1=isFloorBack and 1 or 0}})
1048 logReward[fragId] = (logReward[fragId] or 0) + count 1049 logReward[fragId] = (logReward[fragId] or 0) + count
1049 table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) 1050 table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1})
  1051 + itemCount = count
1050 else 1052 else
1051 role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId, short1=isFloorBack and 1 or 0}}) 1053 role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId, short1=isFloorBack and 1 or 0}})
1052 logReward[itemId] = (logReward[itemId] or 0) + 1 1054 logReward[itemId] = (logReward[itemId] or 0) + 1
@@ -1064,6 +1066,10 @@ function _M.drawHeroRpc(agent, data) @@ -1064,6 +1066,10 @@ function _M.drawHeroRpc(agent, data)
1064 1066
1065 dailyDrawCnt = dailyDrawCnt + 1 1067 dailyDrawCnt = dailyDrawCnt + 1
1066 role:checkTaskEnter("DrawHeroLimitPack", {count = dailyDrawCnt}) 1068 role:checkTaskEnter("DrawHeroLimitPack", {count = dailyDrawCnt})
  1069 +
  1070 + local ssrUpMap = role:getProperty("ssrUp") or {}
  1071 + local ssrFloorCnt = ssrUpMap[poolId] or 0
  1072 + role:mylog("hero_action", {desc = "drawHero", int1=poolId, int2=btype, short1 = drawCount[drawType], cint1 = ssrFloorCnt, cint2 = itemId, cint3 = itemCount})
1067 end 1073 end
1068 1074
1069 role:award(drawAddReward, {log = {desc = "drawHero", int1 = btype}}) 1075 role:award(drawAddReward, {log = {desc = "drawHero", int1 = btype}})
@@ -1099,7 +1105,7 @@ function _M.drawHeroRpc(agent, data) @@ -1099,7 +1105,7 @@ function _M.drawHeroRpc(agent, data)
1099 gacha_cnt = floorHeroCount, 1105 gacha_cnt = floorHeroCount,
1100 }) 1106 })
1101 1107
1102 - role:mylog("hero_action", {desc = "drawHero", int1=poolId, int2=btype, short1 = drawCount[drawType]}) 1108 + --role:mylog("hero_action", {desc = "drawHero", int1=poolId, int2=btype, short1 = drawCount[drawType]})
1103 SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward, subReward = drawAddReward})) -- 这个 reward 是数组 1109 SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward, subReward = drawAddReward})) -- 这个 reward 是数组
1104 1110
1105 local feedbackId = buildTypeData["can_feedback"] or 0 1111 local feedbackId = buildTypeData["can_feedback"] or 0
src/actions/HttpAction.lua
@@ -143,6 +143,7 @@ function _M.gm_action(query) @@ -143,6 +143,7 @@ function _M.gm_action(query)
143 role:startActionUcode() 143 role:startActionUcode()
144 local status = gmFuncs[query.cmd](role, query) 144 local status = gmFuncs[query.cmd](role, query)
145 role:endActionUcode() 145 role:endActionUcode()
  146 + role:update()
146 147
147 return status 148 return status
148 end 149 end
@@ -208,7 +209,14 @@ function _M.broadcast(query) @@ -208,7 +209,14 @@ function _M.broadcast(query)
208 msg["body"] = query.content 209 msg["body"] = query.content
209 msg["logout"] = query.logout 210 msg["logout"] = query.logout
210 end 211 end
211 - } 212 + },
  213 + ["game"] = {
  214 + code = actionCodes.Sys_gameNotice,
  215 + exec = function()
  216 + msg["new"] = query.status
  217 + msg["channels"] = query.channels
  218 + end
  219 + },
212 } 220 }
213 if not handle[query.cmd] then return "错误" end 221 if not handle[query.cmd] then return "错误" end
214 handle[query.cmd].exec() 222 handle[query.cmd].exec()
src/actions/PvpAction.lua
@@ -472,7 +472,8 @@ function _M.endBattleRpc(agent, data) @@ -472,7 +472,8 @@ function _M.endBattleRpc(agent, data)
472 reward = reward, 472 reward = reward,
473 rank = myRank, 473 rank = myRank,
474 }) 474 })
475 - role:mylog("pvp_action", {desc = "battleEnd", short1 = 1, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0}) 475 + role:mylog("pvp_action", {desc = "battleEnd", short1 = 1, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0, cint1 = oldMyRank, cint2 = myRank,
  476 + cint3 = match.id, long1 = 1, key1 = msg.key, key2 = role:getHerosLogStr(role:getProperty("pvpTC").heros)})
476 477
477 _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 478 _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病
478 _pvpRecordInfoCacheC = {} -- 记录刷新了 479 _pvpRecordInfoCacheC = {} -- 记录刷新了
@@ -578,7 +579,6 @@ function _M.startBattleHRpc(agent, data) @@ -578,7 +579,6 @@ function _M.startBattleHRpc(agent, data)
578 579
579 if not revenge then 580 if not revenge then
580 -- 次数扣一波 581 -- 次数扣一波
581 - print("xxxxx")  
582 local pvpFreeH = role.dailyData:getProperty("pvpFreeH") 582 local pvpFreeH = role.dailyData:getProperty("pvpFreeH")
583 if pvpFreeH >= globalCsv.pvp_battle_free_count_high then 583 if pvpFreeH >= globalCsv.pvp_battle_free_count_high then
584 local cost = {[ItemId.PvpKey] = globalCsv.pvp_battle_high_cost} 584 local cost = {[ItemId.PvpKey] = globalCsv.pvp_battle_high_cost}
@@ -676,11 +676,13 @@ function _M.endBattleHRpc(agent, data) @@ -676,11 +676,13 @@ function _M.endBattleHRpc(agent, data)
676 video = video, 676 video = video,
677 }) 677 })
678 678
  679 + local curStatus
679 -- 检查是否结束战斗 680 -- 检查是否结束战斗
680 local winCount, loseCount = 0, 0 681 local winCount, loseCount = 0, 0
681 for _, status in pairs(_pvpStartBattleCacheH.result) do 682 for _, status in pairs(_pvpStartBattleCacheH.result) do
682 if status.isWin then 683 if status.isWin then
683 winCount = winCount + 1 684 winCount = winCount + 1
  685 + curStatus = true
684 else 686 else
685 loseCount = loseCount + 1 687 loseCount = loseCount + 1
686 end 688 end
@@ -696,6 +698,8 @@ function _M.endBattleHRpc(agent, data) @@ -696,6 +698,8 @@ function _M.endBattleHRpc(agent, data)
696 return true 698 return true
697 end 699 end
698 700
  701 + local curHTeam = _pvpStartBattleCacheH.pvpTH[#_pvpStartBattleCacheH.result] or {}
  702 +
699 if winCount >= 2 then 703 if winCount >= 2 then
700 isWin = true 704 isWin = true
701 elseif loseCount >= 2 then 705 elseif loseCount >= 2 then
@@ -720,6 +724,8 @@ function _M.endBattleHRpc(agent, data) @@ -720,6 +724,8 @@ function _M.endBattleHRpc(agent, data)
720 video = video, -- 返回让客户端上传录像 724 video = video, -- 返回让客户端上传录像
721 headers = headers, 725 headers = headers,
722 })) 726 }))
  727 + role:mylog("pvp_action", {desc = "battleEnd", short1 = 2, int1 = curStatus and 1 or 0, int2 = revenge and 1 or 0, cint1 = 0, cint2 = 0,
  728 + cint3 = match.id, long1 = #_pvpStartBattleCacheH.result, key1 = msg.key, key2 = role:getHerosLogStr(curHTeam.heros)})
723 return true 729 return true
724 end 730 end
725 if revenge and isWin then 731 if revenge and isWin then
@@ -814,6 +820,8 @@ function _M.endBattleHRpc(agent, data) @@ -814,6 +820,8 @@ function _M.endBattleHRpc(agent, data)
814 rank = myRank, 820 rank = myRank,
815 }) 821 })
816 822
  823 + role:mylog("pvp_action", {desc = "battleEnd", short1 = 2, int1 = curStatus and 1 or 0, int2 = revenge and 1 or 0, cint1 = oldMyRank, cint2 = myRank,
  824 + cint3 = match.id, long1 = #_pvpStartBattleCacheH.result, key1 = msg.key, key2 = role:getHerosLogStr(curHTeam.heros)})
817 825
818 _pvpBattleInfoCacheH = {} --重新发阵容了 没毛病 826 _pvpBattleInfoCacheH = {} --重新发阵容了 没毛病
819 _pvpRecordInfoCacheH = {} -- 记录刷新了 827 _pvpRecordInfoCacheH = {} -- 记录刷新了
@@ -825,7 +833,7 @@ function _M.endBattleHRpc(agent, data) @@ -825,7 +833,7 @@ function _M.endBattleHRpc(agent, data)
825 if isWin then 833 if isWin then
826 role:checkTaskEnter("PvpWin", {score = myScore}) 834 role:checkTaskEnter("PvpWin", {score = myScore})
827 end 835 end
828 - role:mylog("pvp_action", {desc = "battleEnd", short1 = 2, int1 = isWin and 1 or 0, int2 = revenge and 1 or 0}) 836 +
829 837
830 SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ 838 SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({
831 reward = reward, 839 reward = reward,
src/actions/RoleAction.lua
@@ -1216,7 +1216,7 @@ function _M.chatRpc(agent, data) @@ -1216,7 +1216,7 @@ function _M.chatRpc(agent, data)
1216 [1] = function () 1216 [1] = function ()
1217 if role:getProperty("silent") > now then --禁言 1217 if role:getProperty("silent") > now then --禁言
1218 result = 1 1218 result = 1
1219 - return 1219 + --return
1220 end 1220 end
1221 if role:getProperty("level") < (globalCsv.chat_level or 15) then 1221 if role:getProperty("level") < (globalCsv.chat_level or 15) then
1222 result = 3 1222 result = 3
@@ -1245,7 +1245,12 @@ function _M.chatRpc(agent, data) @@ -1245,7 +1245,12 @@ function _M.chatRpc(agent, data)
1245 return 1245 return
1246 end 1246 end
1247 end 1247 end
1248 - mcast_util.pub_world(actionCodes.Role_chat, MsgPack.pack(response)) 1248 + if result == 1 then
  1249 + SendPacket(actionCodes.Role_chat, MsgPack.pack(response))
  1250 + result = 0
  1251 + else
  1252 + mcast_util.pub_world(actionCodes.Role_chat, MsgPack.pack(response))
  1253 + end
1249 -- pcall(skynet.send, '.globald', "lua", "sendWorldMsg", role._channelIdx, response) 1254 -- pcall(skynet.send, '.globald', "lua", "sendWorldMsg", role._channelIdx, response)
1250 role:mylog("role_action", {desc = "chatWorld", text1 = content}) 1255 role:mylog("role_action", {desc = "chatWorld", text1 = content})
1251 end, 1256 end,
@@ -1361,7 +1366,7 @@ function _M.drawCodeRpc(agent, data) @@ -1361,7 +1366,7 @@ function _M.drawCodeRpc(agent, data)
1361 gift_name = "", -- 礼包名称 1366 gift_name = "", -- 礼包名称
1362 gift_reason = 0, -- 礼包发放原因,见发放原因枚举表 1367 gift_reason = 0, -- 礼包发放原因,见发放原因枚举表
1363 }) 1368 })
1364 - role:mylog("role_action", {desc = "drawCode", int1 = giftId, key1 = code}) 1369 + role:mylog("role_action", {desc = "drawCode", int1 = giftId, key1 = code, key2 = role:getRewardLogStr(result.gift)})
1365 SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ 1370 SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({
1366 result = ret, 1371 result = ret,
1367 reward = reward, 1372 reward = reward,
src/actions/StoreAction.lua
@@ -307,9 +307,11 @@ function _M.shopBuyRpc(agent , data) @@ -307,9 +307,11 @@ function _M.shopBuyRpc(agent , data)
307 307
308 if not role:checkItemEnough(cost) then return 4 end 308 if not role:checkItemEnough(cost) then return 4 end
309 309
  310 + local limitStr = ""
310 if dataSet.limit ~= 0 then 311 if dataSet.limit ~= 0 then
311 buyRecord[id] = (buyRecord[id] or 0) + count 312 buyRecord[id] = (buyRecord[id] or 0) + count
312 role.storeData:updateProperty({field = "buyR", value = buyRecord}) 313 role.storeData:updateProperty({field = "buyR", value = buyRecord})
  314 + limitStr = string.format("%s/%s", buyRecord[id], dataSet.limit)
313 end 315 end
314 role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, short1 = dataSet.shop}}) 316 role:costItems(cost, {log = {desc = desc, int1 = id, int2 = count, short1 = dataSet.shop}})
315 317
@@ -333,7 +335,7 @@ function _M.shopBuyRpc(agent , data) @@ -333,7 +335,7 @@ function _M.shopBuyRpc(agent , data)
333 shop_purchase_current = costCount or 0, -- 购买道具消耗的货币数量 335 shop_purchase_current = costCount or 0, -- 购买道具消耗的货币数量
334 shop_id = dataSet.shop, -- 商店ID 336 shop_id = dataSet.shop, -- 商店ID
335 }) 337 })
336 - role:mylog("role_action", {desc = desc, int1 = id, int2 = count}) 338 + role:mylog("role_action", {desc = "shopBuy", int1 = id, int2 = count, short1=dataSet.shop, key1 = limitStr})
337 SendPacket(actionCodes.Store_shopBuyRpc, MsgPack.pack({reward = reward})) 339 SendPacket(actionCodes.Store_shopBuyRpc, MsgPack.pack({reward = reward}))
338 return true 340 return true
339 end 341 end
src/actions/TowerAction.lua
@@ -150,7 +150,11 @@ function _M.endBattleRpc(agent, data) @@ -150,7 +150,11 @@ function _M.endBattleRpc(agent, data)
150 rank = rank, 150 rank = rank,
151 tower = towerType + 1 151 tower = towerType + 1
152 }) 152 })
153 - role:mylog("tower_action", {desc = "endBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id}) 153 + local team = role:getTowerTeamFormat(towerType + 1)
  154 +
  155 +
  156 + role:mylog("tower_action", {desc = "endBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id, int2 = towerType,
  157 + cint1 = curLevel, key1 = role:getHerosLogStr(team.heros), key2 = role:getRewardLogStr(reward)})
154 158
155 SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward, change = change})) 159 SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward, change = change}))
156 return true 160 return true
@@ -924,10 +924,11 @@ function Adv:over(success, rewardRatio, overType) @@ -924,10 +924,11 @@ function Adv:over(success, rewardRatio, overType)
924 end 924 end
925 self:clearAdvUnlockCache() 925 self:clearAdvUnlockCache()
926 926
927 - self:mylog({desc = "over", short1 = success and 1 or 0, int1 = overType, int2 = self.chapterId, long1 = self.level}) 927 + local team = self.owner:getProperty("advTeam")
  928 + self:mylog({desc = "over", short1 = success and 1 or 0, int1 = overType, int2 = self.chapterId, long1 = self.level,
  929 + key1 = self.owner:getRewardLogStr(reward), key2 = self.owner:getHerosLogStr(team.heros)})
928 930
929 931
930 - local team = self.owner:getProperty("advTeam")  
931 local player = {} 932 local player = {}
932 local attrs = self.owner:getTeamBattleInfo(team).heros 933 local attrs = self.owner:getTeamBattleInfo(team).heros
933 for _, hero in pairs(attrs) do 934 for _, hero in pairs(attrs) do
1 -Subproject commit 8e6c36f6d7a90dbec06c5a28d8538b80a65ca910 1 +Subproject commit 4d894270d4aeb6352a29dfd3a8686cbaea5b427c
src/models/Email.lua
@@ -33,6 +33,8 @@ function Email:log(role, action) @@ -33,6 +33,8 @@ function Email:log(role, action)
33 mail_friend_id = 0, -- 收件方账号id 33 mail_friend_id = 0, -- 收件方账号id
34 mail_friend_roleid = 0, -- 收件方角色id 34 mail_friend_roleid = 0, -- 收件方角色id
35 }) 35 })
  36 + role:mylog("mail_action", {desc = "onMail", int1 = self:getProperty("id"), int2 = self:getProperty("status"), cint1 = self:getProperty("emailId"),
  37 + short1 = action, key1=self:getProperty("title"), key2=self:getProperty("attachments")})
36 end 38 end
37 39
38 function Email:data() 40 function Email:data()
src/models/Role.lua
@@ -8,6 +8,7 @@ local RoleChangeStruct = import(&quot;.RoleChangeStruct&quot;) --角色数据额结构更 @@ -8,6 +8,7 @@ local RoleChangeStruct = import(&quot;.RoleChangeStruct&quot;) --角色数据额结构更
8 local RolePvp = import(".RolePvp") -- pvp 8 local RolePvp = import(".RolePvp") -- pvp
9 local RoleCross = import(".RoleCross") -- 跨服务请求相关 9 local RoleCross = import(".RoleCross") -- 跨服务请求相关
10 local RoleBattle = import(".RoleBattle") -- 跨服务请求相关 10 local RoleBattle = import(".RoleBattle") -- 跨服务请求相关
  11 +local mysqlproxy = require "shared.mysqlproxy"
11 12
12 RoleLog.bind(Role) 13 RoleLog.bind(Role)
13 RolePlugin.bind(Role) 14 RolePlugin.bind(Role)
@@ -56,6 +57,7 @@ Role.schema = { @@ -56,6 +57,7 @@ Role.schema = {
56 lday = {"number", 0}, 57 lday = {"number", 0},
57 banTime = {"number", 0}, 58 banTime = {"number", 0},
58 banType = {"number", 0}, 59 banType = {"number", 0},
  60 + banReason = {"string", "", "", 512},
59 heartWarning = {"number", 0}, 61 heartWarning = {"number", 0},
60 cheatCount = {"number", 0}, 62 cheatCount = {"number", 0},
61 ltime = {"number", 0}, -- 最后登录时间 63 ltime = {"number", 0}, -- 最后登录时间
@@ -79,6 +81,7 @@ Role.schema = { @@ -79,6 +81,7 @@ Role.schema = {
79 -- loveStatus = {"string", ""}, --统计角色的最高 好感度等级 类型相关 -- type=loveL type=loveL 81 -- loveStatus = {"string", ""}, --统计角色的最高 好感度等级 类型相关 -- type=loveL type=loveL
80 crown = {"number", 0}, -- 看伴娘 82 crown = {"number", 0}, -- 看伴娘
81 silent = {"number", 0}, --禁言解禁时间 83 silent = {"number", 0}, --禁言解禁时间
  84 + silentType = {"number", 0}, -- 禁言类型
82 timeGift = {"number", 0}, -- 创建角色时间礼包 85 timeGift = {"number", 0}, -- 创建角色时间礼包
83 86
84 bagLimit = {"table", globalCsv.store_limit_max}, 87 bagLimit = {"table", globalCsv.store_limit_max},
@@ -345,6 +348,7 @@ end @@ -345,6 +348,7 @@ end
345 function Role:data() 348 function Role:data()
346 return { 349 return {
347 id = self:getProperty("id"), 350 id = self:getProperty("id"),
  351 + uid = self:getProperty("uid"),
348 name = self:getProperty("name"), 352 name = self:getProperty("name"),
349 intro = self:getProperty("intro"), 353 intro = self:getProperty("intro"),
350 headId = self:getProperty("headId"), 354 headId = self:getProperty("headId"),
@@ -358,7 +362,8 @@ function Role:data() @@ -358,7 +362,8 @@ function Role:data()
358 timeReset = self:getProperty("timeReset"), 362 timeReset = self:getProperty("timeReset"),
359 diamond = self:getAllDiamond(), 363 diamond = self:getAllDiamond(),
360 bagLimit = self:getProperty("bagLimit"), 364 bagLimit = self:getProperty("bagLimit"),
361 - silent = self:getProperty("silent"), 365 + --silent = self:getProperty("silent"),
  366 + silent = 0,
362 timeGift = self:getProperty("timeGift"), 367 timeGift = self:getProperty("timeGift"),
363 368
364 advPass = self:getProperty("advPass"), 369 advPass = self:getProperty("advPass"),
src/models/RoleLog.lua
@@ -63,6 +63,7 @@ local ItemReason = { @@ -63,6 +63,7 @@ local ItemReason = {
63 giftTime = 147, -- 创角后的时间礼包 63 giftTime = 147, -- 创角后的时间礼包
64 activityCrisis = 148, -- 物资危机奖励 64 activityCrisis = 148, -- 物资危机奖励
65 glodConvertRune = 149, -- 金币兑换铭文 65 glodConvertRune = 149, -- 金币兑换铭文
  66 + shopBuy = 150, -- 商店购买
66 67
67 advHang = 301, -- 拾荒挂机 68 advHang = 301, -- 拾荒挂机
68 hangBattle = 302, -- 挂机战斗 69 hangBattle = 302, -- 挂机战斗
src/models/RolePlugin.lua
1 local httpc = require("http.httpc") 1 local httpc = require("http.httpc")
2 local md5 = require "md5" 2 local md5 = require "md5"
3 local cjson = require "shared.json" 3 local cjson = require "shared.json"
  4 +local mysqlproxy = require "shared.mysqlproxy"
4 5
5 local serverId = tonumber(skynet.getenv("servId")) 6 local serverId = tonumber(skynet.getenv("servId"))
6 local RolePlugin = {} 7 local RolePlugin = {}
@@ -337,6 +338,8 @@ function RolePlugin.bind(Role) @@ -337,6 +338,8 @@ function RolePlugin.bind(Role)
337 end 338 end
338 log["cint1"] = params.id 339 log["cint1"] = params.id
339 log["cint2"] = math.abs(params.count) 340 log["cint2"] = math.abs(params.count)
  341 + log["cint3"] = nums
  342 + log["long1"] = origin
340 if params.count <= 0 then 343 if params.count <= 0 then
341 self:mylog("out_item", log) 344 self:mylog("out_item", log)
342 else 345 else
@@ -377,6 +380,8 @@ function RolePlugin.bind(Role) @@ -377,6 +380,8 @@ function RolePlugin.bind(Role)
377 end 380 end
378 log["cint1"] = params.itemId 381 log["cint1"] = params.itemId
379 log["cint2"] = math.abs(params.count) 382 log["cint2"] = math.abs(params.count)
  383 + log["cint3"] = nums
  384 + log["long1"] = origin
380 if params.count <= 0 then 385 if params.count <= 0 then
381 self:mylog("out_item", log) 386 self:mylog("out_item", log)
382 else 387 else
@@ -494,6 +499,7 @@ function RolePlugin.bind(Role) @@ -494,6 +499,7 @@ function RolePlugin.bind(Role)
494 end 499 end
495 log["cint1"] = origin 500 log["cint1"] = origin
496 log["cint2"] = count 501 log["cint2"] = count
  502 + log["cint3"] = origin + count
497 self:mylog("in_diamond", log) 503 self:mylog("in_diamond", log)
498 else 504 else
499 print("gainDiamond no log ", debug.traceback()) 505 print("gainDiamond no log ", debug.traceback())
@@ -547,6 +553,7 @@ function RolePlugin.bind(Role) @@ -547,6 +553,7 @@ function RolePlugin.bind(Role)
547 end 553 end
548 log["cint1"] = origin 554 log["cint1"] = origin
549 log["cint2"] = count 555 log["cint2"] = count
  556 + log["cint3"] = origin - count
550 self:mylog("out_diamond", log) 557 self:mylog("out_diamond", log)
551 else 558 else
552 print("costDiamond no log ", debug.traceback()) 559 print("costDiamond no log ", debug.traceback())
@@ -905,7 +912,8 @@ function RolePlugin.bind(Role) @@ -905,7 +912,8 @@ function RolePlugin.bind(Role)
905 end 912 end
906 913
907 log["cint1"] = sparkUid 914 log["cint1"] = sparkUid
908 - log["cint2"] = params.cfg_id 915 + log["cint2"] = params.id
  916 + log["cint3"] = 0
909 917
910 self:mylog("in_spark", log) 918 self:mylog("in_spark", log)
911 else 919 else
@@ -935,6 +943,7 @@ function RolePlugin.bind(Role) @@ -935,6 +943,7 @@ function RolePlugin.bind(Role)
935 943
936 log["cint1"] = sparkId 944 log["cint1"] = sparkId
937 log["cint2"] = spark:getProperty("cfg_id") 945 log["cint2"] = spark:getProperty("cfg_id")
  946 + log["cint3"] = spark:getProperty("level")
938 947
939 self:mylog("out_spark", log) 948 self:mylog("out_spark", log)
940 else 949 else
@@ -1144,6 +1153,38 @@ function RolePlugin.bind(Role) @@ -1144,6 +1153,38 @@ function RolePlugin.bind(Role)
1144 -- return result 1153 -- return result
1145 -- end 1154 -- end
1146 1155
  1156 + function Role:getRewardLogStr(gift)
  1157 + if not gift then return '' end
  1158 + local tgift = {}
  1159 + if type(gift) == "string" then
  1160 + for _, one in pairs(gift:toTableArray(true)) do
  1161 + tgift[one[1]] = (tgift[one[1]] or 0) + one[2]
  1162 + end
  1163 + else
  1164 + tgift = gift
  1165 + end
  1166 + local t = {}
  1167 + for k, v in pairs(tgift) do
  1168 + local name = csvdb['itemCsv'][k].name
  1169 + table.insert(t, string.format("%s*%s", name, v))
  1170 + end
  1171 + return table.concat(t, ',')
  1172 + end
  1173 +
  1174 + function Role:getHerosLogStr(heros)
  1175 + local t = {}
  1176 + for _, id in pairs(heros or {}) do
  1177 + local hero = self.heros[id]
  1178 + if hero then
  1179 + local name = csvdb["unitCsv"][hero:getProperty("type")].name
  1180 + local level = hero:getProperty("level")
  1181 + local wakeL = hero:getProperty("wakeL")
  1182 + table.insert(t, string.format("%s(%s %s)", name,level,wakeL))
  1183 + end
  1184 + end
  1185 + return table.concat(t, ',')
  1186 + end
  1187 +
1147 function Role:getHerosCamp(heros) 1188 function Role:getHerosCamp(heros)
1148 local had = {} 1189 local had = {}
1149 for _, id in pairs(heros or {}) do 1190 for _, id in pairs(heros or {}) do
src/models/RoleTask.lua
@@ -487,6 +487,7 @@ function RoleTask.bind(Role) @@ -487,6 +487,7 @@ function RoleTask.bind(Role)
487 if status[taskId] ~= -1 and data.type == stype and (data.condition2 == 0 or data.condition2 == cond1) then 487 if status[taskId] ~= -1 and data.type == stype and (data.condition2 == 0 or data.condition2 == cond1) then
488 status[taskId] = (status[taskId] or 0) + count 488 status[taskId] = (status[taskId] or 0) + count
489 isChange[key] = 1 489 isChange[key] = 1
  490 + self:mylog("role_action", {desc = "onTask", int1 = taskId, int2 = status[taskId], short1 = key, cint1 = data.condition1})
490 end 491 end
491 end 492 end
492 end 493 end
@@ -612,6 +613,9 @@ function RoleTask.bind(Role) @@ -612,6 +613,9 @@ function RoleTask.bind(Role)
612 end 613 end
613 end 614 end
614 if next(change) then 615 if next(change) then
  616 + for _, info in ipairs(change) do
  617 + self:mylog("role_action", {desc = "onTask", int1 = info.field, int2 = info.value, short1 = 3, cint1 = 0})
  618 + end
615 self:changeUpdates(change, notNotify) 619 self:changeUpdates(change, notNotify)
616 end 620 end
617 end 621 end
src/shared/ModelBaseMysql.lua
@@ -2,6 +2,8 @@ local ModelBaseMysql = class(&quot;ModelBaseMysql&quot;) @@ -2,6 +2,8 @@ local ModelBaseMysql = class(&quot;ModelBaseMysql&quot;)
2 ModelBaseMysql.key = "key" 2 ModelBaseMysql.key = "key"
3 ModelBaseMysql.schema = {} 3 ModelBaseMysql.schema = {}
4 4
  5 +local mysqlproxy = require "shared.mysqlproxy"
  6 +
5 local string_format = string.format 7 local string_format = string.format
6 local table_insert = table.insert 8 local table_insert = table.insert
7 local table_unpack = table.unpack 9 local table_unpack = table.unpack