Commit e84a1bebb1b40e1bef2b531f1bac77224af355bc
1 parent
be5f29fa
gm后台查询日志,公告相关协议
Showing
20 changed files
with
128 additions
and
25 deletions
Show diff stats
src/ProtocolCode.lua
src/actions/ActivityAction.lua
| ... | ... | @@ -1434,7 +1434,7 @@ function _M.returnerTaskRpc(agent, data) |
| 1434 | 1434 | local TaskCsv = csvdb["activity_taskCsv"][76] or {} |
| 1435 | 1435 | local taskData = TaskCsv[taskId] |
| 1436 | 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 | 1439 | local status = returner.status or {} |
| 1440 | 1440 | if status[taskId] then return 3 end | ... | ... |
src/actions/DinerAction.lua
| ... | ... | @@ -112,6 +112,8 @@ function _M.addSellRpc( agent, data ) |
| 112 | 112 | |
| 113 | 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 | 117 | role.dinerData:updateProperty({field = "sells", value = json.encode(sells)}) |
| 116 | 118 | SendPacket(actionCodes.Diner_addSellRpc, "") |
| 117 | 119 | return true |
| ... | ... | @@ -192,7 +194,10 @@ function _M.getSellRewardRpc( agent, data ) |
| 192 | 194 | } |
| 193 | 195 | deltaTimes[slot] = temp.deltaTime |
| 194 | 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 | 201 | end |
| 197 | 202 | sells = json.decode(role.dinerData:getProperty("sells")) |
| 198 | 203 | for slot, sell in pairs(sells) do |
| ... | ... | @@ -310,6 +315,9 @@ function _M.expediteSellRpc( agent, data ) |
| 310 | 315 | restaurant_sale_coin = rewards[ItemId.DinerCoin] or 0, -- 售卖获得美食币 |
| 311 | 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 | 321 | end |
| 314 | 322 | end |
| 315 | 323 | ... | ... |
src/actions/EmailAction.lua
| ... | ... | @@ -129,7 +129,7 @@ function _M.drawAllAttachRpc(agent, data) |
| 129 | 129 | for key, v in pairs(attachments:toNumMap()) do |
| 130 | 130 | reward[key] = (reward[key] or 0) + v |
| 131 | 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 | 133 | end |
| 134 | 134 | end |
| 135 | 135 | if role:checkRuneFullyByReward(reward) then return 1 end |
| ... | ... | @@ -168,7 +168,7 @@ function _M.drawAttachRpc(agent, data) |
| 168 | 168 | email:setProperty("status", 2, true) |
| 169 | 169 | email:log(role, 2) |
| 170 | 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 | 172 | return true |
| 173 | 173 | end |
| 174 | 174 | |
| ... | ... | @@ -184,7 +184,7 @@ function _M.checkRpc(agent, data) |
| 184 | 184 | |
| 185 | 185 | email:setProperty("status", 1, true) |
| 186 | 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 | 189 | SendPacket(actionCodes.Email_checkRpc, '') |
| 190 | 190 | return true | ... | ... |
src/actions/GmAction.lua
| ... | ... | @@ -38,6 +38,7 @@ function _M.ban(role, pms) |
| 38 | 38 | |
| 39 | 39 | role:setBan(time, ctype) |
| 40 | 40 | role:mylog("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender}) |
| 41 | + | |
| 41 | 42 | return "封杀成功" |
| 42 | 43 | end |
| 43 | 44 | |
| ... | ... | @@ -64,14 +65,16 @@ function _M.reset_rank(role, pms) |
| 64 | 65 | end |
| 65 | 66 | |
| 66 | 67 | function _M.silent(role, pms) |
| 67 | - local pm1 = tonum(pms.pm1) | |
| 68 | + local pm1 = tonum(pms.pm1, 0) | |
| 69 | + dump(pms, pm1) | |
| 68 | 70 | if pm1 < 1 then |
| 69 | 71 | role:updateProperty({field = "silent", value = 0}) |
| 72 | + role:setProperty("silentType", 0) | |
| 70 | 73 | return "解禁言成功" |
| 71 | 74 | end |
| 72 | 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 | 78 | return "禁言成功" |
| 76 | 79 | end |
| 77 | 80 | ... | ... |
src/actions/HangAction.lua
| ... | ... | @@ -353,10 +353,12 @@ function _M.endBattleRpc(agent, data) |
| 353 | 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 | 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 | 363 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ |
| 362 | 364 | starNum = msg.starNum, | ... | ... |
src/actions/HeroAction.lua
| ... | ... | @@ -1040,6 +1040,7 @@ function _M.drawHeroRpc(agent, data) |
| 1040 | 1040 | end |
| 1041 | 1041 | end |
| 1042 | 1042 | |
| 1043 | + local itemCount = 1 | |
| 1043 | 1044 | if role:isHaveHero(itemData.id - ItemStartId.Hero) then |
| 1044 | 1045 | local fragId = itemData.id - ItemStartId.Hero |
| 1045 | 1046 | local heroData = csvdb["unitCsv"][fragId] |
| ... | ... | @@ -1047,6 +1048,7 @@ function _M.drawHeroRpc(agent, data) |
| 1047 | 1048 | role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId, short1=isFloorBack and 1 or 0}}) |
| 1048 | 1049 | logReward[fragId] = (logReward[fragId] or 0) + count |
| 1049 | 1050 | table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) |
| 1051 | + itemCount = count | |
| 1050 | 1052 | else |
| 1051 | 1053 | role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId, short1=isFloorBack and 1 or 0}}) |
| 1052 | 1054 | logReward[itemId] = (logReward[itemId] or 0) + 1 |
| ... | ... | @@ -1064,6 +1066,10 @@ function _M.drawHeroRpc(agent, data) |
| 1064 | 1066 | |
| 1065 | 1067 | dailyDrawCnt = dailyDrawCnt + 1 |
| 1066 | 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 | 1073 | end |
| 1068 | 1074 | |
| 1069 | 1075 | role:award(drawAddReward, {log = {desc = "drawHero", int1 = btype}}) |
| ... | ... | @@ -1099,7 +1105,7 @@ function _M.drawHeroRpc(agent, data) |
| 1099 | 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 | 1109 | SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward, subReward = drawAddReward})) -- 这个 reward 是数组 |
| 1104 | 1110 | |
| 1105 | 1111 | local feedbackId = buildTypeData["can_feedback"] or 0 | ... | ... |
src/actions/HttpAction.lua
| ... | ... | @@ -143,6 +143,7 @@ function _M.gm_action(query) |
| 143 | 143 | role:startActionUcode() |
| 144 | 144 | local status = gmFuncs[query.cmd](role, query) |
| 145 | 145 | role:endActionUcode() |
| 146 | + role:update() | |
| 146 | 147 | |
| 147 | 148 | return status |
| 148 | 149 | end |
| ... | ... | @@ -208,7 +209,14 @@ function _M.broadcast(query) |
| 208 | 209 | msg["body"] = query.content |
| 209 | 210 | msg["logout"] = query.logout |
| 210 | 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 | 221 | if not handle[query.cmd] then return "错误" end |
| 214 | 222 | handle[query.cmd].exec() | ... | ... |
src/actions/PvpAction.lua
| ... | ... | @@ -472,7 +472,8 @@ function _M.endBattleRpc(agent, data) |
| 472 | 472 | reward = reward, |
| 473 | 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 | 478 | _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 |
| 478 | 479 | _pvpRecordInfoCacheC = {} -- 记录刷新了 |
| ... | ... | @@ -578,7 +579,6 @@ function _M.startBattleHRpc(agent, data) |
| 578 | 579 | |
| 579 | 580 | if not revenge then |
| 580 | 581 | -- 次数扣一波 |
| 581 | - print("xxxxx") | |
| 582 | 582 | local pvpFreeH = role.dailyData:getProperty("pvpFreeH") |
| 583 | 583 | if pvpFreeH >= globalCsv.pvp_battle_free_count_high then |
| 584 | 584 | local cost = {[ItemId.PvpKey] = globalCsv.pvp_battle_high_cost} |
| ... | ... | @@ -676,11 +676,13 @@ function _M.endBattleHRpc(agent, data) |
| 676 | 676 | video = video, |
| 677 | 677 | }) |
| 678 | 678 | |
| 679 | + local curStatus | |
| 679 | 680 | -- 检查是否结束战斗 |
| 680 | 681 | local winCount, loseCount = 0, 0 |
| 681 | 682 | for _, status in pairs(_pvpStartBattleCacheH.result) do |
| 682 | 683 | if status.isWin then |
| 683 | 684 | winCount = winCount + 1 |
| 685 | + curStatus = true | |
| 684 | 686 | else |
| 685 | 687 | loseCount = loseCount + 1 |
| 686 | 688 | end |
| ... | ... | @@ -696,6 +698,8 @@ function _M.endBattleHRpc(agent, data) |
| 696 | 698 | return true |
| 697 | 699 | end |
| 698 | 700 | |
| 701 | + local curHTeam = _pvpStartBattleCacheH.pvpTH[#_pvpStartBattleCacheH.result] or {} | |
| 702 | + | |
| 699 | 703 | if winCount >= 2 then |
| 700 | 704 | isWin = true |
| 701 | 705 | elseif loseCount >= 2 then |
| ... | ... | @@ -720,6 +724,8 @@ function _M.endBattleHRpc(agent, data) |
| 720 | 724 | video = video, -- 返回让客户端上传录像 |
| 721 | 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 | 729 | return true |
| 724 | 730 | end |
| 725 | 731 | if revenge and isWin then |
| ... | ... | @@ -814,6 +820,8 @@ function _M.endBattleHRpc(agent, data) |
| 814 | 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 | 826 | _pvpBattleInfoCacheH = {} --重新发阵容了 没毛病 |
| 819 | 827 | _pvpRecordInfoCacheH = {} -- 记录刷新了 |
| ... | ... | @@ -825,7 +833,7 @@ function _M.endBattleHRpc(agent, data) |
| 825 | 833 | if isWin then |
| 826 | 834 | role:checkTaskEnter("PvpWin", {score = myScore}) |
| 827 | 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 | 838 | SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ |
| 831 | 839 | reward = reward, | ... | ... |
src/actions/RoleAction.lua
| ... | ... | @@ -1216,7 +1216,7 @@ function _M.chatRpc(agent, data) |
| 1216 | 1216 | [1] = function () |
| 1217 | 1217 | if role:getProperty("silent") > now then --禁言 |
| 1218 | 1218 | result = 1 |
| 1219 | - return | |
| 1219 | + --return | |
| 1220 | 1220 | end |
| 1221 | 1221 | if role:getProperty("level") < (globalCsv.chat_level or 15) then |
| 1222 | 1222 | result = 3 |
| ... | ... | @@ -1245,7 +1245,12 @@ function _M.chatRpc(agent, data) |
| 1245 | 1245 | return |
| 1246 | 1246 | end |
| 1247 | 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 | 1254 | -- pcall(skynet.send, '.globald', "lua", "sendWorldMsg", role._channelIdx, response) |
| 1250 | 1255 | role:mylog("role_action", {desc = "chatWorld", text1 = content}) |
| 1251 | 1256 | end, |
| ... | ... | @@ -1361,7 +1366,7 @@ function _M.drawCodeRpc(agent, data) |
| 1361 | 1366 | gift_name = "", -- 礼包名称 |
| 1362 | 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 | 1370 | SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ |
| 1366 | 1371 | result = ret, |
| 1367 | 1372 | reward = reward, | ... | ... |
src/actions/StoreAction.lua
| ... | ... | @@ -307,9 +307,11 @@ function _M.shopBuyRpc(agent , data) |
| 307 | 307 | |
| 308 | 308 | if not role:checkItemEnough(cost) then return 4 end |
| 309 | 309 | |
| 310 | + local limitStr = "" | |
| 310 | 311 | if dataSet.limit ~= 0 then |
| 311 | 312 | buyRecord[id] = (buyRecord[id] or 0) + count |
| 312 | 313 | role.storeData:updateProperty({field = "buyR", value = buyRecord}) |
| 314 | + limitStr = string.format("%s/%s", buyRecord[id], dataSet.limit) | |
| 313 | 315 | end |
| 314 | 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 | 335 | shop_purchase_current = costCount or 0, -- 购买道具消耗的货币数量 |
| 334 | 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 | 339 | SendPacket(actionCodes.Store_shopBuyRpc, MsgPack.pack({reward = reward})) |
| 338 | 340 | return true |
| 339 | 341 | end | ... | ... |
src/actions/TowerAction.lua
| ... | ... | @@ -150,7 +150,11 @@ function _M.endBattleRpc(agent, data) |
| 150 | 150 | rank = rank, |
| 151 | 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 | 159 | SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward, change = change})) |
| 156 | 160 | return true | ... | ... |
src/adv/Adv.lua
| ... | ... | @@ -924,10 +924,11 @@ function Adv:over(success, rewardRatio, overType) |
| 924 | 924 | end |
| 925 | 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 | 932 | local player = {} |
| 932 | 933 | local attrs = self.owner:getTeamBattleInfo(team).heros |
| 933 | 934 | for _, hero in pairs(attrs) do | ... | ... |
src/models/Email.lua
| ... | ... | @@ -33,6 +33,8 @@ function Email:log(role, action) |
| 33 | 33 | mail_friend_id = 0, -- 收件方账号id |
| 34 | 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 | 38 | end |
| 37 | 39 | |
| 38 | 40 | function Email:data() | ... | ... |
src/models/Role.lua
| ... | ... | @@ -8,6 +8,7 @@ local RoleChangeStruct = import(".RoleChangeStruct") --角色数据额结构更 |
| 8 | 8 | local RolePvp = import(".RolePvp") -- pvp |
| 9 | 9 | local RoleCross = import(".RoleCross") -- 跨服务请求相关 |
| 10 | 10 | local RoleBattle = import(".RoleBattle") -- 跨服务请求相关 |
| 11 | +local mysqlproxy = require "shared.mysqlproxy" | |
| 11 | 12 | |
| 12 | 13 | RoleLog.bind(Role) |
| 13 | 14 | RolePlugin.bind(Role) |
| ... | ... | @@ -56,6 +57,7 @@ Role.schema = { |
| 56 | 57 | lday = {"number", 0}, |
| 57 | 58 | banTime = {"number", 0}, |
| 58 | 59 | banType = {"number", 0}, |
| 60 | + banReason = {"string", "", "", 512}, | |
| 59 | 61 | heartWarning = {"number", 0}, |
| 60 | 62 | cheatCount = {"number", 0}, |
| 61 | 63 | ltime = {"number", 0}, -- 最后登录时间 |
| ... | ... | @@ -79,6 +81,7 @@ Role.schema = { |
| 79 | 81 | -- loveStatus = {"string", ""}, --统计角色的最高 好感度等级 类型相关 -- type=loveL type=loveL |
| 80 | 82 | crown = {"number", 0}, -- 看伴娘 |
| 81 | 83 | silent = {"number", 0}, --禁言解禁时间 |
| 84 | + silentType = {"number", 0}, -- 禁言类型 | |
| 82 | 85 | timeGift = {"number", 0}, -- 创建角色时间礼包 |
| 83 | 86 | |
| 84 | 87 | bagLimit = {"table", globalCsv.store_limit_max}, |
| ... | ... | @@ -345,6 +348,7 @@ end |
| 345 | 348 | function Role:data() |
| 346 | 349 | return { |
| 347 | 350 | id = self:getProperty("id"), |
| 351 | + uid = self:getProperty("uid"), | |
| 348 | 352 | name = self:getProperty("name"), |
| 349 | 353 | intro = self:getProperty("intro"), |
| 350 | 354 | headId = self:getProperty("headId"), |
| ... | ... | @@ -358,7 +362,8 @@ function Role:data() |
| 358 | 362 | timeReset = self:getProperty("timeReset"), |
| 359 | 363 | diamond = self:getAllDiamond(), |
| 360 | 364 | bagLimit = self:getProperty("bagLimit"), |
| 361 | - silent = self:getProperty("silent"), | |
| 365 | + --silent = self:getProperty("silent"), | |
| 366 | + silent = 0, | |
| 362 | 367 | timeGift = self:getProperty("timeGift"), |
| 363 | 368 | |
| 364 | 369 | advPass = self:getProperty("advPass"), | ... | ... |
src/models/RoleLog.lua
src/models/RolePlugin.lua
| 1 | 1 | local httpc = require("http.httpc") |
| 2 | 2 | local md5 = require "md5" |
| 3 | 3 | local cjson = require "shared.json" |
| 4 | +local mysqlproxy = require "shared.mysqlproxy" | |
| 4 | 5 | |
| 5 | 6 | local serverId = tonumber(skynet.getenv("servId")) |
| 6 | 7 | local RolePlugin = {} |
| ... | ... | @@ -337,6 +338,8 @@ function RolePlugin.bind(Role) |
| 337 | 338 | end |
| 338 | 339 | log["cint1"] = params.id |
| 339 | 340 | log["cint2"] = math.abs(params.count) |
| 341 | + log["cint3"] = nums | |
| 342 | + log["long1"] = origin | |
| 340 | 343 | if params.count <= 0 then |
| 341 | 344 | self:mylog("out_item", log) |
| 342 | 345 | else |
| ... | ... | @@ -377,6 +380,8 @@ function RolePlugin.bind(Role) |
| 377 | 380 | end |
| 378 | 381 | log["cint1"] = params.itemId |
| 379 | 382 | log["cint2"] = math.abs(params.count) |
| 383 | + log["cint3"] = nums | |
| 384 | + log["long1"] = origin | |
| 380 | 385 | if params.count <= 0 then |
| 381 | 386 | self:mylog("out_item", log) |
| 382 | 387 | else |
| ... | ... | @@ -494,6 +499,7 @@ function RolePlugin.bind(Role) |
| 494 | 499 | end |
| 495 | 500 | log["cint1"] = origin |
| 496 | 501 | log["cint2"] = count |
| 502 | + log["cint3"] = origin + count | |
| 497 | 503 | self:mylog("in_diamond", log) |
| 498 | 504 | else |
| 499 | 505 | print("gainDiamond no log ", debug.traceback()) |
| ... | ... | @@ -547,6 +553,7 @@ function RolePlugin.bind(Role) |
| 547 | 553 | end |
| 548 | 554 | log["cint1"] = origin |
| 549 | 555 | log["cint2"] = count |
| 556 | + log["cint3"] = origin - count | |
| 550 | 557 | self:mylog("out_diamond", log) |
| 551 | 558 | else |
| 552 | 559 | print("costDiamond no log ", debug.traceback()) |
| ... | ... | @@ -905,7 +912,8 @@ function RolePlugin.bind(Role) |
| 905 | 912 | end |
| 906 | 913 | |
| 907 | 914 | log["cint1"] = sparkUid |
| 908 | - log["cint2"] = params.cfg_id | |
| 915 | + log["cint2"] = params.id | |
| 916 | + log["cint3"] = 0 | |
| 909 | 917 | |
| 910 | 918 | self:mylog("in_spark", log) |
| 911 | 919 | else |
| ... | ... | @@ -935,6 +943,7 @@ function RolePlugin.bind(Role) |
| 935 | 943 | |
| 936 | 944 | log["cint1"] = sparkId |
| 937 | 945 | log["cint2"] = spark:getProperty("cfg_id") |
| 946 | + log["cint3"] = spark:getProperty("level") | |
| 938 | 947 | |
| 939 | 948 | self:mylog("out_spark", log) |
| 940 | 949 | else |
| ... | ... | @@ -1144,6 +1153,38 @@ function RolePlugin.bind(Role) |
| 1144 | 1153 | -- return result |
| 1145 | 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 | 1188 | function Role:getHerosCamp(heros) |
| 1148 | 1189 | local had = {} |
| 1149 | 1190 | for _, id in pairs(heros or {}) do | ... | ... |
src/models/RoleTask.lua
| ... | ... | @@ -487,6 +487,7 @@ function RoleTask.bind(Role) |
| 487 | 487 | if status[taskId] ~= -1 and data.type == stype and (data.condition2 == 0 or data.condition2 == cond1) then |
| 488 | 488 | status[taskId] = (status[taskId] or 0) + count |
| 489 | 489 | isChange[key] = 1 |
| 490 | + self:mylog("role_action", {desc = "onTask", int1 = taskId, int2 = status[taskId], short1 = key, cint1 = data.condition1}) | |
| 490 | 491 | end |
| 491 | 492 | end |
| 492 | 493 | end |
| ... | ... | @@ -612,6 +613,9 @@ function RoleTask.bind(Role) |
| 612 | 613 | end |
| 613 | 614 | end |
| 614 | 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 | 619 | self:changeUpdates(change, notNotify) |
| 616 | 620 | end |
| 617 | 621 | end | ... | ... |
src/shared/ModelBaseMysql.lua
| ... | ... | @@ -2,6 +2,8 @@ local ModelBaseMysql = class("ModelBaseMysql") |
| 2 | 2 | ModelBaseMysql.key = "key" |
| 3 | 3 | ModelBaseMysql.schema = {} |
| 4 | 4 | |
| 5 | +local mysqlproxy = require "shared.mysqlproxy" | |
| 6 | + | |
| 5 | 7 | local string_format = string.format |
| 6 | 8 | local table_insert = table.insert |
| 7 | 9 | local table_unpack = table.unpack | ... | ... |