Commit da3aa52f685a8e96371b88d0a70249806cb8ae09
Merge branch 'develop' into tr/qa
Showing
21 changed files
with
270 additions
and
69 deletions
Show diff stats
config/develop.lua
src/GlobalVar.lua
@@ -212,6 +212,7 @@ AdvBackEventType = { | @@ -212,6 +212,7 @@ AdvBackEventType = { | ||
212 | Artifact = 24, --获得神器 | 212 | Artifact = 24, --获得神器 |
213 | Level = 25, -- 升级 | 213 | Level = 25, -- 升级 |
214 | LinkChooseOver = 26, -- 连锁事件结束 | 214 | LinkChooseOver = 26, -- 连锁事件结束 |
215 | + BuffEffect = 27, -- buff 效果 | ||
215 | } | 216 | } |
216 | 217 | ||
217 | AdvScoreType = { | 218 | AdvScoreType = { |
src/actions/AdvAction.lua
@@ -439,6 +439,16 @@ function _M.finishTaskRpc(agent, data) | @@ -439,6 +439,16 @@ function _M.finishTaskRpc(agent, data) | ||
439 | role:checkTaskEnter("AdvOverTask", {id = taskId}) | 439 | role:checkTaskEnter("AdvOverTask", {id = taskId}) |
440 | 440 | ||
441 | adv:mylog({desc = "finishTask", int1 = taskId}) | 441 | adv:mylog({desc = "finishTask", int1 = taskId}) |
442 | + | ||
443 | + role:log("mission_pick_achiev", { | ||
444 | + mission_threadid = adv.chapterId, -- 大地图ID | ||
445 | + mission_threadname = (csvdb["adv_chapterCsv"][adv.chapterId] or {})["chapter"] or "auto", -- 大地图名称 | ||
446 | + mission_id = adv.level, -- 关卡ID | ||
447 | + mission_sequenceid = adv.logid, -- 本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
448 | + mission_pick_achiev_id = taskId, -- 任务ID | ||
449 | + mission_pick_achiev_reward = reward, -- 任务奖励,[{"id":101,"num":10},{"id":102,"num":20},{"id":103,"num":30}] | ||
450 | + }) | ||
451 | + | ||
442 | 452 | ||
443 | SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack(role:packReward(reward, change))) | 453 | SendPacket(actionCodes.Adv_finishTaskRpc, MsgPack.pack(role:packReward(reward, change))) |
444 | return true | 454 | return true |
@@ -501,6 +511,15 @@ function _M.useItemRpc(agent, data) | @@ -501,6 +511,15 @@ function _M.useItemRpc(agent, data) | ||
501 | adv:checkAchievement(adv.AchievType.UseItem, count, itemId) | 511 | adv:checkAchievement(adv.AchievType.UseItem, count, itemId) |
502 | adv:mylog({desc = "useItem", int1 = itemId, int2 = count}) | 512 | adv:mylog({desc = "useItem", int1 = itemId, int2 = count}) |
503 | 513 | ||
514 | + role:log("mission_pick_use", { | ||
515 | + mission_threadid = adv.chapterId, -- 大地图ID | ||
516 | + mission_threadname = (csvdb["adv_chapterCsv"][adv.chapterId] or {})["chapter"] or "auto", -- 大地图名称 | ||
517 | + mission_id = adv.level, -- 关卡ID | ||
518 | + item_id = itemId, -- 道具ID | ||
519 | + mission_pick_use_num = count, -- 道具使用量 | ||
520 | + mission_sequenceid = adv.logid, -- 本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
521 | + }) | ||
522 | + | ||
504 | for i = 1, count do | 523 | for i = 1, count do |
505 | adv:doActive(itemData.effect, target) -- target | 524 | adv:doActive(itemData.effect, target) -- target |
506 | end | 525 | end |
@@ -587,6 +606,7 @@ function _M.wearArtifactRpc(agent, data) | @@ -587,6 +606,7 @@ function _M.wearArtifactRpc(agent, data) | ||
587 | 606 | ||
588 | local status = adv:wearArtifact(slot, id) | 607 | local status = adv:wearArtifact(slot, id) |
589 | if not status then return 3 end | 608 | if not status then return 3 end |
609 | + | ||
590 | adv:saveDB() | 610 | adv:saveDB() |
591 | 611 | ||
592 | role:finishGuide(55) | 612 | role:finishGuide(55) |
@@ -612,7 +632,20 @@ function _M.upArtifactRpc(agent, data) | @@ -612,7 +632,20 @@ function _M.upArtifactRpc(agent, data) | ||
612 | if not adv:cost(cost, {}, true) then return 4 end | 632 | if not adv:cost(cost, {}, true) then return 4 end |
613 | 633 | ||
614 | local status = adv:artifactLevelUp(id) | 634 | local status = adv:artifactLevelUp(id) |
615 | - if not status then return 5 end | 635 | + if not status then |
636 | + return 5 | ||
637 | + else | ||
638 | + role:log("mission_pick_reform", { | ||
639 | + mission_threadid = adv.chapterId, -- 大地图ID | ||
640 | + mission_threadname = (csvdb["adv_chapterCsv"][adv.chapterId] or {})["chapter"] or "auto", -- 大地图名称 | ||
641 | + mission_id = adv.level, -- 关卡ID | ||
642 | + mission_pick_equip_id = id, -- 神器ID | ||
643 | + mission_pick_reform_beflv = curLevel, -- 神器原等级 | ||
644 | + mission_pick_reform_aftlv = curLevel + 1, -- 神器现等级 | ||
645 | + mission_pick_reform_cost = cost[ItemId.AdvPoint], -- 消耗探险点数 | ||
646 | + mission_sequenceid = adv.logid, -- 本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
647 | + }) | ||
648 | + end | ||
616 | adv:cost(cost, {log = {desc = "upArtifact", int1 = id}}) | 649 | adv:cost(cost, {log = {desc = "upArtifact", int1 = id}}) |
617 | adv:backCost(cost) | 650 | adv:backCost(cost) |
618 | if status == 1 then -- 现在穿着呢。更新下 | 651 | if status == 1 then -- 现在穿着呢。更新下 |
@@ -774,7 +807,7 @@ function _M.wheelSurfRpc(agent, data) | @@ -774,7 +807,7 @@ function _M.wheelSurfRpc(agent, data) | ||
774 | 807 | ||
775 | if not role:checkItemEnough(costs) then return 5 end | 808 | if not role:checkItemEnough(costs) then return 5 end |
776 | role:costItems(costs, {log = {desc = "advWheelSurf", int1 = ptype}}) | 809 | role:costItems(costs, {log = {desc = "advWheelSurf", int1 = ptype}}) |
777 | - role:addAdvLvExp(costs[ItemId.OldCoin] or 0) | 810 | + local oldLv, lv = role:addAdvLvExp(costs[ItemId.OldCoin] or 0) |
778 | local advDrawB = role:getProperty("advDrawB") | 811 | local advDrawB = role:getProperty("advDrawB") |
779 | advDrawB[ptype] = (advDrawB[ptype] or 0) + count | 812 | advDrawB[ptype] = (advDrawB[ptype] or 0) + count |
780 | role:updateProperty({field = "advDrawB", value = advDrawB}) | 813 | role:updateProperty({field = "advDrawB", value = advDrawB}) |
@@ -793,6 +826,16 @@ function _M.wheelSurfRpc(agent, data) | @@ -793,6 +826,16 @@ function _M.wheelSurfRpc(agent, data) | ||
793 | role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype}) | 826 | role:checkTaskEnter("AdvDraw", {count = count, ptype = ptype}) |
794 | role:mylog("adv_action", {desc = "advWheelSurf", int1 = ptype, int2 = count}) | 827 | role:mylog("adv_action", {desc = "advWheelSurf", int1 = ptype, int2 = count}) |
795 | 828 | ||
829 | + role:log("mission_pick_fund", { | ||
830 | + item_id = ItemId.OldCoin, -- 资助花费道具ID | ||
831 | + mission_pick_fund_amount = costs[ItemId.OldCoin], -- 资助花费道具数量 | ||
832 | + mission_pick_fund_cnt = count, -- 资助花费道具次数,1或者10 | ||
833 | + mission_pick_fund_reward = reward, -- 资助获得奖励,[{"id":100,"num":10},{"id":101,"num":20},{"id":102,"num":30}] | ||
834 | + mission_pick_fund_stagereward = {}, -- 资助阶段奖励 | ||
835 | + mission_pick_fund_beflv = oldLv, -- 资助前资助等级 | ||
836 | + mission_pick_fund_aftlv = lv, -- 资助后资助等级 | ||
837 | + }) | ||
838 | + | ||
796 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) | 839 | SendPacket(actionCodes.Adv_wheelSurfRpc, MsgPack.pack({reward = backReward})) |
797 | return true | 840 | return true |
798 | end | 841 | end |
src/actions/HangAction.lua
@@ -268,12 +268,12 @@ function _M.endBattleRpc(agent, data) | @@ -268,12 +268,12 @@ function _M.endBattleRpc(agent, data) | ||
268 | end | 268 | end |
269 | local nextCarbonId = role:getNextCarbonId(carbonId) | 269 | local nextCarbonId = role:getNextCarbonId(carbonId) |
270 | -- 设置挂机关卡 | 270 | -- 设置挂机关卡 |
271 | - if isWin and (hangInfo.carbonId or 0) < nextCarbonId then | ||
272 | - hangInfo.expCarbonId = nextCarbonId | ||
273 | - local cfg = csvdb["idle_battleCsv"][nextCarbonId] | ||
274 | - if cfg then | ||
275 | - hangInfo.bossTime = skynet.timex() + cfg.idle_time | ||
276 | - end | 271 | + if isWin then --and (hangInfo.carbonId or 0) < nextCarbonId then |
272 | + hangInfo.expCarbonId = carbonId | ||
273 | + --local cfg = csvdb["idle_battleCsv"][nextCarbonId] | ||
274 | + --if cfg then | ||
275 | + -- hangInfo.bossTime = skynet.timex() + cfg.idle_time | ||
276 | + --end | ||
277 | end | 277 | end |
278 | role:updateProperty({field = "hangInfo", value = hangInfo}) | 278 | role:updateProperty({field = "hangInfo", value = hangInfo}) |
279 | 279 |
src/actions/HeroAction.lua
@@ -738,7 +738,7 @@ function _M.drawHeroRpc(agent, data) | @@ -738,7 +738,7 @@ function _M.drawHeroRpc(agent, data) | ||
738 | 738 | ||
739 | if btype == 1 then | 739 | if btype == 1 then |
740 | -- 判断定向卡池活动开启 | 740 | -- 判断定向卡池活动开启 |
741 | - if not role.activity:isOpen("RaceDraw") then | 741 | + if not role.activity:isOpen("SsrUpPoolChange") then |
742 | return | 742 | return |
743 | end | 743 | end |
744 | end | 744 | end |
@@ -946,7 +946,28 @@ function _M.drawHeroRpc(agent, data) | @@ -946,7 +946,28 @@ function _M.drawHeroRpc(agent, data) | ||
946 | local drawCardReward, val = role:getDrawCardExtraReward(oldVal, newVal) | 946 | local drawCardReward, val = role:getDrawCardExtraReward(oldVal, newVal) |
947 | -- 空字符穿代表直接给英雄 走以前repayHeroRpc | 947 | -- 空字符穿代表直接给英雄 走以前repayHeroRpc |
948 | if drawCardReward == "" then | 948 | if drawCardReward == "" then |
949 | - local id = math.randWeight(csvdb["build_giftCsv"], "pool_1") | 949 | + local repayHeroMaxCount = role:getProperty("repayMaxC") or 0 |
950 | + repayHeroMaxCount = repayHeroMaxCount + 1 | ||
951 | + | ||
952 | + role:updateProperty({field = "repayMaxC", value = repayHeroMaxCount}) | ||
953 | + local even = repayHeroMaxCount % 2 | ||
954 | + local id = 0 | ||
955 | + if even == 1 then | ||
956 | + id = math.randWeight(csvdb["build_giftCsv"], "pool_1") | ||
957 | + else | ||
958 | + local giftHeroSet = {} | ||
959 | + for gid, cfg in pairs(csvdb["build_giftCsv"]) do | ||
960 | + if cfg["pool_1"] ~= 0 and not role:isHaveHero(gid - ItemStartId.Hero) then | ||
961 | + giftHeroSet[gid] = {1} | ||
962 | + end | ||
963 | + end | ||
964 | + if next(giftHeroSet) then | ||
965 | + id = math.randWeight(giftHeroSet, 1) | ||
966 | + end | ||
967 | + end | ||
968 | + if id == 0 then | ||
969 | + id = math.randWeight(csvdb["build_giftCsv"], "pool_1") | ||
970 | + end | ||
950 | 971 | ||
951 | local r,change = {} | 972 | local r,change = {} |
952 | local itemData = csvdb["itemCsv"][id] | 973 | local itemData = csvdb["itemCsv"][id] |
src/actions/RoleAction.lua
@@ -681,17 +681,18 @@ function _M.storyBookRewardRpc(agent, data) | @@ -681,17 +681,18 @@ function _M.storyBookRewardRpc(agent, data) | ||
681 | local msg = MsgPack.unpack(data) | 681 | local msg = MsgPack.unpack(data) |
682 | local storyId = msg.id | 682 | local storyId = msg.id |
683 | local storyBookData = csvdb["story_bookCsv"][storyId] | 683 | local storyBookData = csvdb["story_bookCsv"][storyId] |
684 | - if not storyBookData then return end | 684 | + if not storyBookData then return 1 end |
685 | local storyStatus = role:getProperty("storyB") | 685 | local storyStatus = role:getProperty("storyB") |
686 | 686 | ||
687 | local status = (storyStatus[storyId] or {}).s | 687 | local status = (storyStatus[storyId] or {}).s |
688 | 688 | ||
689 | - if status == -1 then return end | 689 | + if status == -1 then return 2 end |
690 | 690 | ||
691 | if not status or status ~= 1 then | 691 | if not status or status ~= 1 then |
692 | - if storyBookData.unlockType == 1 and (role:getProperty("hangInfo").carbonId == tonumber(storyBookData.unlockData) or storyId == 1 or storyId == 2) then -- 挂机剧情正在挂机也可以领奖 | 692 | + --if storyBookData.unlockType == 1 and (role:getProperty("hangInfo").carbonId == tonumber(storyBookData.unlockData) or storyId == 1 or storyId == 2) then -- 挂机剧情正在挂机也可以领奖 |
693 | + if storyBookData.unlockType == 1 then -- 挂机剧情正在挂机也可以领奖 | ||
693 | else | 694 | else |
694 | - return | 695 | + return 3 |
695 | end | 696 | end |
696 | end | 697 | end |
697 | -- 获取奖励 | 698 | -- 获取奖励 |
src/adv/Adv.lua
@@ -51,6 +51,7 @@ function Adv:initByInfo(advInfo) | @@ -51,6 +51,7 @@ function Adv:initByInfo(advInfo) | ||
51 | self.cacheUnlock = advInfo.cacheUnlock or {} | 51 | self.cacheUnlock = advInfo.cacheUnlock or {} |
52 | self.shopStatus = advInfo.shopStatus or {} | 52 | self.shopStatus = advInfo.shopStatus or {} |
53 | self.support = advInfo.support or {} | 53 | self.support = advInfo.support or {} |
54 | + self.logid = advInfo.logid or "auto" | ||
54 | 55 | ||
55 | self.maps = {} | 56 | self.maps = {} |
56 | for id, map in ipairs(advInfo.maps or {}) do | 57 | for id, map in ipairs(advInfo.maps or {}) do |
@@ -102,6 +103,7 @@ function Adv:initByChapter(params) | @@ -102,6 +103,7 @@ function Adv:initByChapter(params) | ||
102 | self.shopStatus = self.shopStatus or {} | 103 | self.shopStatus = self.shopStatus or {} |
103 | self.support = self.support or {} | 104 | self.support = self.support or {} |
104 | self.battle = nil -- 清掉 老的 battle | 105 | self.battle = nil -- 清掉 老的 battle |
106 | + self.logid = self.owner:getActionUcode() | ||
105 | 107 | ||
106 | if isEnter then -- 把 支援效果初始化为易用用的形式 | 108 | if isEnter then -- 把 支援效果初始化为易用用的形式 |
107 | self:initSupport(support or {}) | 109 | self:initSupport(support or {}) |
@@ -206,6 +208,7 @@ function Adv:saveDB(notNotify) | @@ -206,6 +208,7 @@ function Adv:saveDB(notNotify) | ||
206 | advInfo.cacheUnlock = self.cacheUnlock | 208 | advInfo.cacheUnlock = self.cacheUnlock |
207 | advInfo.shopStatus = self.shopStatus | 209 | advInfo.shopStatus = self.shopStatus |
208 | advInfo.support = self.support | 210 | advInfo.support = self.support |
211 | + advInfo.logid = self.logid | ||
209 | advInfo.maps = {} | 212 | advInfo.maps = {} |
210 | 213 | ||
211 | self.battle:saveDB() | 214 | self.battle:saveDB() |
@@ -610,6 +613,15 @@ function Adv:wearArtifact(slot, id) | @@ -610,6 +613,15 @@ function Adv:wearArtifact(slot, id) | ||
610 | id = nil | 613 | id = nil |
611 | end | 614 | end |
612 | self:mylog({desc = "wearArtifact", int1 = id}) | 615 | self:mylog({desc = "wearArtifact", int1 = id}) |
616 | + self.owner:log("mission_pick_equip", { | ||
617 | + mission_threadid = self.chapterId, -- 大地图ID | ||
618 | + mission_threadname = (csvdb["adv_chapterCsv"][self.chapterId] or {})["chapter"] or "auto", -- 大地图名称 | ||
619 | + mission_id = self.level, -- 关卡ID | ||
620 | + mission_pick_equip_type = 1, --神器操作类型:1:装备,2:卸下 | ||
621 | + mission_pick_equip_id = id, --神器ID | ||
622 | + mission_pick_equip_lv = advAFGet[id], --神器等级 | ||
623 | + mission_sequenceid = self.logid, -- 本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
624 | + }) | ||
613 | 625 | ||
614 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) | 626 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) |
615 | return true | 627 | return true |
@@ -670,7 +682,6 @@ function Adv:artifactLevelUp(id, level) | @@ -670,7 +682,6 @@ function Adv:artifactLevelUp(id, level) | ||
670 | 682 | ||
671 | self:mylog({desc = "artifactLevelUp", int1 = id, int2 = level}) | 683 | self:mylog({desc = "artifactLevelUp", int1 = id, int2 = level}) |
672 | 684 | ||
673 | - | ||
674 | local status = 0 | 685 | local status = 0 |
675 | if curWear[id] then -- 穿着呢 | 686 | if curWear[id] then -- 穿着呢 |
676 | local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] | 687 | local oldData = csvdb["adv_artifactCsv"][id][advAFGet[id]] |
@@ -815,6 +826,49 @@ function Adv:over(success, rewardRatio, overType) | @@ -815,6 +826,49 @@ function Adv:over(success, rewardRatio, overType) | ||
815 | 826 | ||
816 | self:mylog({desc = "over", short1 = success and 1 or 0, int1 = overType}) | 827 | self:mylog({desc = "over", short1 = success and 1 or 0, int1 = overType}) |
817 | 828 | ||
829 | + | ||
830 | + local team = self.owner:getProperty("advTeam") | ||
831 | + local player = {} | ||
832 | + local attrs = self.owner:getTeamBattleInfo(team).heros | ||
833 | + for attrName, _ in pairs(AdvAttsEnum) do | ||
834 | + for _, hero in pairs(attrs) do | ||
835 | + player[attrName] = (player[attrName] or 0) + hero[attrName] | ||
836 | + end | ||
837 | + player[attrName] = player[attrName] * (globalCsv.adv_battle_attr_ratio[attrName] or 1) | ||
838 | + end | ||
839 | + | ||
840 | + local battleV = 1 * player["hp"] | ||
841 | + + 2 * player["atk"] | ||
842 | + + 1.25 * player["def"] | ||
843 | + + 0.226 * player["hit"] | ||
844 | + + 0.26 * player["miss"] | ||
845 | + | ||
846 | + local heroList = {team.leader, team.leader2} | ||
847 | + for _, hid in pairs(team.heros) do | ||
848 | + if hid ~= team.leader and hid ~= team.leader2 then | ||
849 | + heroList[#heroList + 1] = hid | ||
850 | + end | ||
851 | + end | ||
852 | + | ||
853 | + self.owner:log("mission_pick", { | ||
854 | + mission_threadid = self.chapterId, -- 大地图ID | ||
855 | + mission_threadname = (csvdb["adv_chapterCsv"][self.chapterId] or {})["chapter"] or "auto", -- 大地图名称 | ||
856 | + mission_id = self.level, -- 关卡ID | ||
857 | + mission_herolist = heroList, -- 英雄ID列表,[111, 222, 333, 444, 555] 前两个为队长、副队长 | ||
858 | + mission_heroscore = battleV, -- 编队总评分 | ||
859 | + mission_teamlv = 0, -- 编队等级 | ||
860 | + mission_recscore = csvdb["adv_chapter_campsiteCsv"][self.chapterId][1].recommendValue, -- 关卡推荐评分 | ||
861 | + mission_floor_bef = 0, -- 进入前关卡层数 | ||
862 | + mission_floor_aft = self.level, -- 结束时关卡层数 | ||
863 | + mission_team_status = {HP = team.player.hp, SP = team.player.sp}, -- 队伍状态,{"HP":100, "SP":100, "curse":7} | ||
864 | + mission_result = success and 1 or (team.player.hp > 0 and 3 or 2), -- 战斗结果(0-无效,1-胜利,2-血量耗尽退出,3,主动退出) | ||
865 | + mission_reward = reward, -- 获得奖励,[{"id":101,"num":10},{"id":102,"num":20},{"id":103,"num":30}] | ||
866 | + mission_integral_bef = 0, -- 进入前积分 | ||
867 | + mission_integral_aft = score, -- 完成后积分 | ||
868 | + mission_cleartype = 1, -- 1正常通关;2代理拾荒 | ||
869 | + mission_sequenceid = self.logid, -- 本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
870 | + }) | ||
871 | + | ||
818 | local chapterId = self.chapterId | 872 | local chapterId = self.chapterId |
819 | self:clear() | 873 | self:clear() |
820 | self.owner:checkTaskEnter("AdvScore", {score = score}) | 874 | self.owner:checkTaskEnter("AdvScore", {score = score}) |
src/adv/AdvBattle.lua
@@ -76,6 +76,7 @@ function Battle:initPlayer() | @@ -76,6 +76,7 @@ function Battle:initPlayer() | ||
76 | end | 76 | end |
77 | player.exp = 0 | 77 | player.exp = 0 |
78 | player.sp = getAdvLvAttrUp(advAddAttrs, "sp", 100) | 78 | player.sp = getAdvLvAttrUp(advAddAttrs, "sp", 100) |
79 | + player.spMax = player.sp | ||
79 | player.growth = {} | 80 | player.growth = {} |
80 | player.passives = {} | 81 | player.passives = {} |
81 | 82 |
src/adv/AdvBuff.lua
@@ -576,6 +576,9 @@ end | @@ -576,6 +576,9 @@ end | ||
576 | 576 | ||
577 | function Buff:effect() | 577 | function Buff:effect() |
578 | self:decCount() | 578 | self:decCount() |
579 | + if self.buffData.show:sismember(2, " ") then | ||
580 | + self.owner.battle.adv:pushBackEvent(AdvBackEventType.BuffEffect, {etype = 2}) | ||
581 | + end | ||
579 | if self._effectValue then | 582 | if self._effectValue then |
580 | return self:_effectValue() | 583 | return self:_effectValue() |
581 | end | 584 | end |
src/adv/AdvPassive.lua
@@ -120,7 +120,7 @@ Passive.GET_BUFF = 28 --获得指定buff | @@ -120,7 +120,7 @@ Passive.GET_BUFF = 28 --获得指定buff | ||
120 | Passive.OPEN_BLOCK = 29 --翻开格子 | 120 | Passive.OPEN_BLOCK = 29 --翻开格子 |
121 | Passive.OPEN_MONSTER = 30 --翻开怪物 | 121 | Passive.OPEN_MONSTER = 30 --翻开怪物 |
122 | Passive.PLAYER_BUFF = 31 --玩家获得buff | 122 | Passive.PLAYER_BUFF = 31 --玩家获得buff |
123 | - | 123 | +Passive.PLAYER_BUFF_CLASSIFY = 35 -- 获得指定标签的buff |
124 | 124 | ||
125 | -- 不同的开启条件 | 125 | -- 不同的开启条件 |
126 | local PassiveCondFactory = {} | 126 | local PassiveCondFactory = {} |
@@ -183,6 +183,14 @@ PassiveCondFactory[Passive.GET_BUFF] = function(_Passive) | @@ -183,6 +183,14 @@ PassiveCondFactory[Passive.GET_BUFF] = function(_Passive) | ||
183 | end | 183 | end |
184 | PassiveCondFactory[Passive.PLAYER_BUFF] = PassiveCondFactory[Passive.GET_BUFF] | 184 | PassiveCondFactory[Passive.PLAYER_BUFF] = PassiveCondFactory[Passive.GET_BUFF] |
185 | 185 | ||
186 | +PassiveCondFactory[Passive.PLAYER_BUFF_CLASSIFY] = function(_Passive) | ||
187 | + _Passive._trigger = function(self, params) | ||
188 | + if params.classify:sismember(self.passiveData.value) then | ||
189 | + return true | ||
190 | + end | ||
191 | + end | ||
192 | +end | ||
193 | + | ||
186 | 194 | ||
187 | PassiveCondFactory[Passive.BORN_ONCE] = function(_Passive) | 195 | PassiveCondFactory[Passive.BORN_ONCE] = function(_Passive) |
188 | _Passive._afterRound = function(self) | 196 | _Passive._afterRound = function(self) |
src/adv/AdvPlayer.lua
@@ -163,7 +163,8 @@ function BaseObject:addBuff(buffId, releaser) | @@ -163,7 +163,8 @@ function BaseObject:addBuff(buffId, releaser) | ||
163 | table.insert(self.buffs, buff) | 163 | table.insert(self.buffs, buff) |
164 | buff:createAfter() | 164 | buff:createAfter() |
165 | end | 165 | end |
166 | - self:triggerPassive(Passive.GET_BUFF, {buffId = buffId}) | 166 | + self:triggerPassive(Passive.GET_BUFF, {trigger = releaser, buffId = buffId}) |
167 | + self:triggerPassive(Passive.PLAYER_BUFF_CLASSIFY, {trigger = releaser, classify = buffData.classify}) | ||
167 | return true | 168 | return true |
168 | end | 169 | end |
169 | 170 | ||
@@ -699,6 +700,10 @@ function Player:addBuff(buffId, releaser) | @@ -699,6 +700,10 @@ function Player:addBuff(buffId, releaser) | ||
699 | self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId) | 700 | self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId) |
700 | self.battle.adv:pushBackEvent(AdvBackEventType.Buff, {buffId = buffId}) | 701 | self.battle.adv:pushBackEvent(AdvBackEventType.Buff, {buffId = buffId}) |
701 | self.battle:triggerPassive(Passive.PLAYER_BUFF, {buffId = buffId}) | 702 | self.battle:triggerPassive(Passive.PLAYER_BUFF, {buffId = buffId}) |
703 | + local buffData = csvdb["adv_map_buffCsv"][buffId] | ||
704 | + if buffData and buffData.show:sismember(1, " ") then | ||
705 | + self.battle.adv:pushBackEvent(AdvBackEventType.BuffEffect, {etype = 1}) | ||
706 | + end | ||
702 | end | 707 | end |
703 | return status | 708 | return status |
704 | end | 709 | end |
src/models/Activity.lua
@@ -18,7 +18,7 @@ Activity.ActivityType = { | @@ -18,7 +18,7 @@ Activity.ActivityType = { | ||
18 | DrawHero = 12, --抽卡周 招募 | 18 | DrawHero = 12, --抽卡周 招募 |
19 | AdvDraw = 13, --拾荒抽周 资助 | 19 | AdvDraw = 13, --拾荒抽周 资助 |
20 | OpenBox = 14, --拆解周 时钟箱 | 20 | OpenBox = 14, --拆解周 时钟箱 |
21 | - RaceDraw = 15, -- 定向招募活动 | 21 | + --RaceDraw = 15, -- 定向招募活动 |
22 | } | 22 | } |
23 | 23 | ||
24 | 24 |
src/models/Role.lua
@@ -162,6 +162,7 @@ Role.schema = { | @@ -162,6 +162,7 @@ Role.schema = { | ||
162 | emailSync = {"number", 0}, -- 已经同步到的邮件Id | 162 | emailSync = {"number", 0}, -- 已经同步到的邮件Id |
163 | 163 | ||
164 | repayHero = {"number", 0}, -- 招募次数 (除去友情招募) | 164 | repayHero = {"number", 0}, -- 招募次数 (除去友情招募) |
165 | + repayMaxC = {"number", 0}, -- 招募保底英雄领取次数 100一次 | ||
165 | floorHero = {"table", {}}, -- 招募保底 -- {[poolId] = count} | 166 | floorHero = {"table", {}}, -- 招募保底 -- {[poolId] = count} |
166 | ssrUp = {"table", {}}, -- ssr up -- {[poolId] = count} | 167 | ssrUp = {"table", {}}, -- ssr up -- {[poolId] = count} |
167 | newerDraw = {"table", {}}, -- 新手池子 {N, 1} 抽了多少次, 是否出了ssr | 168 | newerDraw = {"table", {}}, -- 新手池子 {N, 1} 抽了多少次, 是否出了ssr |
src/models/RoleLog.lua
@@ -422,6 +422,79 @@ local MethodType = { | @@ -422,6 +422,79 @@ local MethodType = { | ||
422 | gift_name = true, -- 礼包名称 | 422 | gift_name = true, -- 礼包名称 |
423 | gift_reason = true, -- 礼包发放原因,见发放原因枚举表 | 423 | gift_reason = true, -- 礼包发放原因,见发放原因枚举表 |
424 | }, | 424 | }, |
425 | + | ||
426 | + push_gift = { -- 礼包推送 | ||
427 | + gift_id = true, --礼包ID | ||
428 | + gift_name = true, --礼包名称 | ||
429 | + }, | ||
430 | + | ||
431 | + mission_pick = { --拾荒玩法 | ||
432 | + mission_threadid = true, -- 大地图ID | ||
433 | + mission_threadname = true, -- 大地图名称 | ||
434 | + mission_id = true, -- 关卡ID | ||
435 | + mission_herolist = "json", -- 英雄ID列表,[111, 222, 333, 444, 555] 前两个为队长、副队长 | ||
436 | + mission_heroscore = true, -- 编队总评分 | ||
437 | + mission_teamlv = true, -- 编队等级 | ||
438 | + mission_recscore = true, -- 关卡推荐评分 | ||
439 | + mission_floor_bef = true, -- 进入前关卡层数 | ||
440 | + mission_floor_aft = true, -- 结束时关卡层数 | ||
441 | + mission_team_status = "json", -- 队伍状态,{"HP":100, "SP":100, "curse":7} | ||
442 | + mission_result = true, -- 战斗结果(0-无效,1-胜利,2-血量耗尽退出,3,主动退出) | ||
443 | + mission_reward = "json", -- 获得奖励,[{"id":101,"num":10},{"id":102,"num":20},{"id":103,"num":30}] | ||
444 | + mission_integral_bef = true, -- 进入前积分 | ||
445 | + mission_integral_aft = true, -- 完成后积分 | ||
446 | + mission_cleartype = true, -- 1正常通关;2代理拾荒 | ||
447 | + mission_sequenceid = true, -- 本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
448 | + }, | ||
449 | + | ||
450 | + mission_pick_achiev = { --拾荒任务 | ||
451 | + mission_threadid = true, -- 大地图ID | ||
452 | + mission_threadname = true, -- 大地图名称 | ||
453 | + mission_id = true, -- 关卡ID | ||
454 | + mission_pick_achiev_id = true, -- 任务ID | ||
455 | + mission_pick_achiev_reward = "json", -- 任务奖励,[{"id":101,"num":10},{"id":102,"num":20},{"id":103,"num":30}] | ||
456 | + mission_sequenceid = true, -- 本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
457 | + }, | ||
458 | + | ||
459 | + mission_pick_equip = { -- 拾荒神器装备 | ||
460 | + mission_threadid = true, --大地图ID | ||
461 | + mission_threadname = true, --大地图名称 | ||
462 | + mission_id = true, --关卡ID | ||
463 | + mission_pick_equip_type = true, --神器操作类型:1:装备,2:卸下 | ||
464 | + mission_pick_equip_id = true, --神器ID | ||
465 | + mission_pick_equip_lv = true, --神器等级 | ||
466 | + mission_sequenceid = true, --本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
467 | + }, | ||
468 | + | ||
469 | + mission_pick_reform = { --拾荒神器升级 | ||
470 | + mission_threadid = true, -- 大地图ID | ||
471 | + mission_threadname = true, -- 大地图名称 | ||
472 | + mission_id = true, -- 关卡ID | ||
473 | + mission_pick_equip_id = true, -- 神器ID | ||
474 | + mission_pick_reform_beflv = true, -- 神器原等级 | ||
475 | + mission_pick_reform_aftlv = true, -- 神器现等级 | ||
476 | + mission_pick_reform_cost = true, -- 消耗探险点数 | ||
477 | + mission_sequenceid = true, -- 本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
478 | + }, | ||
479 | + | ||
480 | + mission_pick_use = { --拾荒任务道具使用 | ||
481 | + mission_threadid = true, -- 大地图ID | ||
482 | + mission_threadname = true, -- 大地图名称 | ||
483 | + mission_id = true, -- 关卡ID | ||
484 | + item_id = true, -- 道具ID | ||
485 | + mission_pick_use_num = true, -- 道具使用量 | ||
486 | + mission_sequenceid = true, -- 本次拾荒ID,用于关联一次拾荒产生多条不同类型的日志 | ||
487 | + }, | ||
488 | + | ||
489 | + mission_pick_fund = { --拾荒资助 | ||
490 | + item_id = true, -- 资助花费道具ID | ||
491 | + mission_pick_fund_amount = true, -- 资助花费道具数量 | ||
492 | + mission_pick_fund_cnt = true, -- 资助花费道具次数,1或者10 | ||
493 | + mission_pick_fund_reward = "json", -- 资助获得奖励,[{"id":100,"num":10},{"id":101,"num":20},{"id":102,"num":30}] | ||
494 | + mission_pick_fund_stagereward = "json", -- 资助阶段奖励 | ||
495 | + mission_pick_fund_beflv = true, -- 资助前资助等级 | ||
496 | + mission_pick_fund_aftlv = true, -- 资助后资助等级 | ||
497 | + }, | ||
425 | } | 498 | } |
426 | 499 | ||
427 | local function printError(info) | 500 | local function printError(info) |
src/models/RolePlugin.lua
@@ -1189,6 +1189,7 @@ function RolePlugin.bind(Role) | @@ -1189,6 +1189,7 @@ function RolePlugin.bind(Role) | ||
1189 | function Role:addAdvLvExp(exp) | 1189 | function Role:addAdvLvExp(exp) |
1190 | local advL = self:getProperty("advL") | 1190 | local advL = self:getProperty("advL") |
1191 | local level = advL[1] | 1191 | local level = advL[1] |
1192 | + local oldLevel = level | ||
1192 | local newExp = (advL[2] or 0) + exp | 1193 | local newExp = (advL[2] or 0) + exp |
1193 | 1194 | ||
1194 | if not csvdb["adv_level_fundCsv"][level + 1] then | 1195 | if not csvdb["adv_level_fundCsv"][level + 1] then |
@@ -1211,6 +1212,7 @@ function RolePlugin.bind(Role) | @@ -1211,6 +1212,7 @@ function RolePlugin.bind(Role) | ||
1211 | advL[1] = level | 1212 | advL[1] = level |
1212 | advL[2] = newExp | 1213 | advL[2] = newExp |
1213 | self:updateProperty({field = "advL", value = advL}) | 1214 | self:updateProperty({field = "advL", value = advL}) |
1215 | + return oldLevel, level | ||
1214 | end | 1216 | end |
1215 | 1217 | ||
1216 | function Role:getAdvWheelSurfLv(ptype) | 1218 | function Role:getAdvWheelSurfLv(ptype) |
src/models/Store.lua
@@ -353,6 +353,10 @@ function Store:OnTriggerLimitTimePack(eventType, param) | @@ -353,6 +353,10 @@ function Store:OnTriggerLimitTimePack(eventType, param) | ||
353 | local rechargeCfg = csvdb["shop_rechargeCsv"][config.packId] | 353 | local rechargeCfg = csvdb["shop_rechargeCsv"][config.packId] |
354 | if rechargeCfg then | 354 | if rechargeCfg then |
355 | limitPack[rechargeCfg.id] = {timeNow + rechargeCfg.time, config.id} | 355 | limitPack[rechargeCfg.id] = {timeNow + rechargeCfg.time, config.id} |
356 | + self.owner:log("push_gift", { | ||
357 | + gift_id = rechargeCfg.id, --礼包ID | ||
358 | + gift_name = rechargeCfg.title, --礼包名称 | ||
359 | + }) | ||
356 | self:updateProperty({field = "limitTPack", value = limitPack}) | 360 | self:updateProperty({field = "limitTPack", value = limitPack}) |
357 | end | 361 | end |
358 | end | 362 | end |
src/services/agent_ctrl.lua
@@ -5,6 +5,7 @@ local netpack = require "skynet.netpack" | @@ -5,6 +5,7 @@ local netpack = require "skynet.netpack" | ||
5 | local xxtea = require "xxtea" | 5 | local xxtea = require "xxtea" |
6 | local deque = require "deque" | 6 | local deque = require "deque" |
7 | local datacenter = require "skynet.datacenter" | 7 | local datacenter = require "skynet.datacenter" |
8 | +local agent_queued = require "services.agent_queued" | ||
8 | 9 | ||
9 | local pcall = pcall | 10 | local pcall = pcall |
10 | local string_format = string.format | 11 | local string_format = string.format |
@@ -59,16 +60,14 @@ function _M:exit_agent(fd) | @@ -59,16 +60,14 @@ function _M:exit_agent(fd) | ||
59 | 60 | ||
60 | pcall(skynet.send, agent, "lua", "exit") | 61 | pcall(skynet.send, agent, "lua", "exit") |
61 | 62 | ||
62 | - -- 这里检查是否有排队用户 | ||
63 | - local nuid, nfd = skynet.call(queued_serv, "lua", "pop") | 63 | + self.f2u[fd] = nil |
64 | + self.u2f[uid] = nil | ||
65 | + local nuid, nfd = agent_queued.pop() | ||
64 | if not nuid then | 66 | if not nuid then |
65 | pcall(skynet.send, poold, "lua", "feed") | 67 | pcall(skynet.send, poold, "lua", "feed") |
66 | else | 68 | else |
67 | self:query_agent(nfd, nuid, true) | 69 | self:query_agent(nfd, nuid, true) |
68 | end | 70 | end |
69 | - | ||
70 | - self.f2u[fd] = nil | ||
71 | - self.u2f[uid] = nil | ||
72 | end | 71 | end |
73 | 72 | ||
74 | -- @desc: 客户端连入 | 73 | -- @desc: 客户端连入 |
@@ -82,7 +81,7 @@ function _M:socket_close(fd) | @@ -82,7 +81,7 @@ function _M:socket_close(fd) | ||
82 | local uid = self.f2u[fd] | 81 | local uid = self.f2u[fd] |
83 | if not uid then | 82 | if not uid then |
84 | -- 排队中? | 83 | -- 排队中? |
85 | - pcall(skynet.call, queued_serv, "lua", "socket_close", fd) | 84 | + agent_queued.socket_close(fd) |
86 | return | 85 | return |
87 | end | 86 | end |
88 | self.f2e[fd] = skynet.timex() + AGENT_EXPIRE_TIME | 87 | self.f2e[fd] = skynet.timex() + AGENT_EXPIRE_TIME |
@@ -102,7 +101,7 @@ function _M:socket_error(fd) | @@ -102,7 +101,7 @@ function _M:socket_error(fd) | ||
102 | local uid = self.f2u[fd] | 101 | local uid = self.f2u[fd] |
103 | if not uid then | 102 | if not uid then |
104 | -- 排队中? | 103 | -- 排队中? |
105 | - pcall(skynet.call, queued_serv, "lua", "socket_close", fd) | 104 | + agent_queued.socket_close(fd) |
106 | return | 105 | return |
107 | end | 106 | end |
108 | 107 | ||
@@ -129,6 +128,7 @@ local next_log_time = 0 | @@ -129,6 +128,7 @@ local next_log_time = 0 | ||
129 | local CHECK_AGENT_STATUS_INTERVAL = 100 -- 检查agent状态的定时间隔 | 128 | local CHECK_AGENT_STATUS_INTERVAL = 100 -- 检查agent状态的定时间隔 |
130 | -- @desc: 检查agent状态,若过期,则让agent退出;并定时打日志统计在线人数 | 129 | -- @desc: 检查agent状态,若过期,则让agent退出;并定时打日志统计在线人数 |
131 | function _M:check_agent_status() | 130 | function _M:check_agent_status() |
131 | + agent_queued.handle_timeout() | ||
132 | local now = skynet.timex() | 132 | local now = skynet.timex() |
133 | if now >= next_check_time then | 133 | if now >= next_check_time then |
134 | next_check_time = now + CHECK_AGENT_STATUS_INTERVAL | 134 | next_check_time = now + CHECK_AGENT_STATUS_INTERVAL |
@@ -196,16 +196,26 @@ function _M:query_agent(fd, uid, isQueue) | @@ -196,16 +196,26 @@ function _M:query_agent(fd, uid, isQueue) | ||
196 | self.f2u[f] = nil | 196 | self.f2u[f] = nil |
197 | self.u2f[uid] = set_pack(fd, agent) | 197 | self.u2f[uid] = set_pack(fd, agent) |
198 | else | 198 | else |
199 | - -- 该uid未存储,则说明至少超过10分钟未登陆,由agent池服务pop出一个agent | ||
200 | - local agent | 199 | + local agent |
201 | if isQueue then | 200 | if isQueue then |
202 | - agent = skynet.newservice("agent") | 201 | + agent = self.factory:pop() |
202 | + if agent then | ||
203 | + pcall(skynet.send, poold, "lua", "feed") | ||
204 | + else | ||
205 | + agent = skynet.newservice("agent") | ||
206 | + end | ||
203 | else | 207 | else |
208 | + -- 该uid未存储,则说明至少超过10分钟未登陆,由agent池服务pop出一个agent | ||
209 | + if agent_queued.count() > 0 then | ||
210 | + -- 服务器满 开始排队 | ||
211 | + local rank = agent_queued.push(uid, fd) | ||
212 | + query_agent_response(fd, {ret = "RET_SERVER_FULL", rank = rank}) | ||
213 | + return | ||
214 | + end | ||
215 | + | ||
204 | agent = self.factory:pop() | 216 | agent = self.factory:pop() |
205 | if not agent then | 217 | if not agent then |
206 | - -- 服务器满 | ||
207 | - -- 开始排队 | ||
208 | - local ok, rank = pcall(skynet.call, queued_serv, "lua", "push", uid, fd) | 218 | + local rank = agent_queued.push(uid, fd) |
209 | query_agent_response(fd, {ret = "RET_SERVER_FULL", rank = rank}) | 219 | query_agent_response(fd, {ret = "RET_SERVER_FULL", rank = rank}) |
210 | return | 220 | return |
211 | end | 221 | end |
src/services/queued.lua renamed to src/services/agent_queued.lua
@@ -18,7 +18,6 @@ local MAX_COUNT = tonumber(skynet.getenv("max_queue")) | @@ -18,7 +18,6 @@ local MAX_COUNT = tonumber(skynet.getenv("max_queue")) | ||
18 | -- 心跳定时间隔 | 18 | -- 心跳定时间隔 |
19 | local HEART_TIMER_INTERVAL = 30 | 19 | local HEART_TIMER_INTERVAL = 30 |
20 | local HEART_TIMEOUT_COUNT_MAX = 3 | 20 | local HEART_TIMEOUT_COUNT_MAX = 3 |
21 | -local gate_serv | ||
22 | 21 | ||
23 | local CMD = {} | 22 | local CMD = {} |
24 | local f2u = {} | 23 | local f2u = {} |
@@ -28,7 +27,6 @@ local curIdx = 0 -- 下一个即将进入游戏的玩家索引 | @@ -28,7 +27,6 @@ local curIdx = 0 -- 下一个即将进入游戏的玩家索引 | ||
28 | local nextIdx = 0 -- 新加的位置 | 27 | local nextIdx = 0 -- 新加的位置 |
29 | 28 | ||
30 | 29 | ||
31 | - | ||
32 | local function getRank(uid) | 30 | local function getRank(uid) |
33 | local info = u2i[uid] | 31 | local info = u2i[uid] |
34 | if not info then return -1 end | 32 | if not info then return -1 end |
@@ -63,18 +61,12 @@ skynet.register_protocol { | @@ -63,18 +61,12 @@ skynet.register_protocol { | ||
63 | end, | 61 | end, |
64 | dispatch = function(session, address, cmd, data) | 62 | dispatch = function(session, address, cmd, data) |
65 | skynet.ignoreret() | 63 | skynet.ignoreret() |
66 | - cs(function() | ||
67 | - if cmd == actionCodes.Sys_checkQueue then | ||
68 | - checkQueue(session) | ||
69 | - end | ||
70 | - end) | 64 | + if cmd == actionCodes.Sys_checkQueue then |
65 | + checkQueue(session) | ||
66 | + end | ||
71 | end | 67 | end |
72 | } | 68 | } |
73 | 69 | ||
74 | -function CMD.open(serv) | ||
75 | - gate_serv = serv | ||
76 | -end | ||
77 | - | ||
78 | function CMD.push(uid, fd) | 70 | function CMD.push(uid, fd) |
79 | uid = tostring(uid) | 71 | uid = tostring(uid) |
80 | if u2i[uid] then -- 存在] | 72 | if u2i[uid] then -- 存在] |
@@ -129,6 +121,7 @@ function CMD.pop() | @@ -129,6 +121,7 @@ function CMD.pop() | ||
129 | end | 121 | end |
130 | end | 122 | end |
131 | 123 | ||
124 | + | ||
132 | -- 下线了 | 125 | -- 下线了 |
133 | function CMD.socket_close(fd) | 126 | function CMD.socket_close(fd) |
134 | local uid = f2u[fd] | 127 | local uid = f2u[fd] |
@@ -138,8 +131,7 @@ function CMD.socket_close(fd) | @@ -138,8 +131,7 @@ function CMD.socket_close(fd) | ||
138 | info[2] = nil | 131 | info[2] = nil |
139 | end | 132 | end |
140 | 133 | ||
141 | - | ||
142 | -local function handle_timeout() | 134 | +function CMD.handle_timeout() |
143 | local now = skynet.timex() | 135 | local now = skynet.timex() |
144 | for uid, info in pairs(u2i) do | 136 | for uid, info in pairs(u2i) do |
145 | if info[2] and info[3] and now >= info[3][3] then --存在fd 检查心跳 | 137 | if info[2] and info[3] and now >= info[3][3] then --存在fd 检查心跳 |
@@ -153,26 +145,10 @@ local function handle_timeout() | @@ -153,26 +145,10 @@ local function handle_timeout() | ||
153 | end | 145 | end |
154 | end | 146 | end |
155 | end | 147 | end |
156 | - skynet.timeout(100, handle_timeout) | ||
157 | end | 148 | end |
158 | 149 | ||
150 | +function CMD.count() | ||
151 | + return (nextIdx + MAX_COUNT - curIdx) % MAX_COUNT | ||
152 | +end | ||
159 | 153 | ||
160 | -skynet.start(function() | ||
161 | - skynet.dispatch("lua", function(session, source, command, ...) | ||
162 | - -- skynet.trace() --执行序的跟踪统计 | ||
163 | - local f = CMD[command] | ||
164 | - if f then | ||
165 | - skynet.ret(skynet.pack(f(...))) | ||
166 | - end | ||
167 | - end) | ||
168 | - | ||
169 | - skynet.info_func(function() | ||
170 | - local info = {} | ||
171 | - info.count = (nextIdx + MAX_COUNT - curIdx) % MAX_COUNT | ||
172 | - return info | ||
173 | - end) | ||
174 | - | ||
175 | - cs = queue() | ||
176 | - | ||
177 | - skynet.timeout(100, handle_timeout) | ||
178 | -end) | ||
179 | \ No newline at end of file | 154 | \ No newline at end of file |
155 | +return CMD |
src/services/poold.lua
@@ -7,7 +7,7 @@ local deque = require "deque" | @@ -7,7 +7,7 @@ local deque = require "deque" | ||
7 | local CMD = {} | 7 | local CMD = {} |
8 | local factory | 8 | local factory |
9 | 9 | ||
10 | -local PRE_FEED_COUNT = 1 | 10 | +local PRE_FEED_COUNT = 5 |
11 | local dead = 0 | 11 | local dead = 0 |
12 | -- agent死亡,通知poold补充,当累计到5个agent时,马上生成5个agent放入poold中 | 12 | -- agent死亡,通知poold补充,当累计到5个agent时,马上生成5个agent放入poold中 |
13 | -- 当然这里也可以写得更复杂,参考redis落地规则 | 13 | -- 当然这里也可以写得更复杂,参考redis落地规则 |
src/services/watchdog.lua
@@ -66,7 +66,6 @@ end | @@ -66,7 +66,6 @@ end | ||
66 | function CMD.start(conf) | 66 | function CMD.start(conf) |
67 | skynet.call(gate_serv, "lua", "open" , conf) | 67 | skynet.call(gate_serv, "lua", "open" , conf) |
68 | skynet.call(redisd, "lua", "open", conf) | 68 | skynet.call(redisd, "lua", "open", conf) |
69 | - skynet.call(queued_serv, "lua", "open", gate_serv) | ||
70 | 69 | ||
71 | if use_logd == 1 then | 70 | if use_logd == 1 then |
72 | skynet.call(logd, "lua", "open") | 71 | skynet.call(logd, "lua", "open") |
@@ -138,5 +137,4 @@ skynet.start(function() | @@ -138,5 +137,4 @@ skynet.start(function() | ||
138 | skynet.newservice("services/chated") | 137 | skynet.newservice("services/chated") |
139 | -- 网关服务 | 138 | -- 网关服务 |
140 | gate_serv = skynet.newservice("gate") | 139 | gate_serv = skynet.newservice("gate") |
141 | - queued_serv = skynet.newservice("services/queued") | ||
142 | end) | 140 | end) |