Commit 2d21f5273ee03ee6d83ee79206a0ca9fde0a11db
Merge branch 'develop' of 120.26.43.151:wasteland/server into develop
Showing
11 changed files
with
302 additions
and
39 deletions
Show diff stats
config/develop.lua
@@ -15,3 +15,5 @@ redis_host = "127.0.0.1" | @@ -15,3 +15,5 @@ redis_host = "127.0.0.1" | ||
15 | redis_port = 6100 | 15 | redis_port = 6100 |
16 | redis_db = 1 | 16 | redis_db = 1 |
17 | redis_auth = nil | 17 | redis_auth = nil |
18 | + | ||
19 | +pay_url = "" | ||
18 | \ No newline at end of file | 20 | \ No newline at end of file |
src/ProtocolCode.lua
@@ -90,6 +90,7 @@ actionCodes = { | @@ -90,6 +90,7 @@ actionCodes = { | ||
90 | Hero_drawHeroRpc = 220, | 90 | Hero_drawHeroRpc = 220, |
91 | Hero_repayHeroRpc = 221, | 91 | Hero_repayHeroRpc = 221, |
92 | Hero_unlockPoolRpc = 222, | 92 | Hero_unlockPoolRpc = 222, |
93 | + Hero_changeCrown = 223, | ||
93 | 94 | ||
94 | Hang_startRpc = 251, | 95 | Hang_startRpc = 251, |
95 | Hang_checkRpc = 252, | 96 | Hang_checkRpc = 252, |
src/actions/HangAction.lua
@@ -156,6 +156,17 @@ function _M.startRpc( agent, data ) | @@ -156,6 +156,17 @@ function _M.startRpc( agent, data ) | ||
156 | end | 156 | end |
157 | role:updateProperty({field = "hangInfo", value = hangInfo}) | 157 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
158 | 158 | ||
159 | + -- 指定当前引导的步骤 | ||
160 | + if carbonId == 10101 then | ||
161 | + role:saveGuide(5,11) | ||
162 | + elseif carbonId == 10102 then | ||
163 | + role:saveGuide(8,2) | ||
164 | + elseif carbonId == 10103 then | ||
165 | + role:saveGuide(9,2) | ||
166 | + elseif carbonId == 10220 then | ||
167 | + role:saveGuide(22,1) | ||
168 | + end | ||
169 | + | ||
159 | SendPacket(actionCodes.Hang_startRpc, '') | 170 | SendPacket(actionCodes.Hang_startRpc, '') |
160 | return true | 171 | return true |
161 | end | 172 | end |
@@ -209,6 +220,7 @@ function _M.endBattleRpc(agent, data) | @@ -209,6 +220,7 @@ function _M.endBattleRpc(agent, data) | ||
209 | return true | 220 | return true |
210 | end | 221 | end |
211 | local carbonId = msg.carbonId | 222 | local carbonId = msg.carbonId |
223 | + local isWin = msg.starNum and msg.starNum > 0 | ||
212 | local carbonData = csvdb["idle_battleCsv"][carbonId] | 224 | local carbonData = csvdb["idle_battleCsv"][carbonId] |
213 | if not carbonData then | 225 | if not carbonData then |
214 | return 2 | 226 | return 2 |
@@ -222,8 +234,9 @@ function _M.endBattleRpc(agent, data) | @@ -222,8 +234,9 @@ function _M.endBattleRpc(agent, data) | ||
222 | if role:checkHangPass(carbonId) then | 234 | if role:checkHangPass(carbonId) then |
223 | return 4 | 235 | return 4 |
224 | end | 236 | end |
237 | + | ||
225 | local reward, change | 238 | local reward, change |
226 | - if msg.starNum and msg.starNum > 0 then --win | 239 | + if isWin then --win |
227 | role:hangFinish(carbonId) | 240 | role:hangFinish(carbonId) |
228 | if carbonData.main ~= 1 then | 241 | if carbonData.main ~= 1 then |
229 | hangInfo.bossTime = nil | 242 | hangInfo.bossTime = nil |
@@ -239,30 +252,35 @@ function _M.endBattleRpc(agent, data) | @@ -239,30 +252,35 @@ function _M.endBattleRpc(agent, data) | ||
239 | reward, change = role:award(reward, {log = {desc = "hangBattle", int1 = carbonId}}) | 252 | reward, change = role:award(reward, {log = {desc = "hangBattle", int1 = carbonId}}) |
240 | 253 | ||
241 | role:checkTaskEnter("HangPass", {id = carbonId}) | 254 | role:checkTaskEnter("HangPass", {id = carbonId}) |
255 | + | ||
256 | + -- 引导 | ||
257 | + if carbonId == 10101 then | ||
258 | + role:finishGuide(5) | ||
259 | + elseif carbonId == 10102 then | ||
260 | + role:finishGuide(8) | ||
261 | + elseif carbonId == 10103 then | ||
262 | + role:finishGuide(9) | ||
263 | + elseif carbonId == 10220 then | ||
264 | + role:finishGuide(22) | ||
265 | + end | ||
266 | + for _, guideData in pairs(csvdb["guide_unlockCsv"]) do | ||
267 | + if guideData.type == 3 and guideData.carbonId == carbonId then | ||
268 | + role:saveGuide(guideData.guideId,1,true) | ||
269 | + break | ||
270 | + end | ||
271 | + end | ||
242 | end | 272 | end |
243 | if hangInfo.carbonId < carbonId then | 273 | if hangInfo.carbonId < carbonId then |
244 | hangInfo.carbonId = carbonId | 274 | hangInfo.carbonId = carbonId |
245 | end | 275 | end |
246 | role:updateProperty({field = "hangInfo", value = hangInfo}) | 276 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
247 | 277 | ||
248 | - local team = role:getProperty("pvpTC") | ||
249 | - | ||
250 | - -- 引导 | ||
251 | - if carbonId == 10101 then | ||
252 | - role:finishGuide(5) | ||
253 | - elseif carbonId == 10102 then | ||
254 | - role:finishGuide(8) | ||
255 | - elseif carbonId == 10103 then | ||
256 | - role:finishGuide(9) | ||
257 | - elseif carbonId == 10220 then | ||
258 | - role:finishGuide(22) | ||
259 | - end | ||
260 | - for _, guideData in pairs(csvdb["guide_unlockCsv"]) do | ||
261 | - if guideData.type == 3 and guideData.carbonId == carbonId then | ||
262 | - role:saveGuide(guideData.guideId,1,true) | ||
263 | - break | ||
264 | - end | ||
265 | - end | 278 | + role:checkBattle("hang", { |
279 | + id = carbonId, | ||
280 | + isWin = isWin, | ||
281 | + info = msg.info, | ||
282 | + reward = reward, | ||
283 | + }) | ||
266 | 284 | ||
267 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ | 285 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ |
268 | starNum = msg.starNum, | 286 | starNum = msg.starNum, |
@@ -532,6 +550,12 @@ function _M.endBonusBattleRpc(agent, data) | @@ -532,6 +550,12 @@ function _M.endBonusBattleRpc(agent, data) | ||
532 | role:checkTaskEnter("BonusPass", {id = id}) | 550 | role:checkTaskEnter("BonusPass", {id = id}) |
533 | end | 551 | end |
534 | 552 | ||
553 | + role:checkBattle("bonus", { | ||
554 | + id = id, | ||
555 | + isWin = starNum and starNum > 0, | ||
556 | + info = msg.info, | ||
557 | + reward = reward, | ||
558 | + }) | ||
535 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ | 559 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ |
536 | starNum = starNum, | 560 | starNum = starNum, |
537 | reward = reward, | 561 | reward = reward, |
src/actions/HeroAction.lua
@@ -453,7 +453,7 @@ function _M.referEquipsRpc(agent, data) | @@ -453,7 +453,7 @@ function _M.referEquipsRpc(agent, data) | ||
453 | local hero = role.heros[msg.id] | 453 | local hero = role.heros[msg.id] |
454 | if not hero then return 10 end | 454 | if not hero then return 10 end |
455 | local equips = msg.equips | 455 | local equips = msg.equips |
456 | - local isAuto = msg.isAuth | 456 | + local isAuto = msg.isAuto |
457 | if not equips or not next(equips) then return 11 end | 457 | if not equips or not next(equips) then return 11 end |
458 | 458 | ||
459 | for typ = 1, 4 do -- 4件装备 | 459 | for typ = 1, 4 do -- 4件装备 |
@@ -807,7 +807,7 @@ function _M.drawHeroRpc(agent, data) | @@ -807,7 +807,7 @@ function _M.drawHeroRpc(agent, data) | ||
807 | role:costItems(cost, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) | 807 | role:costItems(cost, {log = {desc = "drawHero", int1 = btype, int2 = poolId}}) |
808 | 808 | ||
809 | local guideHero | 809 | local guideHero |
810 | - if role:checkOverGuide(11) and not role:checkOverGuide(12) then | 810 | + if role:getProperty("newerGuide") == "11=1" then |
811 | guideHero = 613 | 811 | guideHero = 613 |
812 | end | 812 | end |
813 | 813 | ||
@@ -941,19 +941,18 @@ function _M.unlockPoolRpc(agent, data) | @@ -941,19 +941,18 @@ function _M.unlockPoolRpc(agent, data) | ||
941 | return true | 941 | return true |
942 | end | 942 | end |
943 | 943 | ||
944 | -function _M.changeCrownRpc(agnet, data) | 944 | +function _M.changeCrown(agnet, data) |
945 | local role = agent.role | 945 | local role = agent.role |
946 | local msg = MsgPack.unpack(data) | 946 | local msg = MsgPack.unpack(data) |
947 | 947 | ||
948 | local heroType = msg.heroType | 948 | local heroType = msg.heroType |
949 | 949 | ||
950 | - if not role:isHaveHero(heroType) then return end | 950 | + if not role:isHaveHero(heroType) then return true end |
951 | role:setProperty("crown", heroType) | 951 | role:setProperty("crown", heroType) |
952 | 952 | ||
953 | role:log("hero_show", { | 953 | role:log("hero_show", { |
954 | hero_id = heroType, | 954 | hero_id = heroType, |
955 | }) | 955 | }) |
956 | - SendPacket(actionCodes.Hero_changeCrownRpc, "") | ||
957 | return true | 956 | return true |
958 | end | 957 | end |
959 | 958 |
src/actions/PvpAction.lua
@@ -335,11 +335,6 @@ function _M.endBattleRpc(agent, data) | @@ -335,11 +335,6 @@ function _M.endBattleRpc(agent, data) | ||
335 | local reward, change = role:award({[temp[1]] = temp[2]}, {log = {desc = "pvpBattleC"}}) | 335 | local reward, change = role:award({[temp[1]] = temp[2]}, {log = {desc = "pvpBattleC"}}) |
336 | local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreCommon(match.t == 1 and match.id or -1, isWin) | 336 | local myScore, matchScore, oldmyScore, oldMatchScore, myRank, oldMyRank = role:changePvpScoreCommon(match.t == 1 and match.id or -1, isWin) |
337 | 337 | ||
338 | - _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 | ||
339 | - _pvpRecordInfoCacheC = {} -- 记录刷新了 | ||
340 | - _pvpRecordBattleInfoCacheC = {} -- 取新纪录的时候搞 | ||
341 | - _pvpStartBattleCacheC = nil | ||
342 | - | ||
343 | -- 请求上传录像 | 338 | -- 请求上传录像 |
344 | local params = { | 339 | local params = { |
345 | ["roleid"] = roleId, | 340 | ["roleid"] = roleId, |
@@ -388,7 +383,22 @@ function _M.endBattleRpc(agent, data) | @@ -388,7 +383,22 @@ function _M.endBattleRpc(agent, data) | ||
388 | if isWin then | 383 | if isWin then |
389 | role:checkTaskEnter("PvpWin", {score = myScore}) | 384 | role:checkTaskEnter("PvpWin", {score = myScore}) |
390 | end | 385 | end |
386 | + | ||
387 | + role:checkBattle("pvpc", { | ||
388 | + isWin = isWin, | ||
389 | + info = msg.info, | ||
390 | + robotId = match.t == 2 and match.id or nil, | ||
391 | + enemy = match.t == 1 and _pvpBattleInfoCacheC[match.id] or nil, | ||
392 | + score = myScore, | ||
393 | + reward = reward, | ||
394 | + rank = myRank, | ||
395 | + }) | ||
391 | 396 | ||
397 | + _pvpBattleInfoCacheC = {} --重新发阵容了 没毛病 | ||
398 | + _pvpRecordInfoCacheC = {} -- 记录刷新了 | ||
399 | + _pvpRecordBattleInfoCacheC = {} -- 取新纪录的时候搞 | ||
400 | + _pvpStartBattleCacheC = nil | ||
401 | + | ||
392 | SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({ | 402 | SendPacket(actionCodes.Pvp_endBattleRpc, MsgPack.pack({ |
393 | reward = reward, | 403 | reward = reward, |
394 | change = change, | 404 | change = change, |
@@ -676,6 +686,17 @@ function _M.endBattleHRpc(agent, data) | @@ -676,6 +686,17 @@ function _M.endBattleHRpc(agent, data) | ||
676 | end | 686 | end |
677 | end) | 687 | end) |
678 | 688 | ||
689 | + role:checkBattle("pvph", { | ||
690 | + isWin = isWin, | ||
691 | + info = msg.info, | ||
692 | + robotId = match.t == 2 and match.id or nil, | ||
693 | + enemy = match.t == 1 and (revenge and _pvpRecordBattleInfoCacheH[match.id] or _pvpBattleInfoCacheH[match.id]) or nil, | ||
694 | + score = myScore, | ||
695 | + reward = reward, | ||
696 | + rank = myRank, | ||
697 | + }) | ||
698 | + | ||
699 | + | ||
679 | _pvpBattleInfoCacheH = {} --重新发阵容了 没毛病 | 700 | _pvpBattleInfoCacheH = {} --重新发阵容了 没毛病 |
680 | _pvpRecordInfoCacheH = {} -- 记录刷新了 | 701 | _pvpRecordInfoCacheH = {} -- 记录刷新了 |
681 | _pvpRecordBattleInfoCacheH = {} -- 取新纪录的时候搞 | 702 | _pvpRecordBattleInfoCacheH = {} -- 取新纪录的时候搞 |
@@ -686,7 +707,7 @@ function _M.endBattleHRpc(agent, data) | @@ -686,7 +707,7 @@ function _M.endBattleHRpc(agent, data) | ||
686 | if isWin then | 707 | if isWin then |
687 | role:checkTaskEnter("PvpWin", {score = myScore}) | 708 | role:checkTaskEnter("PvpWin", {score = myScore}) |
688 | end | 709 | end |
689 | - | 710 | + |
690 | SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ | 711 | SendPacket(actionCodes.Pvp_endBattleHRpc, MsgPack.pack({ |
691 | reward = reward, | 712 | reward = reward, |
692 | change = change, | 713 | change = change, |
src/actions/StoreAction.lua
@@ -2,6 +2,7 @@ local _M = {} | @@ -2,6 +2,7 @@ local _M = {} | ||
2 | 2 | ||
3 | local serverId = tonumber(skynet.getenv("servId")) | 3 | local serverId = tonumber(skynet.getenv("servId")) |
4 | local md5 = require "md5" | 4 | local md5 = require "md5" |
5 | +local pay_url = skynet.getenv("pay_url") or "" | ||
5 | 6 | ||
6 | local function makeOrder(roleId, rechargeId) | 7 | local function makeOrder(roleId, rechargeId) |
7 | local orderId = redisproxy:hincrby("autoincrement_set", "order", 1) | 8 | local orderId = redisproxy:hincrby("autoincrement_set", "order", 1) |
@@ -85,7 +86,7 @@ function _M.googleRechargeRpc(agent, data) | @@ -85,7 +86,7 @@ function _M.googleRechargeRpc(agent, data) | ||
85 | money = dataSet.rmb * 100, | 86 | money = dataSet.rmb * 100, |
86 | game_money = dataSet.diamond, | 87 | game_money = dataSet.diamond, |
87 | product_id = dataSet.productId, | 88 | product_id = dataSet.productId, |
88 | - notify_url = "http://l11-ts-pub-all-wasteland.komoejoy.com/pay/google" | 89 | + notify_url = pay_url .. "/pay/google" |
89 | } | 90 | } |
90 | local sign = signPms(need, secret_key) | 91 | local sign = signPms(need, secret_key) |
91 | 92 | ||
@@ -111,7 +112,7 @@ function _M.myCardRechargeRpc(agent, data) | @@ -111,7 +112,7 @@ function _M.myCardRechargeRpc(agent, data) | ||
111 | out_trade_no = partnerOrderId, | 112 | out_trade_no = partnerOrderId, |
112 | money = dataSet.rmb * 100, | 113 | money = dataSet.rmb * 100, |
113 | game_money = dataSet.diamond, | 114 | game_money = dataSet.diamond, |
114 | - notify_url = "http://l11-ts-pub-all-wasteland.komoejoy.com/pay/mycard" | 115 | + notify_url = pay_url .. "/pay/mycard" |
115 | } | 116 | } |
116 | local sign = signPms(need, secret_key) | 117 | local sign = signPms(need, secret_key) |
117 | 118 | ||
@@ -138,7 +139,7 @@ function _M.iosRechargeRpc(agent, data) | @@ -138,7 +139,7 @@ function _M.iosRechargeRpc(agent, data) | ||
138 | money = dataSet.rmb * 100, | 139 | money = dataSet.rmb * 100, |
139 | game_money = dataSet.diamond, | 140 | game_money = dataSet.diamond, |
140 | product_id = dataSet.iap_product_id, | 141 | product_id = dataSet.iap_product_id, |
141 | - notify_url = "http://l11-ts-pub-all-wasteland.komoejoy.com/pay/ios" | 142 | + notify_url = pay_url .. "/pay/ios" |
142 | } | 143 | } |
143 | local sign = signPms(need, secret_key) | 144 | local sign = signPms(need, secret_key) |
144 | 145 |
src/actions/TowerAction.lua
@@ -114,6 +114,21 @@ function _M.endBattleRpc(agent, data) | @@ -114,6 +114,21 @@ function _M.endBattleRpc(agent, data) | ||
114 | towerInfo.k = nil | 114 | towerInfo.k = nil |
115 | role:updateProperty({field = "towerInfo", value = towerInfo}) | 115 | role:updateProperty({field = "towerInfo", value = towerInfo}) |
116 | 116 | ||
117 | + | ||
118 | + local rank = redisproxy:ZREVRANK(RANK_TOWER, role:getProperty("id")) | ||
119 | + if not rank then | ||
120 | + rank = -1 | ||
121 | + else | ||
122 | + rank = rank + 1 | ||
123 | + end | ||
124 | + role:checkBattle("tower", { | ||
125 | + id = id, | ||
126 | + isWin = msg.starNum and msg.starNum > 0, | ||
127 | + info = msg.info, | ||
128 | + reward = reward, | ||
129 | + rank = rank, | ||
130 | + }) | ||
131 | + | ||
117 | SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward, change = change})) | 132 | SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({reward = reward, change = change})) |
118 | return true | 133 | return true |
119 | end | 134 | end |
src/adv/AdvPassive.lua
@@ -521,5 +521,17 @@ function Passive:effect13(eventType, triggerPms, eventId, count) | @@ -521,5 +521,17 @@ function Passive:effect13(eventType, triggerPms, eventId, count) | ||
521 | end | 521 | end |
522 | end | 522 | end |
523 | 523 | ||
524 | +--14=给所有场上怪物增加buff 《 限定 怪 id》 除了自己 | ||
525 | +function Passive:effect14(value, triggerPms, enemyId) | ||
526 | + local aims = self.owner.battle.player:getTeam(2) | ||
527 | + for k , aim in pairs(aims) do | ||
528 | + if aim ~= self.owner then | ||
529 | + if not enemyId or enemyId == 0 or aim.monsterId == enemyId then | ||
530 | + aim:addBuff(value, self.owner) | ||
531 | + end | ||
532 | + end | ||
533 | + end | ||
534 | +end | ||
535 | + | ||
524 | 536 | ||
525 | return Passive | 537 | return Passive |
526 | \ No newline at end of file | 538 | \ No newline at end of file |
src/models/Role.lua
@@ -7,6 +7,7 @@ local RoleTask = import(".RoleTask") --角色任务 | @@ -7,6 +7,7 @@ local RoleTask = import(".RoleTask") --角色任务 | ||
7 | local RoleChangeStruct = import(".RoleChangeStruct") --角色数据额结构更改 | 7 | local RoleChangeStruct = import(".RoleChangeStruct") --角色数据额结构更改 |
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 | 11 | ||
11 | RoleLog.bind(Role) | 12 | RoleLog.bind(Role) |
12 | RolePlugin.bind(Role) | 13 | RolePlugin.bind(Role) |
@@ -15,6 +16,7 @@ RoleTask.bind(Role) | @@ -15,6 +16,7 @@ RoleTask.bind(Role) | ||
15 | RoleChangeStruct.bind(Role) | 16 | RoleChangeStruct.bind(Role) |
16 | RolePvp.bind(Role) | 17 | RolePvp.bind(Role) |
17 | RoleCross.bind(Role) | 18 | RoleCross.bind(Role) |
19 | +RoleBattle.bind(Role) | ||
18 | 20 | ||
19 | function Role:ctor( properties ) | 21 | function Role:ctor( properties ) |
20 | Role.super.ctor(self, properties) | 22 | Role.super.ctor(self, properties) |
@@ -0,0 +1,185 @@ | @@ -0,0 +1,185 @@ | ||
1 | +local RoleBattle = {} | ||
2 | + | ||
3 | +--[[ | ||
4 | + 100 剧情关卡类 | ||
5 | + 200 非剧情类普通关卡 | ||
6 | + 300 每日任务类、日常本类 | ||
7 | + 400 资源获取类关卡 | ||
8 | + 500 PVP关卡 | ||
9 | + 1000 活动期间限定类关卡 | ||
10 | + 2000 其他 | ||
11 | +]] | ||
12 | + | ||
13 | +local BattleType = { | ||
14 | + hang = 100, | ||
15 | + tower = 200, | ||
16 | + bonus = 300, | ||
17 | + pvpc = 500, | ||
18 | + pvph = 501, | ||
19 | +} | ||
20 | + | ||
21 | +RoleBattle.bind = function (Role) | ||
22 | + | ||
23 | + | ||
24 | +-- TODO 检查战斗是否作弊 | ||
25 | +local function checkBattleCheat() | ||
26 | + | ||
27 | +end | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | +function Role:checkBattle(battleType, params) | ||
32 | + local clientInfo = params.info or {} | ||
33 | + | ||
34 | + if not BattleType[battleType] then | ||
35 | + print(string.format("NO find battleType: %s", battleType)) | ||
36 | + return | ||
37 | + end | ||
38 | + | ||
39 | + local selflist = {} | ||
40 | + local heroscore = 0 | ||
41 | + local teamskill = {} | ||
42 | + local enemylist = {} | ||
43 | + | ||
44 | + local fixData = { | ||
45 | + hang = function() | ||
46 | + for slot, hero in pairs(self:getProperty("hangTS")) do | ||
47 | + selflist[slot] = hero.type | ||
48 | + end | ||
49 | + heroscore = self:getProperty("hangTBV") | ||
50 | + for slot , one in pairs(self:getProperty("hangTB").supports) do | ||
51 | + teamskill[one[1]] = one[2] | ||
52 | + end | ||
53 | + local carbonData = csvdb["idle_battleCsv"][params.id] | ||
54 | + local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"] | ||
55 | + for slot, one in pairs(monsterData[1]) do | ||
56 | + enemylist[#enemylist + 1] = one["unitType"] | ||
57 | + end | ||
58 | + end, | ||
59 | + tower = function() | ||
60 | + local towerF = self:getProperty("towerF") | ||
61 | + for slot, hero in pairs(self:getTeamHerosInfo(towerF.heros)) do | ||
62 | + selflist[slot] = hero.type | ||
63 | + end | ||
64 | + heroscore = self:getTeamBattleValue(towerF.heros) | ||
65 | + for slot , one in pairs(self:getTeamBattleInfo(towerF).supports) do | ||
66 | + teamskill[one[1]] = one[2] | ||
67 | + end | ||
68 | + local carbonData = csvdb["tower_battleCsv"][params.id] | ||
69 | + local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"] | ||
70 | + for slot, one in pairs(monsterData[1]) do | ||
71 | + enemylist[#enemylist + 1] = one["unitType"] | ||
72 | + end | ||
73 | + end, | ||
74 | + bonus = function() | ||
75 | + local bTeam = self:getProperty("bTeam") | ||
76 | + for slot, hero in pairs(self:getTeamHerosInfo(bTeam.heros)) do | ||
77 | + selflist[slot] = hero.type | ||
78 | + end | ||
79 | + heroscore = self:getTeamBattleValue(bTeam.heros) | ||
80 | + for slot , one in pairs(self:getTeamBattleInfo(bTeam).supports) do | ||
81 | + teamskill[one[1]] = one[2] | ||
82 | + end | ||
83 | + local carbonData = csvdb["tower_battleCsv"][params.id] | ||
84 | + local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"] | ||
85 | + for slot, one in pairs(monsterData[1]) do | ||
86 | + enemylist[#enemylist + 1] = one["unitType"] | ||
87 | + end | ||
88 | + end, | ||
89 | + pvpc = function() | ||
90 | + for slot, hero in pairs(self:getProperty("pvpTSC")) do | ||
91 | + selflist[slot] = hero.type | ||
92 | + end | ||
93 | + heroscore = self:getProperty("pvpTBVC") | ||
94 | + for slot , one in pairs(self:getProperty("pvpTBC").supports) do | ||
95 | + teamskill[one[1]] = one[2] | ||
96 | + end | ||
97 | + if params.robotId then | ||
98 | + local carbonData = csvdb["pvp_robotCsv"][params.robotId] | ||
99 | + local monsterData = csvdb[carbonData.monster:match("/([^/]*)$") .. "Csv"] | ||
100 | + for slot, one in pairs(monsterData[1]) do | ||
101 | + enemylist[#enemylist + 1] = one["unitType"] | ||
102 | + end | ||
103 | + else | ||
104 | + for slot, one in pairs((params.enemy or {})["heros"] or {}) do | ||
105 | + enemylist[slot] = one["type"] | ||
106 | + end | ||
107 | + end | ||
108 | + end, | ||
109 | + pvph = function() | ||
110 | + for idx, team in pairs(self:getProperty("pvpTSH")) do | ||
111 | + selflist[idx] = selflist[idx] or {} | ||
112 | + for slot, hero in pairs(team) do | ||
113 | + selflist[idx][slot] = hero.type | ||
114 | + end | ||
115 | + end | ||
116 | + for _, one in pairs(self:getProperty("pvpTBVH")) do | ||
117 | + heroscore = heroscore + one | ||
118 | + end | ||
119 | + for idx, team in pairs(self:getProperty("pvpTBH")) do | ||
120 | + for slot , one in pairs(team.supports) do | ||
121 | + teamskill[one[1]] = one[2] | ||
122 | + end | ||
123 | + end | ||
124 | + | ||
125 | + if params.robotId then | ||
126 | + local carbonData = csvdb["pvp_robot_groupCsv"][params.robotId] | ||
127 | + for idx = 1, 3 do | ||
128 | + enemylist[idx] = enemylist[idx] or {} | ||
129 | + local monsterData = csvdb[carbonData["monster" .. idx]:match("/([^/]*)$") .. "Csv"] | ||
130 | + for slot, one in pairs(monsterData[1]) do | ||
131 | + enemylist[idx][#enemylist + 1] = one["unitType"] | ||
132 | + end | ||
133 | + end | ||
134 | + else | ||
135 | + for idx, team in pairs(params.enemy or {}) do | ||
136 | + enemylist[idx] = enemylist[idx] or {} | ||
137 | + for slot, one in pairs(team["heros"] or {}) do | ||
138 | + enemylist[idx][slot] = one["type"] | ||
139 | + end | ||
140 | + end | ||
141 | + end | ||
142 | + end | ||
143 | + } | ||
144 | + | ||
145 | + if fixData[battleType] then | ||
146 | + fixData[battleType]() | ||
147 | + end | ||
148 | + | ||
149 | + -- robotId = match.t == 2 and match.id or nil, | ||
150 | + -- enemy = match.t == 1 and (revenge and _pvpRecordBattleInfoCacheH[match.id] or _pvpBattleInfoCacheH[match.id]) or nil, | ||
151 | + -- score = myScore, | ||
152 | + -- reward = reward, | ||
153 | + self:log("mission", { | ||
154 | + mission_threadid = battleType == "hang" and math.floor((params.id % 100) / 100) or 0, -- 大关卡ID | ||
155 | + mission_id = params.id or 0, -- 关卡ID | ||
156 | + mission_type = BattleType[battleType], -- 关卡类型,见关卡类型枚举表 | ||
157 | + mission_herolist = selflist, -- 英雄ID,排序以玩家出战设置为准,PVP多个队伍则记录多个列表。示例:[[1,2,3],[456]] | ||
158 | + mission_heroscore = heroscore, -- 编队总评分 | ||
159 | + mission_enemylist = enemylist, -- 地方英雄ID,排序以玩家出战设置为准,PVP多个队伍则记录多个列表。示例:[[1,2,3],[456]] | ||
160 | + mission_damage = clientInfo.damage or {}, -- 英雄输出值。示例:{'heroid1':1000,'heroid2':2000,………..} | ||
161 | + mission_ultskill = clientInfo.ultskill or {}, -- 大招使用情况。示例:{'heroid1':1000,'heroid2':2000,………..} | ||
162 | + mission_reward = params.reward or {}, -- 获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | ||
163 | + mission_starttime = clientInfo.start or 0, -- 战斗开始时间,格式 unixtime 秒级 | ||
164 | + mission_roundtime = clientInfo.atime or 0, -- 对局时长(秒) | ||
165 | + mission_result = params.isWin and 1 or 2, -- 战斗结果(0-无效,1-胜利,2-失败) | ||
166 | + mission_star = 0, -- 战斗完成星数,无星级的话填写0 | ||
167 | + mission_restriction = 0, -- 周期内参与限制(0表示没有上限) | ||
168 | + mission_difficulty = 0, -- 关卡困难度,无难度区分的话填写0 | ||
169 | + mission_strength = 1, -- 消耗的体力或次数 | ||
170 | + mission_score = params.score or 0, -- 本局分数,PVP玩法记录为对战后积分,无得分的填0 | ||
171 | + mission_cleartype = 1, -- 1正常通关;2代理拾荒 | ||
172 | + mission_rank = params.rank, -- 对战后排名,适用于PVP玩法和电波塔,其他玩法留空 | ||
173 | + misson_monsterkill = clientInfo.kill or {}, -- 击杀怪物ID和数量,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | ||
174 | + misson_teamskill = teamskill, -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..} | ||
175 | + }) | ||
176 | +end | ||
177 | + | ||
178 | + | ||
179 | + | ||
180 | + | ||
181 | + | ||
182 | +end | ||
183 | + | ||
184 | + | ||
185 | +return RoleBattle | ||
0 | \ No newline at end of file | 186 | \ No newline at end of file |
src/models/RoleLog.lua
@@ -173,16 +173,16 @@ local MethodType = { | @@ -173,16 +173,16 @@ local MethodType = { | ||
173 | item_subreason = true, -- 道具流动二级原因,抽卡:卡池ID,装备强化:装备ID,副本掉落:副本ID | 173 | item_subreason = true, -- 道具流动二级原因,抽卡:卡池ID,装备强化:装备ID,副本掉落:副本ID |
174 | item_other = true, -- 其他(可包含阶数,强化等级,随机属性) | 174 | item_other = true, -- 其他(可包含阶数,强化等级,随机属性) |
175 | }, | 175 | }, |
176 | - mission = { --玩家副本完成情况 --TODO | 176 | + mission = { --玩家副本完成情况 |
177 | mission_threadid = true, -- 大关卡ID | 177 | mission_threadid = true, -- 大关卡ID |
178 | mission_id = true, -- 关卡ID | 178 | mission_id = true, -- 关卡ID |
179 | mission_type = true, -- 关卡类型,见关卡类型枚举表 | 179 | mission_type = true, -- 关卡类型,见关卡类型枚举表 |
180 | mission_sequenceid = "ucode", -- 本次对战ID,用于关联一次动作产生多条不同类型的日志 | 180 | mission_sequenceid = "ucode", -- 本次对战ID,用于关联一次动作产生多条不同类型的日志 |
181 | - mission_herolist = true, -- 英雄ID,排序以玩家出战设置为准,PVP多个队伍则记录多个列表。示例:[[1,2,3],[456]] | 181 | + mission_herolist = "json", -- 英雄ID,排序以玩家出战设置为准,PVP多个队伍则记录多个列表。示例:[[1,2,3],[456]] |
182 | mission_heroscore = true, -- 编队总评分 | 182 | mission_heroscore = true, -- 编队总评分 |
183 | - mission_enemylist = true, -- 地方英雄ID,排序以玩家出战设置为准,PVP多个队伍则记录多个列表。示例:[[1,2,3],[456]] | ||
184 | - mission_damage = true, -- 英雄输出值。示例:{'heroid1':1000,'heroid2':2000,………..} | ||
185 | - mission_ultskill = true, -- 大招使用情况。示例:{'heroid1':1000,'heroid2':2000,………..} | 183 | + mission_enemylist = "json", -- 地方英雄ID,排序以玩家出战设置为准,PVP多个队伍则记录多个列表。示例:[[1,2,3],[456]] |
184 | + mission_damage = "json", -- 英雄输出值。示例:{'heroid1':1000,'heroid2':2000,………..} | ||
185 | + mission_ultskill = "json", -- 大招使用情况。示例:{'heroid1':1000,'heroid2':2000,………..} | ||
186 | mission_reward = "json", -- 获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} | 186 | mission_reward = "json", -- 获得奖励,建议使用json格式记录。示例:{ "XX": "1", "XXX": "3"} |
187 | mission_starttime = true, -- 战斗开始时间,格式 unixtime 秒级 | 187 | mission_starttime = true, -- 战斗开始时间,格式 unixtime 秒级 |
188 | mission_roundtime = true, -- 对局时长(秒) | 188 | mission_roundtime = true, -- 对局时长(秒) |
@@ -198,7 +198,7 @@ local MethodType = { | @@ -198,7 +198,7 @@ local MethodType = { | ||
198 | misson_teamskill = "json", -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..} | 198 | misson_teamskill = "json", -- 编队支援技能和技能等级情况,json格式记录,{"teamskill1":1,"teamskill2":2,………..} |
199 | misson_teambond = "json", -- 编队羁绊和羁绊等级,json格式记录,{"bondid1":1,"bondid2":2,………..} | 199 | misson_teambond = "json", -- 编队羁绊和羁绊等级,json格式记录,{"bondid1":1,"bondid2":2,………..} |
200 | }, | 200 | }, |
201 | - residence_reward = { --玩家挂机或排名奖励 --TODO | 201 | + residence_reward = { --玩家挂机或排名奖励 |
202 | mission_threadid = true, --大关卡ID | 202 | mission_threadid = true, --大关卡ID |
203 | mission_id = true, --关卡ID | 203 | mission_id = true, --关卡ID |
204 | mission_type = true, --关卡类型,见关卡类型枚举表 | 204 | mission_type = true, --关卡类型,见关卡类型枚举表 |
@@ -524,6 +524,7 @@ function RoleLog.bind(Role) | @@ -524,6 +524,7 @@ function RoleLog.bind(Role) | ||
524 | }) | 524 | }) |
525 | end | 525 | end |
526 | 526 | ||
527 | + | ||
527 | function Role:startActionUcode() | 528 | function Role:startActionUcode() |
528 | if not self._uniqueCount then | 529 | if not self._uniqueCount then |
529 | self._uniqueCount = 0 | 530 | self._uniqueCount = 0 |