Commit 09edeae630dbac02a6b13c77d55aa55cb378e923
Merge branch 'bugfix' into qa
* bugfix: 活动以类型标识,修改双倍活动bug 伤害计算 数据保护 数据保护 充值 gm 结算rmb 客户端要用到角色创建时间 两个记录bug 新设备 遗失的log
Showing
12 changed files
with
270 additions
and
78 deletions
Show diff stats
src/actions/DinerAction.lua
@@ -901,6 +901,7 @@ function _M.entrustRpc(agent , data) | @@ -901,6 +901,7 @@ function _M.entrustRpc(agent , data) | ||
901 | 901 | ||
902 | role:finishGuide(26) | 902 | role:finishGuide(26) |
903 | role:mylog("diner_action", {desc = "entrus", short1 = ctype, int1 = entrustId}) | 903 | role:mylog("diner_action", {desc = "entrus", short1 = ctype, int1 = entrustId}) |
904 | + role:checkTaskEnter("VillageApply", {}) | ||
904 | 905 | ||
905 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward, change = change})) | 906 | SendPacket(actionCodes.Diner_entrustRpc, MsgPack.pack({reward = reward, change = change})) |
906 | return true | 907 | return true |
src/actions/GmAction.lua
@@ -27,6 +27,7 @@ function _M.ignoreout(role, pms) | @@ -27,6 +27,7 @@ function _M.ignoreout(role, pms) | ||
27 | else -- 解除 | 27 | else -- 解除 |
28 | role:updateProperty({field = "ignoreMt", value = 0}) | 28 | role:updateProperty({field = "ignoreMt", value = 0}) |
29 | end | 29 | end |
30 | + role:mylog("gm_action", {desc = "ignoreout", key1 = pms.sender}) | ||
30 | return "指令生效" | 31 | return "指令生效" |
31 | end | 32 | end |
32 | 33 | ||
@@ -46,11 +47,17 @@ function _M.ban(role, pms) | @@ -46,11 +47,17 @@ function _M.ban(role, pms) | ||
46 | end) | 47 | end) |
47 | end | 48 | end |
48 | end | 49 | end |
50 | + | ||
51 | + role:mylog("gm_action", {desc = "ban", int1 = time, int2 = ctype, key1 = pms.sender}) | ||
52 | + | ||
49 | return isBan and "解封杀成功" or "封杀成功" | 53 | return isBan and "解封杀成功" or "封杀成功" |
50 | end | 54 | end |
51 | 55 | ||
52 | function _M.unban(role, pms) | 56 | function _M.unban(role, pms) |
53 | role:setBan(0, 0) | 57 | role:setBan(0, 0) |
58 | + | ||
59 | + role:mylog("gm_action", {desc = "unban", key1 = pms.sender}) | ||
60 | + | ||
54 | return "解封杀成功" | 61 | return "解封杀成功" |
55 | end | 62 | end |
56 | 63 | ||
@@ -63,6 +70,8 @@ function _M.gmmsg(role, pms) | @@ -63,6 +70,8 @@ function _M.gmmsg(role, pms) | ||
63 | skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd) | 70 | skynet.call(agent.gate_serv, "lua", "forcekick", agent.fd) |
64 | end) | 71 | end) |
65 | end | 72 | end |
73 | + role:mylog("gm_action", {desc = "gmmsg", text1 = pms.pm1, key1 = pms.sender}) | ||
74 | + | ||
66 | return "指令成功" | 75 | return "指令成功" |
67 | end | 76 | end |
68 | 77 | ||
@@ -73,6 +82,8 @@ function _M.silent(role, pms) | @@ -73,6 +82,8 @@ function _M.silent(role, pms) | ||
73 | return "解禁言成功" | 82 | return "解禁言成功" |
74 | end | 83 | end |
75 | role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400}) | 84 | role:updateProperty({field = "silent", value = specTime({hour = 0}, skynet.timex()) + pm1 * 86400}) |
85 | + | ||
86 | + role:mylog("gm_action", {desc = "silent", int1 = pms.pm1, key1 = pms.sender}) | ||
76 | return "禁言成功" | 87 | return "禁言成功" |
77 | end | 88 | end |
78 | 89 | ||
@@ -90,6 +101,8 @@ function _M.hero(role, pms) | @@ -90,6 +101,8 @@ function _M.hero(role, pms) | ||
90 | if not role:addHero({type = heroType, log = {desc = "gm"}}) then | 101 | if not role:addHero({type = heroType, log = {desc = "gm"}}) then |
91 | return "失败" | 102 | return "失败" |
92 | end | 103 | end |
104 | + | ||
105 | + role:mylog("gm_action", {desc = "hero", int1 = heroType, key1 = pms.sender}) | ||
93 | return "成功" | 106 | return "成功" |
94 | end | 107 | end |
95 | 108 | ||
@@ -122,6 +135,8 @@ function _M.herol(role, pms) | @@ -122,6 +135,8 @@ function _M.herol(role, pms) | ||
122 | hero:updateProperty({field = "level", delta = addLevel}) | 135 | hero:updateProperty({field = "level", delta = addLevel}) |
123 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) | 136 | role:checkTaskEnter("HeroLevelUp", {level = hero:getProperty("level")}) |
124 | 137 | ||
138 | + role:mylog("gm_action", {desc = "herol", int1 = heroType, int2 = addLevel, key1 = pms.sender}) | ||
139 | + | ||
125 | return "成功" | 140 | return "成功" |
126 | end | 141 | end |
127 | 142 | ||
@@ -133,6 +148,8 @@ function _M.herola(role, pms) | @@ -133,6 +148,8 @@ function _M.herola(role, pms) | ||
133 | _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel}) | 148 | _M.herol(role, {pm1 = hero:getProperty("type"), pm2 = addLevel}) |
134 | end | 149 | end |
135 | 150 | ||
151 | + role:mylog("gm_action", {desc = "herola", int1 = addLevel, key1 = pms.sender}) | ||
152 | + | ||
136 | return "成功" | 153 | return "成功" |
137 | end | 154 | end |
138 | 155 | ||
@@ -143,6 +160,7 @@ function _M.equip(role, pms) | @@ -143,6 +160,7 @@ function _M.equip(role, pms) | ||
143 | local level = tonum(pms.pm2) | 160 | local level = tonum(pms.pm2) |
144 | local count = tonum(pms.pm3) | 161 | local count = tonum(pms.pm3) |
145 | role:addEquip(typ, level, count, {log = {desc = "gm"}}) | 162 | role:addEquip(typ, level, count, {log = {desc = "gm"}}) |
163 | + role:mylog("gm_action", {desc = "equip", int1 = typ, int2 = level, long1 = count, key1 = pms.sender}) | ||
146 | return "成功" | 164 | return "成功" |
147 | end | 165 | end |
148 | 166 | ||
@@ -151,6 +169,7 @@ function _M.rune(role, pms) | @@ -151,6 +169,7 @@ function _M.rune(role, pms) | ||
151 | local typ = tonum(pms.pm1) | 169 | local typ = tonum(pms.pm1) |
152 | local id = tonum(pms.pm2) | 170 | local id = tonum(pms.pm2) |
153 | local result = role:addRune({type = typ,id = id, log = {desc = "gm"}}) | 171 | local result = role:addRune({type = typ,id = id, log = {desc = "gm"}}) |
172 | + role:mylog("gm_action", {desc = "rune", int1 = typ, int2 = id, key1 = pms.sender}) | ||
154 | 173 | ||
155 | return result | 174 | return result |
156 | end | 175 | end |
@@ -171,6 +190,8 @@ function _M.fb(role, pms) -- 直接通关 | @@ -171,6 +190,8 @@ function _M.fb(role, pms) -- 直接通关 | ||
171 | role:hangFinish(carbonId) | 190 | role:hangFinish(carbonId) |
172 | addPre(carbonId) | 191 | addPre(carbonId) |
173 | 192 | ||
193 | + role:mylog("gm_action", {desc = "fb", int1 = carbonId, key1 = pms.sender}) | ||
194 | + | ||
174 | role:checkTaskEnter("HangPass", {id = carbonId}) | 195 | role:checkTaskEnter("HangPass", {id = carbonId}) |
175 | return "成功" | 196 | return "成功" |
176 | end | 197 | end |
@@ -191,6 +212,8 @@ function _M.fbc(role, pms) -- 直接通关 | @@ -191,6 +212,8 @@ function _M.fbc(role, pms) -- 直接通关 | ||
191 | end | 212 | end |
192 | role:updateProperty({field = "hangPass", value = {}}) | 213 | role:updateProperty({field = "hangPass", value = {}}) |
193 | addPre(carbonId) | 214 | addPre(carbonId) |
215 | + | ||
216 | + role:mylog("gm_action", {desc = "fbc", int1 = carbonId, key1 = pms.sender}) | ||
194 | 217 | ||
195 | return "成功" | 218 | return "成功" |
196 | end | 219 | end |
@@ -224,6 +247,8 @@ function _M.exp(role, pms) | @@ -224,6 +247,8 @@ function _M.exp(role, pms) | ||
224 | exp = math.floor(math.max(exp, 0)) | 247 | exp = math.floor(math.max(exp, 0)) |
225 | role:addPlayExp(exp, {log = {desc = "gm"}}) | 248 | role:addPlayExp(exp, {log = {desc = "gm"}}) |
226 | 249 | ||
250 | + role:mylog("gm_action", {desc = "exp", int1 = exp, key1 = pms.sender}) | ||
251 | + | ||
227 | return "成功" | 252 | return "成功" |
228 | end | 253 | end |
229 | 254 | ||
@@ -280,6 +305,7 @@ function _M.get(role, pms) | @@ -280,6 +305,7 @@ function _M.get(role, pms) | ||
280 | end | 305 | end |
281 | local count = tonum(pms.pm2, 1) | 306 | local count = tonum(pms.pm2, 1) |
282 | role:award({[itemId] = count}, {log = {desc = "gm"}}) | 307 | role:award({[itemId] = count}, {log = {desc = "gm"}}) |
308 | + role:mylog("gm_action", {desc = "get", int1 = itemId, int2 = count, key1 = pms.sender}) | ||
283 | end | 309 | end |
284 | return "成功" | 310 | return "成功" |
285 | end | 311 | end |
@@ -303,6 +329,9 @@ function _M.advc(role, pms) | @@ -303,6 +329,9 @@ function _M.advc(role, pms) | ||
303 | advAFWear = {}, | 329 | advAFWear = {}, |
304 | }, notNotify) | 330 | }, notNotify) |
305 | role.advData = nil | 331 | role.advData = nil |
332 | + | ||
333 | + role:mylog("gm_action", {desc = "advc", key1 = pms.sender}) | ||
334 | + | ||
306 | return "成功" | 335 | return "成功" |
307 | end | 336 | end |
308 | 337 | ||
@@ -311,6 +340,8 @@ function _M.advf(role, pms) | @@ -311,6 +340,8 @@ function _M.advf(role, pms) | ||
311 | role:updateProperty({field = "advC", value = 0}) | 340 | role:updateProperty({field = "advC", value = 0}) |
312 | role.dailyData:updateProperty({field = "advElC", value = 0}) | 341 | role.dailyData:updateProperty({field = "advElC", value = 0}) |
313 | 342 | ||
343 | + role:mylog("gm_action", {desc = "advf", key1 = pms.sender}) | ||
344 | + | ||
314 | return "成功" | 345 | return "成功" |
315 | end | 346 | end |
316 | 347 | ||
@@ -330,6 +361,7 @@ function _M.adv(role, pms) | @@ -330,6 +361,7 @@ function _M.adv(role, pms) | ||
330 | advPass[chapterId] = layer | 361 | advPass[chapterId] = layer |
331 | role:updateProperty({field = "advPass", value = advPass}) | 362 | role:updateProperty({field = "advPass", value = advPass}) |
332 | end | 363 | end |
364 | + role:mylog("gm_action", {desc = "adv", int1 = chapterId, int2 = layer, key1 = pms.sender}) | ||
333 | 365 | ||
334 | return "成功" | 366 | return "成功" |
335 | end | 367 | end |
@@ -356,6 +388,7 @@ function _M.advt(role, pms) | @@ -356,6 +388,7 @@ function _M.advt(role, pms) | ||
356 | isEnter = true, | 388 | isEnter = true, |
357 | debugMapId = mapId, | 389 | debugMapId = mapId, |
358 | }) | 390 | }) |
391 | + role:mylog("gm_action", {desc = "advt", int1 = chapterId, int2 = layer, key1 = pms.sender}) | ||
359 | return "成功" | 392 | return "成功" |
360 | end | 393 | end |
361 | 394 | ||
@@ -364,6 +397,8 @@ function _M.advl(role, pms) | @@ -364,6 +397,8 @@ function _M.advl(role, pms) | ||
364 | local exp = tonum(pms.pm1) | 397 | local exp = tonum(pms.pm1) |
365 | role:addAdvLvExp(math.max(0, exp)) | 398 | role:addAdvLvExp(math.max(0, exp)) |
366 | 399 | ||
400 | + role:mylog("gm_action", {desc = "advl", int1 = exp, key1 = pms.sender}) | ||
401 | + | ||
367 | return "成功" | 402 | return "成功" |
368 | end | 403 | end |
369 | 404 | ||
@@ -377,6 +412,7 @@ function _M.advcl(role, pms) | @@ -377,6 +412,7 @@ function _M.advcl(role, pms) | ||
377 | end | 412 | end |
378 | advData.battle.player:addExp(exp) | 413 | advData.battle.player:addExp(exp) |
379 | advData:saveDB() | 414 | advData:saveDB() |
415 | + role:mylog("gm_action", {desc = "advcl", int1 = exp, key1 = pms.sender}) | ||
380 | 416 | ||
381 | return "成功" | 417 | return "成功" |
382 | end | 418 | end |
@@ -386,6 +422,7 @@ function _M.idlec(role, pms) | @@ -386,6 +422,7 @@ function _M.idlec(role, pms) | ||
386 | role:updateProperty({field = "hangTeam", value = {}}) | 422 | role:updateProperty({field = "hangTeam", value = {}}) |
387 | role:updateProperty({field = "hangInfo", value = {}}) | 423 | role:updateProperty({field = "hangInfo", value = {}}) |
388 | role:updateProperty({field = "hangBag", value = {}}) | 424 | role:updateProperty({field = "hangBag", value = {}}) |
425 | + role:mylog("gm_action", {desc = "idlec", key1 = pms.sender}) | ||
389 | 426 | ||
390 | role.advData = nil | 427 | role.advData = nil |
391 | return "成功" | 428 | return "成功" |
@@ -410,6 +447,8 @@ function _M.advit(role, pms) | @@ -410,6 +447,8 @@ function _M.advit(role, pms) | ||
410 | local itemId = tonum(pms.pm1) | 447 | local itemId = tonum(pms.pm1) |
411 | local count = tonum(pms.pm2) | 448 | local count = tonum(pms.pm2) |
412 | reward[itemId] = count | 449 | reward[itemId] = count |
450 | + | ||
451 | + role:mylog("gm_action", {desc = "advit", int1 = itemId, int2 = count, key1 = pms.sender}) | ||
413 | end | 452 | end |
414 | 453 | ||
415 | 454 | ||
@@ -425,6 +464,8 @@ function _M.tower(role, pms) | @@ -425,6 +464,8 @@ function _M.tower(role, pms) | ||
425 | if not csvdb["tower_battleCsv"][level] then return "不存在" end | 464 | if not csvdb["tower_battleCsv"][level] then return "不存在" end |
426 | role:updateProperty({field = "towerInfo", value = {c = globalCsv.tower_count_limit, l = level}}) | 465 | role:updateProperty({field = "towerInfo", value = {c = globalCsv.tower_count_limit, l = level}}) |
427 | 466 | ||
467 | + role:mylog("gm_action", {desc = "tower", int1 = level, key1 = pms.sender}) | ||
468 | + | ||
428 | return "成功" | 469 | return "成功" |
429 | end | 470 | end |
430 | 471 | ||
@@ -443,6 +484,8 @@ function _M.email(role, pms) | @@ -443,6 +484,8 @@ function _M.email(role, pms) | ||
443 | rewardPms = id ~= 0 and reward or nil, | 484 | rewardPms = id ~= 0 and reward or nil, |
444 | }) | 485 | }) |
445 | 486 | ||
487 | + role:mylog("gm_action", {desc = "email", int1 = id, key1 = pms.sender}) | ||
488 | + | ||
446 | return "成功" | 489 | return "成功" |
447 | end | 490 | end |
448 | 491 | ||
@@ -461,6 +504,8 @@ function _M.guide(role, pms) | @@ -461,6 +504,8 @@ function _M.guide(role, pms) | ||
461 | end | 504 | end |
462 | end | 505 | end |
463 | role:updateProperty({field = "funcGuide", value = str}) | 506 | role:updateProperty({field = "funcGuide", value = str}) |
507 | + role:mylog("gm_action", {desc = "sguide", key1 = pms.sender}) | ||
508 | + | ||
464 | elseif cmd == "RESET" then | 509 | elseif cmd == "RESET" then |
465 | local id = tonum(pms.pm2, 0) | 510 | local id = tonum(pms.pm2, 0) |
466 | if id == 0 then | 511 | if id == 0 then |
@@ -473,6 +518,8 @@ function _M.guide(role, pms) | @@ -473,6 +518,8 @@ function _M.guide(role, pms) | ||
473 | elseif id == 2 then | 518 | elseif id == 2 then |
474 | role:updateProperty({field = "funcGuide", value = ""}) | 519 | role:updateProperty({field = "funcGuide", value = ""}) |
475 | end | 520 | end |
521 | + role:mylog("gm_action", {desc = "cguide", int1 = id, key1 = pms.sender}) | ||
522 | + | ||
476 | end | 523 | end |
477 | 524 | ||
478 | return "成功" | 525 | return "成功" |
@@ -496,4 +543,21 @@ function _M.ayncPurchase(role, params) | @@ -496,4 +543,21 @@ function _M.ayncPurchase(role, params) | ||
496 | return role:handlePurchase(params) or "" | 543 | return role:handlePurchase(params) or "" |
497 | end | 544 | end |
498 | 545 | ||
546 | +function _M.cz(role, pms) | ||
547 | + local id = tonum(pms.pm1) | ||
548 | + local csvData = csvdb["shop_rechargeCsv"][id] | ||
549 | + if not csvData then | ||
550 | + return "充值id错误, 查看shop_recharge.csv" | ||
551 | + end | ||
552 | + role:recharge({ | ||
553 | + id = id, | ||
554 | + transactionId = "GM", | ||
555 | + order = "GM", | ||
556 | + pay_time = skynet.timex(), | ||
557 | + }) | ||
558 | + role:mylog("gm_action", {desc = "recharge", int1 = id, key1 = pms.sender}) | ||
559 | + return "指令成功" | ||
560 | +end | ||
561 | + | ||
562 | + | ||
499 | return _M | 563 | return _M |
500 | \ No newline at end of file | 564 | \ No newline at end of file |
src/actions/HangAction.lua
@@ -166,7 +166,7 @@ function _M.startRpc( agent, data ) | @@ -166,7 +166,7 @@ function _M.startRpc( agent, data ) | ||
166 | elseif carbonId == 10220 then | 166 | elseif carbonId == 10220 then |
167 | role:saveGuide(22,1) | 167 | role:saveGuide(22,1) |
168 | end | 168 | end |
169 | - | 169 | + role:mylog("hang_action", {desc = "startHang", int1 = carbonId}) |
170 | SendPacket(actionCodes.Hang_startRpc, '') | 170 | SendPacket(actionCodes.Hang_startRpc, '') |
171 | return true | 171 | return true |
172 | end | 172 | end |
@@ -289,6 +289,9 @@ function _M.endBattleRpc(agent, data) | @@ -289,6 +289,9 @@ function _M.endBattleRpc(agent, data) | ||
289 | reward = reward, | 289 | reward = reward, |
290 | }) | 290 | }) |
291 | 291 | ||
292 | + local team = role:getProperty("pvpTC") | ||
293 | + 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)}) | ||
294 | + | ||
292 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ | 295 | SendPacket(actionCodes.Hang_endBattleRpc, MsgPack.pack({ |
293 | starNum = msg.starNum, | 296 | starNum = msg.starNum, |
294 | reward = reward, | 297 | reward = reward, |
@@ -409,10 +412,9 @@ function _M.quickRpc(agent , data) | @@ -409,10 +412,9 @@ function _M.quickRpc(agent , data) | ||
409 | end | 412 | end |
410 | 413 | ||
411 | local doubleCoef = role.activity:isOpen("DoubleDrop") and 2 or 1 | 414 | local doubleCoef = role.activity:isOpen("DoubleDrop") and 2 or 1 |
412 | - | ||
413 | -- 特权卡获取加速获得额外道具 | 415 | -- 特权卡获取加速获得额外道具 |
414 | local coef = role.storeData:getProduceItemSpeedCoef() | 416 | local coef = role.storeData:getProduceItemSpeedCoef() |
415 | - if coef > 1 then | 417 | + if coef > 1 or doubleCoef > 1 then |
416 | for k, cnt in pairs(reward) do | 418 | for k, cnt in pairs(reward) do |
417 | reward[k] = math.floor(cnt * coef * doubleCoef) | 419 | reward[k] = math.floor(cnt * coef * doubleCoef) |
418 | end | 420 | end |
@@ -479,10 +481,15 @@ function _M.buyBonusCountRpc(agent, data) | @@ -479,10 +481,15 @@ function _M.buyBonusCountRpc(agent, data) | ||
479 | local btype = msg.type | 481 | local btype = msg.type |
480 | 482 | ||
481 | if not TimeReset["DailyBattle" .. btype] then return end | 483 | if not TimeReset["DailyBattle" .. btype] then return end |
484 | + local open, actId = role.activity:isOpen("BonusDouble") | ||
485 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
486 | + if not actData then return end | ||
487 | + | ||
488 | + local coef = open and tonumber(actData.condition2) or 1 | ||
482 | 489 | ||
483 | local bonusC = role.dailyData:getProperty("bonusC") | 490 | local bonusC = role.dailyData:getProperty("bonusC") |
484 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} | 491 | bonusC[btype] = bonusC[btype] or {c = 0, b = 0} |
485 | - local lastCount = globalCsv.bonus_daily_buy_count - bonusC[btype]["b"] | 492 | + local lastCount = globalCsv.bonus_daily_buy_count * coef - bonusC[btype]["b"] |
486 | if math.illegalNum(count, 1, lastCount) then return 1 end | 493 | if math.illegalNum(count, 1, lastCount) then return 1 end |
487 | 494 | ||
488 | if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return 2 end | 495 | if not role:checkItemEnough({[ItemId.Diamond] = globalCsv.bonus_buy_cost * count}) then return 2 end |
@@ -502,20 +509,30 @@ function _M.startBonusBattleRpc(agent, data) | @@ -502,20 +509,30 @@ function _M.startBonusBattleRpc(agent, data) | ||
502 | local msg = MsgPack.unpack(data) | 509 | local msg = MsgPack.unpack(data) |
503 | local id = msg.id | 510 | local id = msg.id |
504 | 511 | ||
505 | - if not role:isFuncUnlock(FuncUnlock.BonusBattle) then return end | 512 | + local open, actId = role.activity:isOpen("BonusDouble") |
513 | + | ||
514 | + if not role:isFuncUnlock(FuncUnlock.BonusBattle) then return 1 end | ||
506 | 515 | ||
507 | local bonusData = csvdb["bonus_battleCsv"][id] | 516 | local bonusData = csvdb["bonus_battleCsv"][id] |
508 | 517 | ||
509 | - if not role:isTimeResetOpen(TimeReset["DailyBattle" .. bonusData.type]) then return end | 518 | + if not open then |
519 | + if not role:isTimeResetOpen(TimeReset["DailyBattle" .. bonusData.type]) then return 2 end | ||
520 | + end | ||
510 | 521 | ||
511 | - if not bonusData then return 1 end | ||
512 | - if not role:checkHangPass(bonusData.unlock) then return 2 end | 522 | + if not bonusData then return 3 end |
523 | + if not role:checkHangPass(bonusData.unlock) then return 4 end | ||
513 | 524 | ||
514 | - if not next(role:getProperty("bTeam")) then return 3 end | 525 | + if not next(role:getProperty("bTeam")) then return 5 end |
515 | 526 | ||
516 | local bonusC = role.dailyData:getProperty("bonusC") | 527 | local bonusC = role.dailyData:getProperty("bonusC") |
517 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} | 528 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} |
518 | - if globalCsv.bonus_daily_count - bonusC[bonusData.type]["c"] <= 0 then return 4 end | 529 | + |
530 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
531 | + if not actData then return 6 end | ||
532 | + | ||
533 | + local coef = open and tonumber(actData.condition2) or 1 | ||
534 | + | ||
535 | + if globalCsv.bonus_daily_count * coef - bonusC[bonusData.type]["c"] <= 0 then return 7 end | ||
519 | 536 | ||
520 | 537 | ||
521 | role.__bonusBattleCache = { | 538 | role.__bonusBattleCache = { |
@@ -533,6 +550,11 @@ function _M.endBonusBattleRpc(agent, data) | @@ -533,6 +550,11 @@ function _M.endBonusBattleRpc(agent, data) | ||
533 | local key = msg.key | 550 | local key = msg.key |
534 | local starNum = msg.starNum | 551 | local starNum = msg.starNum |
535 | if not role.__bonusBattleCache then return 1 end | 552 | if not role.__bonusBattleCache then return 1 end |
553 | + local open, actId = role.activity:isOpen("BonusDouble") | ||
554 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
555 | + if not actData then return end | ||
556 | + | ||
557 | + local coef = open and tonumber(actData.condition2) or 1 | ||
536 | 558 | ||
537 | if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then | 559 | if role.__bonusBattleCache.id ~= id or role.__bonusBattleCache.key ~= key then |
538 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) | 560 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({errorCode = 1})) |
@@ -545,7 +567,7 @@ function _M.endBonusBattleRpc(agent, data) | @@ -545,7 +567,7 @@ function _M.endBonusBattleRpc(agent, data) | ||
545 | -- 胜利扣除次数 | 567 | -- 胜利扣除次数 |
546 | local bonusC = role.dailyData:getProperty("bonusC") | 568 | local bonusC = role.dailyData:getProperty("bonusC") |
547 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} | 569 | bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} |
548 | - if globalCsv.bonus_daily_count - bonusC[bonusData.type]["c"] <= 0 then return 3 end | 570 | + if globalCsv.bonus_daily_count * coef - bonusC[bonusData.type]["c"] <= 0 then return 3 end |
549 | bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + 1 | 571 | bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + 1 |
550 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) | 572 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) |
551 | 573 | ||
@@ -554,6 +576,9 @@ function _M.endBonusBattleRpc(agent, data) | @@ -554,6 +576,9 @@ function _M.endBonusBattleRpc(agent, data) | ||
554 | if chance[1] ~= 0 then | 576 | if chance[1] ~= 0 then |
555 | reward[chance[1]] = (reward[chance[1]] or 0) + chance[2] | 577 | reward[chance[1]] = (reward[chance[1]] or 0) + chance[2] |
556 | end | 578 | end |
579 | + for k, v in pairs(reward) do | ||
580 | + reward[k] = v * (coef > 1 and actData.condition or 1) | ||
581 | + end | ||
557 | reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = id}}) | 582 | reward, change = role:award(reward, {log = {desc = "bonusBattle", int1 = id}}) |
558 | role:checkTaskEnter("BonusPass", {id = id}) | 583 | role:checkTaskEnter("BonusPass", {id = id}) |
559 | end | 584 | end |
@@ -564,6 +589,8 @@ function _M.endBonusBattleRpc(agent, data) | @@ -564,6 +589,8 @@ function _M.endBonusBattleRpc(agent, data) | ||
564 | info = msg.info, | 589 | info = msg.info, |
565 | reward = reward, | 590 | reward = reward, |
566 | }) | 591 | }) |
592 | + role:mylog("hang_action", {desc = "bonusBattle", short1 = msg.starNum > 0 and 1 or 0, int1 = id}) | ||
593 | + | ||
567 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ | 594 | SendPacket(actionCodes.Hang_endBonusBattleRpc, MsgPack.pack({ |
568 | starNum = starNum, | 595 | starNum = starNum, |
569 | reward = reward, | 596 | reward = reward, |
@@ -586,6 +613,7 @@ function _M.hangGiftRpc(agent, data) | @@ -586,6 +613,7 @@ function _M.hangGiftRpc(agent, data) | ||
586 | local reward, change = role:award(carbonData.item_clear_special, {log = {desc = "hangGift", int1 = id}}) | 613 | local reward, change = role:award(carbonData.item_clear_special, {log = {desc = "hangGift", int1 = id}}) |
587 | 614 | ||
588 | role:changeUpdates({{type = "hangGift", field = id, value = 1}}) | 615 | role:changeUpdates({{type = "hangGift", field = id, value = 1}}) |
616 | + role:mylog("hang_action", {desc = "hangGift", int1 = id}) | ||
589 | 617 | ||
590 | SendPacket(actionCodes.Hang_hangGiftRpc, MsgPack.pack({reward = reward, change = change})) | 618 | SendPacket(actionCodes.Hang_hangGiftRpc, MsgPack.pack({reward = reward, change = change})) |
591 | return true | 619 | return true |
src/actions/HeroAction.lua
@@ -721,7 +721,7 @@ function _M.drawHeroRpc(agent, data) | @@ -721,7 +721,7 @@ function _M.drawHeroRpc(agent, data) | ||
721 | local role = agent.role | 721 | local role = agent.role |
722 | local msg = MsgPack.unpack(data) | 722 | local msg = MsgPack.unpack(data) |
723 | 723 | ||
724 | - if not role:isFuncUnlock(FuncUnlock.GetHero) then return end | 724 | + if not role:isFuncUnlock(FuncUnlock.GetHero) then return 1 end |
725 | local btype = msg.pool -- 1 2 3 卡池类型 | 725 | local btype = msg.pool -- 1 2 3 卡池类型 |
726 | local subType = msg.subType or 1-- 定向卡池需要传 子类型 | 726 | local subType = msg.subType or 1-- 定向卡池需要传 子类型 |
727 | local drawType = msg.type -- 1 单抽 2 十连 | 727 | local drawType = msg.type -- 1 单抽 2 十连 |
@@ -730,10 +730,10 @@ function _M.drawHeroRpc(agent, data) | @@ -730,10 +730,10 @@ function _M.drawHeroRpc(agent, data) | ||
730 | end | 730 | end |
731 | 731 | ||
732 | local buildTypeData = csvdb["build_typeCsv"][btype] | 732 | local buildTypeData = csvdb["build_typeCsv"][btype] |
733 | - if not buildTypeData then return 1 end | 733 | + if not buildTypeData then return 2 end |
734 | 734 | ||
735 | local drawCount = {1, 10} -- 抽取次数 | 735 | local drawCount = {1, 10} -- 抽取次数 |
736 | - if not drawCount[drawType] then return 2 end | 736 | + if not drawCount[drawType] then return 3 end |
737 | 737 | ||
738 | local draw_floor_back_counts = globalCsv.draw_floor_back_counts[btype] | 738 | local draw_floor_back_counts = globalCsv.draw_floor_back_counts[btype] |
739 | local floorHeroCount = role:getProperty("floorHero")[btype] or 0 | 739 | local floorHeroCount = role:getProperty("floorHero")[btype] or 0 |
@@ -757,20 +757,20 @@ function _M.drawHeroRpc(agent, data) | @@ -757,20 +757,20 @@ function _M.drawHeroRpc(agent, data) | ||
757 | end | 757 | end |
758 | end | 758 | end |
759 | if lastCount > 0 then -- 钱不够 | 759 | if lastCount > 0 then -- 钱不够 |
760 | - return 3 | 760 | + return 4 |
761 | end | 761 | end |
762 | 762 | ||
763 | -- 抽取的池子 | 763 | -- 抽取的池子 |
764 | local poolMap = buildTypeData["pool"]:toNumMap() | 764 | local poolMap = buildTypeData["pool"]:toNumMap() |
765 | local poolId = poolMap[subType] | 765 | local poolId = poolMap[subType] |
766 | - if not poolId then return end | 766 | + if not poolId then return 5 end |
767 | 767 | ||
768 | --判断定向卡池是否开启 | 768 | --判断定向卡池是否开启 |
769 | if btype == 1 then | 769 | if btype == 1 then |
770 | if not role:isTimeResetOpen(TimeReset["DrawType" .. subType]) then | 770 | if not role:isTimeResetOpen(TimeReset["DrawType" .. subType]) then |
771 | local unlockPool = role.dailyData:getProperty("unlockPool") | 771 | local unlockPool = role.dailyData:getProperty("unlockPool") |
772 | if not unlockPool[subType] then | 772 | if not unlockPool[subType] then |
773 | - return 1 | 773 | + return 6 |
774 | end | 774 | end |
775 | end | 775 | end |
776 | end | 776 | end |
@@ -782,12 +782,12 @@ function _M.drawHeroRpc(agent, data) | @@ -782,12 +782,12 @@ function _M.drawHeroRpc(agent, data) | ||
782 | end | 782 | end |
783 | 783 | ||
784 | local unitPool = csvdb["build_unitCsv"][poolId] | 784 | local unitPool = csvdb["build_unitCsv"][poolId] |
785 | - if not unitPool then return 4 end | 785 | + if not unitPool then return 7 end |
786 | 786 | ||
787 | -- 开始抽 | 787 | -- 开始抽 |
788 | local resultPool = {} | 788 | local resultPool = {} |
789 | local function fillDrawPool(isFloorBack) | 789 | local function fillDrawPool(isFloorBack) |
790 | - local condition = {"rare", "camp"} | 790 | + local condition = {"rare"} |
791 | local values = {} | 791 | local values = {} |
792 | 792 | ||
793 | 793 | ||
@@ -848,7 +848,7 @@ function _M.drawHeroRpc(agent, data) | @@ -848,7 +848,7 @@ function _M.drawHeroRpc(agent, data) | ||
848 | fillDrawPool(isFloorBack) | 848 | fillDrawPool(isFloorBack) |
849 | if not next(resultPool) then | 849 | if not next(resultPool) then |
850 | skynet.error("random pool error, poolId:" .. poolId) | 850 | skynet.error("random pool error, poolId:" .. poolId) |
851 | - return | 851 | + return 8 |
852 | end | 852 | end |
853 | 853 | ||
854 | local itemId = math.randWeight(resultPool, 1) | 854 | local itemId = math.randWeight(resultPool, 1) |
src/actions/RoleAction.lua
@@ -292,7 +292,10 @@ function _M.loginRpc( agent, data ) | @@ -292,7 +292,10 @@ function _M.loginRpc( agent, data ) | ||
292 | 292 | ||
293 | local hangPass = role:getProperty("hangPass") | 293 | local hangPass = role:getProperty("hangPass") |
294 | role:log("onLogin") | 294 | role:log("onLogin") |
295 | - | 295 | + role:mylog("login", {key1 = agent.ip:toArray(false, ":")[1], int1 = hangPass[1] or 0}) |
296 | + if msg.newdevice then | ||
297 | + role:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) | ||
298 | + end | ||
296 | return true | 299 | return true |
297 | end | 300 | end |
298 | 301 | ||
@@ -359,7 +362,10 @@ function _M.createRpc(agent, data) | @@ -359,7 +362,10 @@ function _M.createRpc(agent, data) | ||
359 | newRole:log("onCreateAccount") | 362 | newRole:log("onCreateAccount") |
360 | end | 363 | end |
361 | newRole:log("onCreateRole") | 364 | newRole:log("onCreateRole") |
362 | - | 365 | + newRole:mylog("create", {key1 = agent.ip:toArray(false, ":")[1]}) |
366 | + if msg.newdevice then | ||
367 | + newRole:mylog("newdevice", {key1 = agent.ip:toArray(false, ":")[1]}) | ||
368 | + end | ||
363 | 369 | ||
364 | SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response)) | 370 | SendPacket(actionCodes.Role_createRpc, MsgPack.pack(response)) |
365 | return true | 371 | return true |
@@ -552,7 +558,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -552,7 +558,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
552 | if boxL[slot].time > skynet.timex() then -- 没开完 | 558 | if boxL[slot].time > skynet.timex() then -- 没开完 |
553 | if not quick then return end | 559 | if not quick then return end |
554 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") | 560 | local cost_pre = globalCsv.box_timeOpen_diamond:toArray(true, "=") |
555 | - local costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] | 561 | + costKey = math.ceil((boxL[slot].time - skynet.timex()) / (cost_pre[1] * 60)) * cost_pre[2] |
556 | if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end | 562 | if not role:checkItemEnough({[ItemId.BoxKey] = costKey}) then return end |
557 | role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}}) | 563 | role:costItems({[ItemId.BoxKey] = costKey}, {log = {desc = "openTimeBox"}}) |
558 | end | 564 | end |
@@ -584,7 +590,7 @@ function _M.openTimeBoxRpc(agent, data) | @@ -584,7 +590,7 @@ function _M.openTimeBoxRpc(agent, data) | ||
584 | 590 | ||
585 | boxL[slot] = nil | 591 | boxL[slot] = nil |
586 | reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = boxId}}) | 592 | reward, change = role:award(reward, {log = {desc = "openTimeBox", int1 = boxId}}) |
587 | - role:checkTaskEnter("OpenBox", {id = boxId, count=1}) | 593 | + role:checkTaskEnter("OpenBox", {id = boxId, count=1, quality=itemData.quality}) |
588 | 594 | ||
589 | role:log("carriage_dismantle", { | 595 | role:log("carriage_dismantle", { |
590 | item_id = boxId, -- 道具id | 596 | item_id = boxId, -- 道具id |
@@ -687,8 +693,8 @@ function _M.storyBookRewardRpc(agent, data) | @@ -687,8 +693,8 @@ function _M.storyBookRewardRpc(agent, data) | ||
687 | role:log("carriage_video", { | 693 | role:log("carriage_video", { |
688 | carriage_video_type = storyBookData.type, --放映室类型,剧情CG:0, 角色CG:1, 主线剧情:2, 角色剧情:3, 活动剧情:4, 图鉴:5 | 694 | carriage_video_type = storyBookData.type, --放映室类型,剧情CG:0, 角色CG:1, 主线剧情:2, 角色剧情:3, 活动剧情:4, 图鉴:5 |
689 | carriage_video_id = storyId, --放映室片段ID | 695 | carriage_video_id = storyId, --放映室片段ID |
690 | - carriage_video_coinid = reward[ItemId.Gold] and ItemId.Gold or 0, --放映奖励货币类型,无奖励则填写0 | ||
691 | - carriage_video_coinnum = reward[ItemId.Gold] or 0, --放映奖励货币数量,无奖励则填写0 | 696 | + carriage_video_coinid = reward[ItemId.Diamond] and ItemId.Diamond or 0, --放映奖励货币类型,无奖励则填写0 |
697 | + carriage_video_coinnum = reward[ItemId.Diamond] or 0, --放映奖励货币数量,无奖励则填写0 | ||
692 | carriage_video_item = reward, --放映奖励其他物品数量,json格式记录,{'itemid1':10,'itemid2':5,…………..},无奖励则填写0 | 698 | carriage_video_item = reward, --放映奖励其他物品数量,json格式记录,{'itemid1':10,'itemid2':5,…………..},无奖励则填写0 |
693 | }) | 699 | }) |
694 | 700 | ||
@@ -1007,7 +1013,7 @@ function _M.changeSettingRpc(agent, data) | @@ -1007,7 +1013,7 @@ function _M.changeSettingRpc(agent, data) | ||
1007 | local setting = role:getProperty("setting") | 1013 | local setting = role:getProperty("setting") |
1008 | setting[id] = status | 1014 | setting[id] = status |
1009 | role:updateProperty({field = "setting", value = setting}) | 1015 | role:updateProperty({field = "setting", value = setting}) |
1010 | - | 1016 | + role:mylog("role_action", {desc = "changeSetting", int1 = id, int2 = status}) |
1011 | SendPacket(actionCodes.Role_changeSettingRpc, '') | 1017 | SendPacket(actionCodes.Role_changeSettingRpc, '') |
1012 | return true | 1018 | return true |
1013 | end | 1019 | end |
@@ -1045,6 +1051,7 @@ function _M.drawCodeRpc(agent, data) | @@ -1045,6 +1051,7 @@ function _M.drawCodeRpc(agent, data) | ||
1045 | gift_name = "", -- 礼包名称 | 1051 | gift_name = "", -- 礼包名称 |
1046 | gift_reason = 0, -- 礼包发放原因,见发放原因枚举表 | 1052 | gift_reason = 0, -- 礼包发放原因,见发放原因枚举表 |
1047 | }) | 1053 | }) |
1054 | + role:mylog("role_action", {desc = "drawCode", int1 = giftId, key1 = code}) | ||
1048 | SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ | 1055 | SendPacket(actionCodes.Role_drawCodeRpc, MsgPack.pack({ |
1049 | result = ret, | 1056 | result = ret, |
1050 | reward = reward, | 1057 | reward = reward, |
@@ -1119,6 +1126,7 @@ function _M.guideRpc(agent, data) | @@ -1119,6 +1126,7 @@ function _M.guideRpc(agent, data) | ||
1119 | if msg.funcType then | 1126 | if msg.funcType then |
1120 | funcGuide = funcGuide:setv(msg.funcType, 1) | 1127 | funcGuide = funcGuide:setv(msg.funcType, 1) |
1121 | role:log("onGuidePoint", {guild_type = 2, guild_id = msg.funcType, guild_point = 0, guild_pass = 0}) | 1128 | role:log("onGuidePoint", {guild_type = 2, guild_id = msg.funcType, guild_point = 0, guild_pass = 0}) |
1129 | + role:mylog("guide", {desc = "guide_weak", int1 = msg.funcType}) | ||
1122 | end | 1130 | end |
1123 | role:updateProperty({field = "funcGuide", value = funcGuide}) | 1131 | role:updateProperty({field = "funcGuide", value = funcGuide}) |
1124 | elseif cmdType == 3 then | 1132 | elseif cmdType == 3 then |
@@ -1128,6 +1136,7 @@ function _M.guideRpc(agent, data) | @@ -1128,6 +1136,7 @@ function _M.guideRpc(agent, data) | ||
1128 | funcGuide = funcGuide:setv(msg.funcType, 1) | 1136 | funcGuide = funcGuide:setv(msg.funcType, 1) |
1129 | role:updateProperty({field = "funcGuide", value = funcGuide}) | 1137 | role:updateProperty({field = "funcGuide", value = funcGuide}) |
1130 | role:log("onGuidePoint", {guild_type = 1, guild_id = msg.funcType, guild_point = 0, guild_pass = 0}) | 1138 | role:log("onGuidePoint", {guild_type = 1, guild_id = msg.funcType, guild_point = 0, guild_pass = 0}) |
1139 | + role:mylog("guide", {desc = "guide_sys", int1 = msg.funcType}) | ||
1131 | end | 1140 | end |
1132 | elseif cmdType == 4 then | 1141 | elseif cmdType == 4 then |
1133 | -- 弹出一个tips(进入功能界面也许要自动弹说明,value要区分1、2) | 1142 | -- 弹出一个tips(进入功能界面也许要自动弹说明,value要区分1、2) |
@@ -1135,6 +1144,7 @@ function _M.guideRpc(agent, data) | @@ -1135,6 +1144,7 @@ function _M.guideRpc(agent, data) | ||
1135 | local value = msg.value or 1 | 1144 | local value = msg.value or 1 |
1136 | for _, funcIdx in pairs(msg.funcType:toArray(true,"=")) do | 1145 | for _, funcIdx in pairs(msg.funcType:toArray(true,"=")) do |
1137 | role:log("onGuidePoint", {guild_type = 3, guild_id = funcIdx, guild_point = 0, guild_pass = 0}) | 1146 | role:log("onGuidePoint", {guild_type = 3, guild_id = funcIdx, guild_point = 0, guild_pass = 0}) |
1147 | + role:mylog("guide", {desc = "guide_tips", int1 = funcIdx}) | ||
1138 | funcGuide = funcGuide:setv(funcIdx, value) | 1148 | funcGuide = funcGuide:setv(funcIdx, value) |
1139 | end | 1149 | end |
1140 | role:updateProperty({field = "funcGuide", value = funcGuide}) | 1150 | role:updateProperty({field = "funcGuide", value = funcGuide}) |
src/adv/AdvPlayer.lua
@@ -332,7 +332,7 @@ end | @@ -332,7 +332,7 @@ end | ||
332 | --计算自己伤害减免后的值 | 332 | --计算自己伤害减免后的值 |
333 | function BaseObject:getInjuredValue(value) | 333 | function BaseObject:getInjuredValue(value) |
334 | local injuredChange = self:getInjuredChange() | 334 | local injuredChange = self:getInjuredChange() |
335 | - return math.max(0, (value - self.def + injuredChange[0]) * (1 + injuredChange[1])) | 335 | + return math.max(0, (value + injuredChange[0]) * (1 + injuredChange[1])) |
336 | end | 336 | end |
337 | 337 | ||
338 | --最终伤害 = [ (敌方攻击 - 己方防御) * (1+伤害增加百分比-伤害减少百分比)*(1+受伤增加百分比-受伤减少百分比)+(伤害增加固定值-伤害增加固定值+受伤增加固定值-受伤增加固定值)]*(1+侍宠百分比)-侍宠固定值 | 338 | --最终伤害 = [ (敌方攻击 - 己方防御) * (1+伤害增加百分比-伤害减少百分比)*(1+受伤增加百分比-受伤减少百分比)+(伤害增加固定值-伤害增加固定值+受伤增加固定值-受伤增加固定值)]*(1+侍宠百分比)-侍宠固定值 |
@@ -348,10 +348,11 @@ function BaseObject:hurt(value, releaser, params) | @@ -348,10 +348,11 @@ function BaseObject:hurt(value, releaser, params) | ||
348 | end | 348 | end |
349 | end | 349 | end |
350 | 350 | ||
351 | - if params.hurtType ~= 5 and params.hurtType ~= 6 then | ||
352 | - if not params.hurtType or params.hurtType ~= 4 then | ||
353 | - value = self:getInjuredValue(value) --减伤计算 | 351 | + if params.hurtType ~= 5 then |
352 | + if params.hurtType ~= 6 or params.hurtType ~= 4 then | ||
353 | + value = math.max(0, value - self.def) | ||
354 | end | 354 | end |
355 | + value = self:getInjuredValue(value) --减伤计算 | ||
355 | if value == 0 then return end | 356 | if value == 0 then return end |
356 | 357 | ||
357 | -- 舍身和恃宠 | 358 | -- 舍身和恃宠 |
src/models/Activity.lua
1 | local Activity = class("Activity", require("shared.ModelBase")) | 1 | local Activity = class("Activity", require("shared.ModelBase")) |
2 | local string_format = string.format | 2 | local string_format = string.format |
3 | 3 | ||
4 | +-- activity_ctr showType | ||
4 | Activity.ActivityType = { | 5 | Activity.ActivityType = { |
5 | - Sign = 1, -- 签到 | 6 | + SsrUpPoolChange = 1, -- 特定英雄活动,切卡池 |
6 | DoubleDrop = 2, -- 双倍掉落 | 7 | DoubleDrop = 2, -- 双倍掉落 |
7 | - FoodSell = 3, --贩卖周 料理 | ||
8 | - DrawHero = 4, --抽卡周 招募 | ||
9 | - AdvDraw = 5, --拾荒抽周 资助 | ||
10 | - OpenBox = 6, --拆解周 时钟箱 | ||
11 | - PaySignIn = 7, --付费签到 | ||
12 | - PayBack = 9, --返利 | ||
13 | - | ||
14 | - SsrUpPoolChange = 10, -- 特定英雄活动,切卡池 | 8 | + Sign = 4, -- 签到 |
9 | + ChangeCG = 5, -- 客户端使用,切换抽卡界面 | ||
10 | + PaySignIn = 6, --付费签到 | ||
11 | + ExploreCommand = 7, -- 探索指令 | ||
12 | + PayBack = 8, --返利 | ||
13 | + | ||
14 | + BonusDouble = 9, -- 奖励关卡翻倍 | ||
15 | + CalendaTask = 10, -- 日历任务 | ||
16 | + | ||
17 | + FoodSell = 11, --贩卖周 料理 | ||
18 | + DrawHero = 12, --抽卡周 招募 | ||
19 | + AdvDraw = 13, --拾荒抽周 资助 | ||
20 | + OpenBox = 14, --拆解周 时钟箱 | ||
15 | } | 21 | } |
16 | 22 | ||
17 | 23 | ||
@@ -33,26 +39,27 @@ end | @@ -33,26 +39,27 @@ end | ||
33 | Activity.schema = { | 39 | Activity.schema = { |
34 | actime = {"table", {}}, -- 最近检查某项活动的开始时间 {id = time} | 40 | actime = {"table", {}}, -- 最近检查某项活动的开始时间 {id = time} |
35 | round = {"table", {}}, -- 记录活动到了第几轮 {id = roundnum} | 41 | round = {"table", {}}, -- 记录活动到了第几轮 {id = roundnum} |
36 | - act1 = {"table", {}}, -- {0 = day, 1= -1, 2 = -1} == 签到活动 | ||
37 | - act3 = {"table", {}}, -- {0 = 抽卡次数, 1=1, 2=1} 抽卡周活动 1表示领取过该档位的奖励 | ||
38 | - act4 = {"table", {}}, -- {0 = 贩卖数量, 1=1, 2=1} 贩卖周活动 1表示领取过该档位的奖励 | ||
39 | - act5 = {"table", {}}, -- {0 = 拆解数量, 1=1, 2=1} 拆解周活动 1表示领取过该档位的奖励 | ||
40 | - act6 = {"table", {}}, -- {0 = 拾荒消耗远古金币数量, 1=1, 2=1} 拾荒周活动 1表示领取过该档位的奖励 | ||
41 | - act7 = {"table", {}}, -- {1 = 1, 2 = 1} == 付费签到活动 | ||
42 | - act9 = {"number", 0}, -- 充值返利 | 42 | + act4 = {"table", {}}, -- {0 = day, 1= -1, 2 = -1} == 签到活动 |
43 | + act6 = {"table", {}}, -- {1 = 1, 2 = 1} == 付费签到活动 | ||
44 | + act8 = {"number", 0}, -- 充值返利 | ||
45 | + | ||
46 | + act11 = {"table", {}}, -- {0 = 贩卖数量, 1=1, 2=1} 贩卖周活动 1表示领取过该档位的奖励 | ||
47 | + act12 = {"table", {}}, -- {0 = 抽卡次数, 1=1, 2=1} 抽卡周活动 1表示领取过该档位的奖励 | ||
48 | + act13 = {"table", {}}, -- {0 = 拾荒消耗远古金币数量, 1=1, 2=1} 拾荒周活动 1表示领取过该档位的奖励 | ||
49 | + act14 = {"table", {}}, -- {0 = 拆解数量, 1=1, 2=1} 拆解周活动 1表示领取过该档位的奖励 | ||
43 | } | 50 | } |
44 | 51 | ||
45 | function Activity:data() | 52 | function Activity:data() |
46 | return { | 53 | return { |
47 | actime = self:getProperty("actime"), | 54 | actime = self:getProperty("actime"), |
48 | round = self:getProperty("round"), | 55 | round = self:getProperty("round"), |
49 | - act1 = self:getProperty("act1"), | ||
50 | - act3 = self:getProperty("act3"), | ||
51 | act4 = self:getProperty("act4"), | 56 | act4 = self:getProperty("act4"), |
52 | - act5 = self:getProperty("act5"), | ||
53 | act6 = self:getProperty("act6"), | 57 | act6 = self:getProperty("act6"), |
54 | - act7 = self:getProperty("act7"), | ||
55 | - act9 = self:getProperty("act9"), | 58 | + act8 = self:getProperty("act8"), |
59 | + act11 = self:getProperty("act11"), | ||
60 | + act12 = self:getProperty("act12"), | ||
61 | + act13 = self:getProperty("act13"), | ||
62 | + act14 = self:getProperty("act14"), | ||
56 | } | 63 | } |
57 | end | 64 | end |
58 | 65 | ||
@@ -77,10 +84,9 @@ function Activity:updateProperty(params) | @@ -77,10 +84,9 @@ function Activity:updateProperty(params) | ||
77 | return false | 84 | return false |
78 | end | 85 | end |
79 | 86 | ||
80 | - | ||
81 | -function Activity:isOpenRaw(activityType, now) | ||
82 | - activityType = checkActivityType(activityType) | ||
83 | - local actData = csvdb["activity_ctrlCsv"][activityType] | 87 | +function Activity:isOpenRaw(activityId, now) |
88 | + activityId = checkActivityType(activityId) | ||
89 | + local actData = csvdb["activity_ctrlCsv"][activityId] | ||
84 | if not actData then return end | 90 | if not actData then return end |
85 | 91 | ||
86 | if actData.time == "" then -- 关闭 | 92 | if actData.time == "" then -- 关闭 |
@@ -89,7 +95,7 @@ function Activity:isOpenRaw(activityType, now) | @@ -89,7 +95,7 @@ function Activity:isOpenRaw(activityType, now) | ||
89 | 95 | ||
90 | local st = 0 | 96 | local st = 0 |
91 | local et = 0 | 97 | local et = 0 |
92 | - local now = skynet.timex() | 98 | + --local now = skynet.timex() |
93 | 99 | ||
94 | if actData.ttype == 0 then -- 时间开放 | 100 | if actData.ttype == 0 then -- 时间开放 |
95 | local openTimes = actData.time:toArray(false, "=") | 101 | local openTimes = actData.time:toArray(false, "=") |
@@ -118,7 +124,17 @@ end | @@ -118,7 +124,17 @@ end | ||
118 | -- 缓存开放 | 124 | -- 缓存开放 |
119 | function Activity:isOpen(activityType) | 125 | function Activity:isOpen(activityType) |
120 | activityType = checkActivityType(activityType) | 126 | activityType = checkActivityType(activityType) |
121 | - return self._isOpen[activityType] | 127 | + --return self._isOpen[activityType] |
128 | + local open = false | ||
129 | + for id, data in pairs(csvdb["activity_ctrlCsv"]) do | ||
130 | + if data.showType == activityType then | ||
131 | + open = self._isOpen[data.id] | ||
132 | + if open then | ||
133 | + return true, data.id | ||
134 | + end | ||
135 | + end | ||
136 | + end | ||
137 | + return false | ||
122 | end | 138 | end |
123 | 139 | ||
124 | function Activity:getActData(actType) | 140 | function Activity:getActData(actType) |
@@ -137,22 +153,22 @@ function Activity:checkActivityStatus(now, isCrossDay, notify) | @@ -137,22 +153,22 @@ function Activity:checkActivityStatus(now, isCrossDay, notify) | ||
137 | self._isOpen = {} | 153 | self._isOpen = {} |
138 | local actime = self:getProperty("actime") | 154 | local actime = self:getProperty("actime") |
139 | local change = false | 155 | local change = false |
140 | - for actType, actData in pairs(csvdb["activity_ctrlCsv"]) do | ||
141 | - local isOpen, startTime = self:isOpenRaw(actType, now) | ||
142 | - self._isOpen[actType] = isOpen | 156 | + for actId, actData in pairs(csvdb["activity_ctrlCsv"]) do |
157 | + local isOpen, startTime = self:isOpenRaw(actId, now) | ||
158 | + self._isOpen[actId] = isOpen | ||
143 | 159 | ||
144 | if isOpen then | 160 | if isOpen then |
145 | - if actime[actType] and actime[actType] == startTime then -- 还是之前的状态 开放中 | 161 | + if actime[actId] and actime[actId] == startTime then -- 还是之前的状态 开放中 |
146 | else -- 重置 | 162 | else -- 重置 |
147 | - actime[actType] = startTime | ||
148 | - self:closeActivity(actType, notify, true) | ||
149 | - self:initActivity(actType, isCrossDay, notify) | 163 | + actime[actId] = startTime |
164 | + self:closeActivity(actId, notify, true) | ||
165 | + self:initActivity(actId, isCrossDay, notify) | ||
150 | change = true | 166 | change = true |
151 | end | 167 | end |
152 | else | 168 | else |
153 | - if actime[actType] then | ||
154 | - self:closeActivity(actType, notify) | ||
155 | - actime[actType] = nil | 169 | + if actime[actId] then |
170 | + self:closeActivity(actId, notify) | ||
171 | + actime[actId] = nil | ||
156 | change = true | 172 | change = true |
157 | end | 173 | end |
158 | end | 174 | end |
@@ -345,13 +361,19 @@ activityFunc[Activity.ActivityType.PayBack] = { | @@ -345,13 +361,19 @@ activityFunc[Activity.ActivityType.PayBack] = { | ||
345 | -- end, | 361 | -- end, |
346 | } | 362 | } |
347 | 363 | ||
348 | -function Activity:initActivity(actType, isCrossDay, notify) | 364 | +function Activity:initActivity(actId, isCrossDay, notify) |
365 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
366 | + if not actData then return end | ||
367 | + local actType = actData.showType | ||
349 | if activityFunc[actType] and activityFunc[actType]['close'] then | 368 | if activityFunc[actType] and activityFunc[actType]['close'] then |
350 | activityFunc[actType]["init"](self, actType, isCrossDay, notify) | 369 | activityFunc[actType]["init"](self, actType, isCrossDay, notify) |
351 | end | 370 | end |
352 | end | 371 | end |
353 | 372 | ||
354 | -function Activity:closeActivity(actType, notify, notUpdateAct) | 373 | +function Activity:closeActivity(actId, notify, notUpdateAct) |
374 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
375 | + if not actData then return end | ||
376 | + local actType = actData.showType | ||
355 | if activityFunc[actType] and activityFunc[actType]['close'] then | 377 | if activityFunc[actType] and activityFunc[actType]['close'] then |
356 | activityFunc[actType]["close"](self, actType, notify) | 378 | activityFunc[actType]["close"](self, actType, notify) |
357 | end | 379 | end |
@@ -361,8 +383,10 @@ function Activity:closeActivity(actType, notify, notUpdateAct) | @@ -361,8 +383,10 @@ function Activity:closeActivity(actType, notify, notUpdateAct) | ||
361 | end | 383 | end |
362 | 384 | ||
363 | function Activity:refreshDailyData(notify) | 385 | function Activity:refreshDailyData(notify) |
364 | - for actType, status in pairs(self._isOpen) do | ||
365 | - if status then | 386 | + for actId, status in pairs(self._isOpen) do |
387 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
388 | + if status and actData then | ||
389 | + local actType = actData.showType | ||
366 | if activityFunc[actType] and activityFunc[actType]['crossDay'] then | 390 | if activityFunc[actType] and activityFunc[actType]['crossDay'] then |
367 | activityFunc[actType]["crossDay"](self, actType, notify) | 391 | activityFunc[actType]["crossDay"](self, actType, notify) |
368 | end | 392 | end |
@@ -398,10 +422,12 @@ end | @@ -398,10 +422,12 @@ end | ||
398 | 422 | ||
399 | -- 获取活动卡池id | 423 | -- 获取活动卡池id |
400 | function Activity:getActivityPool(mainType, subType) | 424 | function Activity:getActivityPool(mainType, subType) |
401 | - if not self:isOpen(Activity.ActivityType.SsrUpPoolChange) then | 425 | + local open, actId = self:isOpen(Activity.ActivityType.SsrUpPoolChange) |
426 | + if not open then | ||
427 | + --if not self:isOpen(Activity.ActivityType.SsrUpPoolChange) then | ||
402 | return 0 | 428 | return 0 |
403 | end | 429 | end |
404 | - local actData = csvdb["activity_ctrlCsv"][Activity.ActivityType.SsrUpPoolChange] | 430 | + local actData = csvdb["activity_ctrlCsv"][actId] |
405 | if not actData then return 0 end | 431 | if not actData then return 0 end |
406 | 432 | ||
407 | local poolMap = actData.condition2:toMap(true, "=") | 433 | local poolMap = actData.condition2:toMap(true, "=") |
src/models/Role.lua
@@ -386,7 +386,8 @@ function Role:data() | @@ -386,7 +386,8 @@ function Role:data() | ||
386 | chatline = self:getProperty("chatline"), | 386 | chatline = self:getProperty("chatline"), |
387 | 387 | ||
388 | downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励 | 388 | downCvR = self:getProperty("downCvR"), -- 下载cv扩展包奖励 |
389 | - feedback = self:getProperty("feedback") | 389 | + feedback = self:getProperty("feedback"), |
390 | + ctime = self:getProperty("ctime"), | ||
390 | } | 391 | } |
391 | end | 392 | end |
392 | 393 |
src/models/RolePlugin.lua
@@ -51,6 +51,7 @@ function RolePlugin.bind(Role) | @@ -51,6 +51,7 @@ function RolePlugin.bind(Role) | ||
51 | end | 51 | end |
52 | 52 | ||
53 | local function _award(self, itemId, count, params) | 53 | local function _award(self, itemId, count, params) |
54 | + local count = math.floor(count) | ||
54 | local pms = clone(params) | 55 | local pms = clone(params) |
55 | local itemData = csvdb["itemCsv"][itemId] | 56 | local itemData = csvdb["itemCsv"][itemId] |
56 | if not itemData then -- 加一层保护 | 57 | if not itemData then -- 加一层保护 |
@@ -259,6 +260,7 @@ function RolePlugin.bind(Role) | @@ -259,6 +260,7 @@ function RolePlugin.bind(Role) | ||
259 | 260 | ||
260 | function Role:addItem(params) | 261 | function Role:addItem(params) |
261 | params = params or {} | 262 | params = params or {} |
263 | + params.count = math.floor(params.count or 0) | ||
262 | if params.itemId == ItemId.Diamond then | 264 | if params.itemId == ItemId.Diamond then |
263 | self:gainDiamond(params) | 265 | self:gainDiamond(params) |
264 | return | 266 | return |
@@ -1536,7 +1538,7 @@ function RolePlugin.bind(Role) | @@ -1536,7 +1538,7 @@ function RolePlugin.bind(Role) | ||
1536 | item_number = 1, -- 购买的道具数量 | 1538 | item_number = 1, -- 购买的道具数量 |
1537 | item_level = 1, -- 购买的道具等级 | 1539 | item_level = 1, -- 购买的道具等级 |
1538 | order_cost = rechargeData.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' | 1540 | order_cost = rechargeData.rmb * 100, -- 此次消费的现金金额(单位:分),如 51800即未518元,对应客户端SDK传入的'total_fee' |
1539 | - order_currency = "TWD", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 | 1541 | + order_currency = "CNY", -- 货币类型,默认为"CNY"(人民币),遵循ISO 4217规范 |
1540 | order_type = order_type, -- 订单类型,首充记录为1,否则为0 | 1542 | order_type = order_type, -- 订单类型,首充记录为1,否则为0 |
1541 | order_id = params.transactionId, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' | 1543 | order_id = params.transactionId, -- 本条记录的订单号,对应客户端SDK返回的'bs_trade_no' |
1542 | }) | 1544 | }) |
src/models/RoleTask.lua
@@ -12,6 +12,9 @@ local TaskType = { | @@ -12,6 +12,9 @@ local TaskType = { | ||
12 | WakeCG = 7, -- 觉醒到解锁CG - heroType | 12 | WakeCG = 7, -- 觉醒到解锁CG - heroType |
13 | HeroTalent = 8, -- 天赋升级 - heroType alv | 13 | HeroTalent = 8, -- 天赋升级 - heroType alv |
14 | DrawSSR = 9, -- 抽到SSR - count | 14 | DrawSSR = 9, -- 抽到SSR - count |
15 | + HeroLvlCollect = 10, -- 英雄等级收集进度 | ||
16 | + HeroQualityCollect = 11, -- 英雄品质收集进度 | ||
17 | + HeroStarCollect = 12, -- 英雄星级收集进度 | ||
15 | 18 | ||
16 | --装备相关 | 19 | --装备相关 |
17 | AddEquip = 101, -- 获得装备 - equipId rarity | 20 | AddEquip = 101, -- 获得装备 - equipId rarity |
@@ -44,6 +47,7 @@ local TaskType = { | @@ -44,6 +47,7 @@ local TaskType = { | ||
44 | AdvStartSelf = 409, -- 手动冒险 - id | 47 | AdvStartSelf = 409, -- 手动冒险 - id |
45 | AdvScore = 410, -- 冒险分数 - score | 48 | AdvScore = 410, -- 冒险分数 - score |
46 | AdvDraw = 411, -- 冒险资助 - count ptype | 49 | AdvDraw = 411, -- 冒险资助 - count ptype |
50 | + AdvHang = 412, -- 代理拾荒次数 | ||
47 | 51 | ||
48 | --爬塔相关 | 52 | --爬塔相关 |
49 | TowerPass = 501, -- 爬塔通关 - level | 53 | TowerPass = 501, -- 爬塔通关 - level |
@@ -60,6 +64,7 @@ local TaskType = { | @@ -60,6 +64,7 @@ local TaskType = { | ||
60 | DinerPopular = 608, -- 人气值 - count | 64 | DinerPopular = 608, -- 人气值 - count |
61 | DinerLevelUp = 609, -- 餐厅升级 - level type | 65 | DinerLevelUp = 609, -- 餐厅升级 - level type |
62 | DinerTalentUp = 610, -- 天赋升级 - type level | 66 | DinerTalentUp = 610, -- 天赋升级 - type level |
67 | + VillageApply = 611, -- 餐厅委托个数 | ||
63 | 68 | ||
64 | -- 车厢相关 | 69 | -- 车厢相关 |
65 | PotionMake = 701, -- 营养剂制作 - id count | 70 | PotionMake = 701, -- 营养剂制作 - id count |
@@ -78,6 +83,7 @@ local TaskType = { | @@ -78,6 +83,7 @@ local TaskType = { | ||
78 | 83 | ||
79 | -- 角色相关 | 84 | -- 角色相关 |
80 | RoleLevelUp = 901, -- 角色升级 - curlevel | 85 | RoleLevelUp = 901, -- 角色升级 - curlevel |
86 | + RuneQualityCollect = 902, -- 铭文品质收集进度 | ||
81 | 87 | ||
82 | --功能未实现 todo | 88 | --功能未实现 todo |
83 | AdvShop = 1002, -- 冒险商城 | 89 | AdvShop = 1002, -- 冒险商城 |
@@ -230,6 +236,32 @@ local StoreListener = { | @@ -230,6 +236,32 @@ local StoreListener = { | ||
230 | } | 236 | } |
231 | } | 237 | } |
232 | 238 | ||
239 | +local CalendaTaskListener = { | ||
240 | + func = "checkCalendaTask", | ||
241 | + listen = { | ||
242 | + [TaskType.DrawHero] = {{1, 1, f("count")}}, | ||
243 | + [TaskType.BonusPass]= {{2, 1}}, | ||
244 | + [TaskType.AdvPass]= {{3, 1}}, | ||
245 | + [TaskType.DinerLevelUp]= {{4, 2, f("level")}}, | ||
246 | + [TaskType.HeroLvlCollect]= {{5, 3}}, -- x名y级英雄 | ||
247 | + [TaskType.AdvHang]= {{6, 1}}, ---- | ||
248 | + [TaskType.HeroQualityCollect]= {{7, 3}}, | ||
249 | + [TaskType.OverOderTask]= {{8, 1}}, | ||
250 | + [TaskType.VillageApply]= {{9, 1}}, | ||
251 | + [TaskType.PvpWin]= {{10, 2, f("score")}}, | ||
252 | + [TaskType.DinerPopular]= {{11, 2, f("count")}}, | ||
253 | + [TaskType.RoleLevelUp]= {{12, 2, f("level")}}, | ||
254 | + [TaskType.TowerPass]= {{13, 2, f("level")}}, | ||
255 | + [TaskType.HeroTalent]= {{14, 1}}, | ||
256 | + [TaskType.HangPass]= {{15, 2, f("id")}}, | ||
257 | + [TaskType.HeroStarCollect]= {{16, 3}}, | ||
258 | + [TaskType.FoodSell]= {{17, 1, f("count")}}, | ||
259 | + [TaskType.HangGet]= {{18, 3, f("reward")}}, | ||
260 | + [TaskType.RuneQualityCollect]= {{19, 3, f("id")}}, | ||
261 | + [TaskType.OpenBox]= {{20, 3, f("count"), f("quality")}}, | ||
262 | + } | ||
263 | +} | ||
264 | + | ||
233 | 265 | ||
234 | local TaskListeners = { | 266 | local TaskListeners = { |
235 | StoryListener, | 267 | StoryListener, |
@@ -552,6 +584,33 @@ function RoleTask.bind(Role) | @@ -552,6 +584,33 @@ function RoleTask.bind(Role) | ||
552 | self.storeData:OnTriggerLimitTimePack(triggerType, param) | 584 | self.storeData:OnTriggerLimitTimePack(triggerType, param) |
553 | end | 585 | end |
554 | 586 | ||
587 | + function Role:checkCalendaTask(notNotify, mainType, subType, param1, param2) | ||
588 | + local open, actId = self.activity:isOpen("CalendaTask") | ||
589 | + local actData = csvdb["activity_ctrlCsv"][actId] | ||
590 | + if not actData then return end | ||
591 | + if not open then return end | ||
592 | + | ||
593 | + local change = false | ||
594 | + local calTask = self:getProperty("calTask") or {} | ||
595 | + param1 = param1 or 1 | ||
596 | + | ||
597 | + local cid = actData.condition | ||
598 | + for k, taskList in pairs(csvdb["activity_taskCsv"]) do | ||
599 | + if k == cid then | ||
600 | + for id, cfg in pairs(taskList) do | ||
601 | + if cfg.type == mainType then | ||
602 | + if subType == 1 then -- 增加数值 | ||
603 | + calTask[id] = (calTask[id] or 0) + param1 | ||
604 | + elseif subType == 2 then -- 直接赋值 | ||
605 | + calTask[id] = param1 | ||
606 | + elseif subType == 3 then -- 自定义类型 | ||
607 | + end | ||
608 | + end | ||
609 | + end | ||
610 | + end | ||
611 | + end | ||
612 | + end | ||
613 | + | ||
555 | end | 614 | end |
556 | 615 | ||
557 | return RoleTask | 616 | return RoleTask |
558 | \ No newline at end of file | 617 | \ No newline at end of file |
src/utils/CommonFunc.lua
@@ -155,7 +155,7 @@ function diffFromOpen() | @@ -155,7 +155,7 @@ function diffFromOpen() | ||
155 | hour = RESET_TIME, | 155 | hour = RESET_TIME, |
156 | } | 156 | } |
157 | if now < openTime then | 157 | if now < openTime then |
158 | - return 0 | 158 | + return -1 |
159 | end | 159 | end |
160 | 160 | ||
161 | return math.floor((now - openTime) / DAY_SEC) | 161 | return math.floor((now - openTime) / DAY_SEC) |