Commit a1fd18159b41a10b26b695b0a4e4b050f67e9c2e
Merge branch 'cn/develop' of 120.26.43.151:wasteland/server into cn/develop
Showing
15 changed files
with
75 additions
and
24 deletions
Show diff stats
src/actions/ActivityAction.lua
... | ... | @@ -143,7 +143,8 @@ function _M.signRpc(agent, data) |
143 | 143 | if monthData[curDay].daily_sign_email ~= "" then |
144 | 144 | local emails = monthData[curDay].daily_sign_email:toArray(true,"=") |
145 | 145 | for _, emailId in pairs(emails) do |
146 | - redisproxy:insertEmail({roleId = role:getProperty("id"), emailId = emailId}) | |
146 | + --redisproxy:insertEmail({roleId = role:getProperty("id"), emailId = emailId}) | |
147 | + role:sendMail(emailId) | |
147 | 148 | end |
148 | 149 | end |
149 | 150 | |
... | ... | @@ -312,6 +313,7 @@ function _M.actBattleCommandTaskRpc(agent, data) |
312 | 313 | activity_type = role.activity.ActivityType.BattleCommandTask, -- 活动类型,见活动类型枚举表 |
313 | 314 | activity_reward = reward, -- 活动奖励,json格式记录,{'itemid1':123,'itemid2':456,………...} |
314 | 315 | }) |
316 | + role:mylog("act_action", {desc="bcTask", int1=taskId, int2=taskCfg.resetType}) | |
315 | 317 | |
316 | 318 | role:checkTaskEnter("FinishSpeTask", {taskId = taskId, actId = actId}) |
317 | 319 | |
... | ... | @@ -1327,6 +1329,7 @@ function _M.buyBattleCommandLvlRpc(agent, data) |
1327 | 1329 | role:costItems({[ItemId.Jade] = cost}, {log = {desc = "actBuyBpLevel", int1 = curLvl}}) |
1328 | 1330 | actData["lvl"] = nextLvl |
1329 | 1331 | role.activity:updateActData("BattleCommand", actData) |
1332 | + role:mylog("act_action", {desc="buyBcLvl", int1=count, int2=nextLvl}) | |
1330 | 1333 | |
1331 | 1334 | SendPacket(actionCodes.Activity_buyBattleCommandLvlRpc, MsgPack.pack({})) |
1332 | 1335 | return true | ... | ... |
src/actions/AdvAction.lua
... | ... | @@ -183,6 +183,7 @@ function _M.startAdvRpc( agent, data ) |
183 | 183 | cost = relayData.supply |
184 | 184 | end |
185 | 185 | role:checkTaskEnter("AdvCostPower", {count = cost}) |
186 | + role:mylog("adv_action", {desc = "costPower", int1 = cost}) | |
186 | 187 | |
187 | 188 | local support = {} -- 支援效果 |
188 | 189 | if AdvCommon.isEndless(chapterId) then |
... | ... | @@ -293,6 +294,7 @@ function _M.startHangRpc(agent, data) |
293 | 294 | if not role:checkAdvCount(adv_idle_energy) then return 7 end -- 是否有体力 |
294 | 295 | |
295 | 296 | role:checkTaskEnter("AdvCostPower", {count = adv_idle_energy}) |
297 | + role:mylog("adv_action", {desc = "costPower", int1 = adv_idle_energy}) | |
296 | 298 | |
297 | 299 | if not checkFormat(role, format, role:getAdvData():isRunning()) then return 8 end --编队是否正确 |
298 | 300 | ... | ... |
src/actions/DinerAction.lua
... | ... | @@ -182,13 +182,17 @@ function _M.getSellRewardRpc( agent, data ) |
182 | 182 | local sells = json.decode(role.dinerData:getProperty("sells")) |
183 | 183 | |
184 | 184 | local deltaTimes = {} |
185 | - for slot, _ in pairs(sells) do | |
185 | + for slot, sell in pairs(sells) do | |
186 | + local oldCount = sell.count | |
187 | + local sellDish = sell.dish | |
186 | 188 | local temp = role.dinerData:updateSell(slot) or { |
187 | 189 | deltaCount = 0, |
188 | 190 | deltaTime = 0, |
189 | 191 | lastCount = 0, |
190 | 192 | } |
191 | 193 | deltaTimes[slot] = temp.deltaTime |
194 | + local sellCount = oldCount - temp.lastCount | |
195 | + role:mylog("diner_action", {desc = "sell", int1 = sellDish, int2 = sellCount}) | |
192 | 196 | end |
193 | 197 | sells = json.decode(role.dinerData:getProperty("sells")) |
194 | 198 | for slot, sell in pairs(sells) do |
... | ... | @@ -238,7 +242,7 @@ function _M.getSellRewardRpc( agent, data ) |
238 | 242 | role.dinerData:notifyUpdateProperty("order", role.dinerData:getProperty("order")) |
239 | 243 | end |
240 | 244 | |
241 | - role:mylog("diner_action", {desc = "sell"}) | |
245 | + --role:mylog("diner_action", {desc = "sell"}) | |
242 | 246 | |
243 | 247 | SendPacket(actionCodes.Diner_getSellRewardRpc, MsgPack.pack({reward = reward, change = change})) |
244 | 248 | return true |
... | ... | @@ -327,7 +331,7 @@ function _M.expediteSellRpc( agent, data ) |
327 | 331 | end |
328 | 332 | role:checkTaskEnter("FoodSellQuick") |
329 | 333 | |
330 | - role:mylog("diner_action", {desc = "sellQ"}) | |
334 | + role:mylog("diner_action", {desc = "sellQ", int1 = count + 1}) | |
331 | 335 | |
332 | 336 | SendPacket(actionCodes.Diner_expediteSellRpc, MsgPack.pack({reward = reward, change = change, popular = popular})) |
333 | 337 | return true | ... | ... |
src/actions/EmailAction.lua
... | ... | @@ -133,6 +133,7 @@ function _M.drawAttachRpc(agent, data) |
133 | 133 | |
134 | 134 | |
135 | 135 | local email = require("models.Email").new({key = string.format("%d", id), id = id}) |
136 | + email.owner = role | |
136 | 137 | if not email:load() then return end |
137 | 138 | |
138 | 139 | local attachments = getEmailAttachments(email) |
... | ... | @@ -142,7 +143,7 @@ function _M.drawAttachRpc(agent, data) |
142 | 143 | email:setProperty("status", 2, true) |
143 | 144 | email:log(role, 2) |
144 | 145 | SendPacket(actionCodes.Email_drawAttachRpc, MsgPack.pack({reward = reward, change = change})) |
145 | - role:mylog("mail_action", {desc = "draw_attach", int1 = id, key1 = email:getProperty("title"), key2 = attachments}) | |
146 | + role:mylog("mail_action", {desc = "draw_attach", int1 = email:getProperty("emailId"), key1 = email:getProperty("title"), key2 = attachments}) | |
146 | 147 | return true |
147 | 148 | end |
148 | 149 | ... | ... |
src/actions/FriendAction.lua
... | ... | @@ -171,7 +171,7 @@ function _M.applyRpc(agent, data) |
171 | 171 | myInfo.online = true |
172 | 172 | myInfo.hadApply = true |
173 | 173 | |
174 | - role:mylog("role_action", {desc = "addFriend", int1 = 1}) | |
174 | + role:mylog("role_action", {desc = "applyFriend", int1 = 1}) | |
175 | 175 | |
176 | 176 | rpcRole(objectId, "SendPacket", actionCodes.Friend_updateProperty, MsgPack.pack({newApply = 1, info = {myInfo}})) -- 通知对方 |
177 | 177 | end |
... | ... | @@ -420,6 +420,7 @@ function _M.deleteRpc(agent, data) |
420 | 420 | friend_roleid = objectId, -- 好友账户下的角色id |
421 | 421 | friend_cnt = 0, -- 操作后好友数量 |
422 | 422 | }) |
423 | + role:mylog("role_action", {desc = "delFriend", int1 = 1}) | |
423 | 424 | SendPacket(actionCodes.Friend_deleteRpc, MsgPack.pack("")) |
424 | 425 | return true |
425 | 426 | end | ... | ... |
src/actions/HangAction.lua
... | ... | @@ -16,6 +16,17 @@ local table_unpack = table.unpack |
16 | 16 | |
17 | 17 | local _M = {} |
18 | 18 | |
19 | +local function getHangTime(role) | |
20 | + local hangInfo = role:getProperty("hangInfo") | |
21 | + if not hangInfo.carbonId or not hangInfo.coinTime or not hangInfo.itemTime then | |
22 | + return 0 | |
23 | + end | |
24 | + local carbonData = csvdb["idle_battleCsv"][hangInfo.carbonId] | |
25 | + local nowCoinTime = math.min(skynet.timex(), hangInfo.endCoinTime or 0) | |
26 | + | |
27 | + return nowCoinTime - hangInfo.coinTime | |
28 | +end | |
29 | + | |
19 | 30 | local function checkReward(role) |
20 | 31 | local hangInfo = role:getProperty("hangInfo") |
21 | 32 | if not hangInfo.carbonId or not hangInfo.coinTime or not hangInfo.itemTime then |
... | ... | @@ -223,6 +234,7 @@ function _M.startBattleRpc(agent, data) |
223 | 234 | end |
224 | 235 | |
225 | 236 | _BattleKey = tostring(math.random()) |
237 | + role._StartBattleTs = skynet.timex() | |
226 | 238 | |
227 | 239 | role:checkTaskEnter("HangBattle", {id = carbonId}) |
228 | 240 | SendPacket(actionCodes.Hang_startBattleRpc, MsgPack.pack({key = _BattleKey})) |
... | ... | @@ -332,7 +344,9 @@ function _M.endBattleRpc(agent, data) |
332 | 344 | }) |
333 | 345 | |
334 | 346 | local team = role:getProperty("pvpTC") |
335 | - 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)}) | |
347 | + | |
348 | + local battleTime = skynet.timex() - role._StartBattleTs | |
349 | + 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}) | |
336 | 350 | |
337 | 351 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ |
338 | 352 | starNum = msg.starNum, |
... | ... | @@ -403,6 +417,7 @@ end |
403 | 417 | |
404 | 418 | function _M.getRewardRpc(agent , data) |
405 | 419 | local role = agent.role |
420 | + local hangTime = getHangTime(role) | |
406 | 421 | checkReward(role) |
407 | 422 | local items = role:getProperty("hangBag") |
408 | 423 | if not next(items) then return end |
... | ... | @@ -433,6 +448,7 @@ function _M.getRewardRpc(agent , data) |
433 | 448 | residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
434 | 449 | }) |
435 | 450 | |
451 | + role:mylog("hang_action", {desc = "hangReward", int1 = hangTime}) | |
436 | 452 | |
437 | 453 | SendPacket(actionCodes.Hang_getRewardRpc, MsgPack.pack({ |
438 | 454 | reward = reward, |
... | ... | @@ -502,6 +518,8 @@ function _M.quickRpc(agent , data) |
502 | 518 | residence_time = time, --挂机或排名时长 |
503 | 519 | residence_reward = reward, --获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
504 | 520 | }) |
521 | + role:mylog("hang_action", {desc = "quick", short1 = curCount}) | |
522 | + | |
505 | 523 | SendPacket(actionCodes.Hang_quickRpc, MsgPack.pack({ |
506 | 524 | reward = reward, |
507 | 525 | change = change | ... | ... |
src/actions/HeroAction.lua
... | ... | @@ -728,7 +728,7 @@ function _M.getResetRewardRpc(agent, data) |
728 | 728 | equip = "", |
729 | 729 | rune = "", |
730 | 730 | }) |
731 | - hero:mylog({desc = "resetHero"}) | |
731 | + hero:mylog({desc = "resetHero", int1=tmpLevel}) | |
732 | 732 | |
733 | 733 | --local coef = globalCsv.unit_back_discount |
734 | 734 | --coef = (pay or tmpLevel <= 60) and 1 or coef |
... | ... | @@ -991,11 +991,11 @@ function _M.drawHeroRpc(agent, data) |
991 | 991 | local fragId = itemData.id - ItemStartId.Hero |
992 | 992 | local heroData = csvdb["unitCsv"][fragId] |
993 | 993 | local count = globalCsv.draw_unit_tofragment[heroData.rare] |
994 | - role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) | |
994 | + role:award({[fragId] = count}, {log = {desc = "drawHero", int1 = btype, int2 = poolId, short1=isFloorBack and 1 or 0}}) | |
995 | 995 | logReward[fragId] = (logReward[fragId] or 0) + count |
996 | 996 | table.insert(reward, {id = fragId, count = count, from = itemId, fcount = 1}) |
997 | 997 | else |
998 | - role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) | |
998 | + role:award({[itemId] = 1}, {log = {desc = "drawHero", int1 = btype, int2 = poolId, short1=isFloorBack and 1 or 0}}) | |
999 | 999 | logReward[itemId] = (logReward[itemId] or 0) + 1 |
1000 | 1000 | table.insert(reward, {id = itemId, count = 1}) |
1001 | 1001 | end |
... | ... | @@ -1035,6 +1035,8 @@ function _M.drawHeroRpc(agent, data) |
1035 | 1035 | gacha_cost = cost, -- 购买道具消耗的货币 |
1036 | 1036 | gacha_cnt = floorHeroCount, |
1037 | 1037 | }) |
1038 | + | |
1039 | + role:mylog("hero_action", {desc = "drawHero", int1=poolId, int2=btype, short1 = drawCount[drawType]}) | |
1038 | 1040 | SendPacket(actionCodes.Hero_drawHeroRpc, MsgPack.pack({reward = reward})) -- 这个 reward 是数组 |
1039 | 1041 | |
1040 | 1042 | local feedbackId = buildTypeData["can_feedback"] or 0 | ... | ... |
src/actions/RadioAction.lua
... | ... | @@ -199,7 +199,8 @@ function _M.finishQuestRpc(agent, data) |
199 | 199 | mission_result = 1, -- 战斗结果(0-无效,1-胜利,2-失败) |
200 | 200 | mission_roundtime = config.time, -- 完成耗时(秒) |
201 | 201 | mission_cleartype = 2, -- 1-开始; 2-完成(领取奖励时) |
202 | - }) | |
202 | + }) | |
203 | + role:mylog("role_action", {desc = "radioTask", int1 = id, short1 = bigSuccess and 1 or 0}) | |
203 | 204 | |
204 | 205 | return true |
205 | 206 | end | ... | ... |
src/actions/RoleAction.lua
... | ... | @@ -399,7 +399,8 @@ function _M.createRpc(agent, data) |
399 | 399 | |
400 | 400 | newRole:award(globalCsv.birthItem, {log = {desc = "birth"}, notNotify = true}) |
401 | 401 | -- 欢迎邮件 |
402 | - mysqlproxy:insertEmail({roleId = roleId, emailId = 1}) | |
402 | + --mysqlproxy:insertEmail({roleId = roleId, emailId = 1}) | |
403 | + newRole:sendMail(1) | |
403 | 404 | |
404 | 405 | if msg.newuser then |
405 | 406 | newRole:log("onCreateAccount") |
... | ... | @@ -904,8 +905,10 @@ function _M.taskRpc(agent, data) |
904 | 905 | -- 日常活动完成 |
905 | 906 | if taskType == 1 then |
906 | 907 | role:checkTaskEnter("DailyTask", {pre = (taskStatus["a"] or 0), cur = active}) |
908 | + role:mylog("role_action", {desc="dayTask", int1=taskId, int2=active}) | |
907 | 909 | else |
908 | 910 | role:checkTaskEnter("WeekTask", {pre = (taskStatus["a"] or 0), cur = active}) |
911 | + role:mylog("role_action", {desc="weekTask", int1=taskId, int2=active}) | |
909 | 912 | end |
910 | 913 | |
911 | 914 | role:changeUpdates({ |
... | ... | @@ -1000,6 +1003,8 @@ function _M.achiveRpc(agent, data) |
1000 | 1003 | achievement_type = cfg.type, -- 成就类型,具体枚举表中成就类型枚举表 |
1001 | 1004 | achievement_reward = award, -- 达成成就奖励,json格式记录,{"itemid1":123,"itemid2":12,……….} |
1002 | 1005 | }) |
1006 | + | |
1007 | + role:mylog("role_action", {desc="finishAchieve", int1=cfg.id}) | |
1003 | 1008 | end |
1004 | 1009 | end |
1005 | 1010 | end |
... | ... | @@ -1034,6 +1039,7 @@ function _M.achiveRpc(agent, data) |
1034 | 1039 | achievement_type = achiveTask.type, -- 成就类型,具体枚举表中成就类型枚举表 |
1035 | 1040 | achievement_reward = reward, -- 达成成就奖励,json格式记录,{"itemid1":123,"itemid2":12,……….} |
1036 | 1041 | }) |
1042 | + role:mylog("role_action", {desc="finishAchieve", int1=taskId}) | |
1037 | 1043 | |
1038 | 1044 | SendPacket(actionCodes.Role_achiveRpc, MsgPack.pack(role:packReward(reward, change))) |
1039 | 1045 | end |
... | ... | @@ -1057,6 +1063,7 @@ function _M.achiveRpc(agent, data) |
1057 | 1063 | if preMaxCount < pData.request and overCount >= pData.request then |
1058 | 1064 | role:sendMail(101, skynet.timex(), pData.reward, {pData.level}) |
1059 | 1065 | flag = true |
1066 | + role:mylog("role_action", {desc="fux", int1=pdata.level}) | |
1060 | 1067 | end |
1061 | 1068 | end |
1062 | 1069 | if flag then | ... | ... |
src/actions/SeaportAction.lua
... | ... | @@ -237,6 +237,8 @@ function _M.taskRpc(agent, data) |
237 | 237 | reward, change = role:award(itemReward, {log = {desc = "seaportTask", int1 = taskId, int2 = level}}) |
238 | 238 | |
239 | 239 | seaport.collect[taskId] = nil |
240 | + | |
241 | + role:mylog("role_action", {desc="seaportTask", int1=taskId, int2=level, short1=bigSuccess and 1 or 0}) | |
240 | 242 | else |
241 | 243 | return 0 |
242 | 244 | end | ... | ... |
src/adv/Adv.lua
... | ... | @@ -922,7 +922,7 @@ function Adv:over(success, rewardRatio, overType) |
922 | 922 | end |
923 | 923 | self:clearAdvUnlockCache() |
924 | 924 | |
925 | - self:mylog({desc = "over", short1 = success and 1 or 0, int1 = overType}) | |
925 | + self:mylog({desc = "over", short1 = success and 1 or 0, int1 = overType, int2 = self.chapterId, long1 = self.level}) | |
926 | 926 | |
927 | 927 | |
928 | 928 | local team = self.owner:getProperty("advTeam") | ... | ... |
src/models/HeroPlugin.lua
src/models/RoleBattle.lua
src/models/RolePlugin.lua
... | ... | @@ -252,7 +252,8 @@ function RolePlugin.bind(Role) |
252 | 252 | local headData = csvdb["player_iconCsv"][itemId] |
253 | 253 | -- pvp 跨服竞技场奖励 |
254 | 254 | if headData and headData.path == 2 then |
255 | - mysqlproxy:insertEmail({roleId = self:getProperty("id"), emailId = 19}) | |
255 | + --mysqlproxy:insertEmail({roleId = self:getProperty("id"), emailId = 19}) | |
256 | + self:sendMail(19) | |
256 | 257 | end |
257 | 258 | end |
258 | 259 | end |
... | ... | @@ -1381,11 +1382,12 @@ function RolePlugin.bind(Role) |
1381 | 1382 | end |
1382 | 1383 | if done then |
1383 | 1384 | update = true |
1384 | - redisproxy:insertEmail({ | |
1385 | - roleId = self:getProperty("id"), | |
1386 | - emailId = idx == 1 and 361 or 362, | |
1387 | - attachments = set[1].phase_award, | |
1388 | - }) | |
1385 | + --redisproxy:insertEmail({ | |
1386 | + -- roleId = self:getProperty("id"), | |
1387 | + -- emailId = idx == 1 and 361 or 362, | |
1388 | + -- attachments = set[1].phase_award, | |
1389 | + --}) | |
1390 | + self:sendMail(idx == 1 and 361 or 362, nil, set[1].phase_award) | |
1389 | 1391 | -- self:award(set[1].phase_award, {log = {desc = "seaportReward", int1 = set[1].phase, int2 = set[1].id}}) |
1390 | 1392 | donate[idx] = 1 |
1391 | 1393 | end |
... | ... | @@ -1478,11 +1480,12 @@ function RolePlugin.bind(Role) |
1478 | 1480 | end |
1479 | 1481 | rewardStr = rewardStr .. string.format("%s=%s",itemId,value) |
1480 | 1482 | end |
1481 | - redisproxy:insertEmail({ | |
1482 | - roleId = self:getProperty("id"), | |
1483 | - emailId = 363, | |
1484 | - attachments = rewardStr, | |
1485 | - }) | |
1483 | + --redisproxy:insertEmail({ | |
1484 | + -- roleId = self:getProperty("id"), | |
1485 | + -- emailId = 363, | |
1486 | + -- attachments = rewardStr, | |
1487 | + --}) | |
1488 | + self:sendMail(363, nil, rewardStr) | |
1486 | 1489 | end |
1487 | 1490 | end |
1488 | 1491 | seaport.collect = {} |
... | ... | @@ -1704,6 +1707,7 @@ function RolePlugin.bind(Role) |
1704 | 1707 | |
1705 | 1708 | if level > advL[1] then |
1706 | 1709 | self:checkTaskEnter("AdvLevel", {level = level}) |
1710 | + self:mylog("adv_action", {desc = "adv_level", int1 = level}) | |
1707 | 1711 | end |
1708 | 1712 | advL[1] = level |
1709 | 1713 | advL[2] = newExp |
... | ... | @@ -2350,6 +2354,8 @@ function RolePlugin.bind(Role) |
2350 | 2354 | gift = gift .. k.."="..v.." " |
2351 | 2355 | end |
2352 | 2356 | mysqlproxy:insertEmail({roleId = self:getProperty("id"), emailId = mailId, createtime = createTime, attachments = gift, contentPms = contentPms}) |
2357 | + | |
2358 | + self:mylog("role_action", {desc="sendMail", int1 = mailId}) | |
2353 | 2359 | self.sendMailFlag = true |
2354 | 2360 | end |
2355 | 2361 | ... | ... |
src/models/Store.lua
... | ... | @@ -301,7 +301,9 @@ function Store:onBuyCard(type, duration, id, actid) |
301 | 301 | actData["unlock"] = 1 |
302 | 302 | if actCfg.condition ~= 0 then |
303 | 303 | actData["lvl"] = (actData["lvl"] or 0) + actCfg.condition |
304 | + role:mylog("act_action", {desc="buyBcLvl", int1=actCfg.condition, int2=actData["lvl"]}) | |
304 | 305 | end |
306 | + self.owner:mylog("act_action", {desc="buyBc", int1=id, int2=actData["lvl"] or 0}) | |
305 | 307 | self.owner.activity:updateActData("BattleCommand", actData) |
306 | 308 | end |
307 | 309 | end | ... | ... |