Commit c3c1b7e04ebd858e462ad78709839bc18c384997
fix confict
Showing
8 changed files
with
83 additions
and
12 deletions
Show diff stats
src/ProtocolCode.lua
@@ -232,7 +232,8 @@ actionCodes = { | @@ -232,7 +232,8 @@ actionCodes = { | ||
232 | Activity_commonSignRpc = 666, | 232 | Activity_commonSignRpc = 666, |
233 | Activity_friendHelpRpc = 667, | 233 | Activity_friendHelpRpc = 667, |
234 | Activity_battleCommandRpc = 668, | 234 | Activity_battleCommandRpc = 668, |
235 | - Activity_actCalendaTmpTaskRpc = 659, | 235 | + Activity_actCalendaTmpTaskRpc = 669, |
236 | + Activity_newSignRpc = 670, | ||
236 | 237 | ||
237 | Radio_startQuestRpc = 700, | 238 | Radio_startQuestRpc = 700, |
238 | Radio_finishQuestRpc = 701, | 239 | Radio_finishQuestRpc = 701, |
@@ -250,4 +251,4 @@ for key, value in pairs(actionCodes) do | @@ -250,4 +251,4 @@ for key, value in pairs(actionCodes) do | ||
250 | actionHandlers[value + rpcResponseBegin] = handlerName .. "Response" | 251 | actionHandlers[value + rpcResponseBegin] = handlerName .. "Response" |
251 | end | 252 | end |
252 | actionHandlers[value] = string.gsub(key, "_", ".") | 253 | actionHandlers[value] = string.gsub(key, "_", ".") |
253 | -end | ||
254 | \ No newline at end of file | 254 | \ No newline at end of file |
255 | +end |
src/actions/ActivityAction.lua
@@ -583,7 +583,7 @@ function _M.startBattleRpc(agent, data) | @@ -583,7 +583,7 @@ function _M.startBattleRpc(agent, data) | ||
583 | bi["bossP"] = (bi["bossP"] or 0) + bi["maxP"] * count | 583 | bi["bossP"] = (bi["bossP"] or 0) + bi["maxP"] * count |
584 | end | 584 | end |
585 | 585 | ||
586 | - bi["sum"] = bi["sum"] + bi["top"] | 586 | + bi["sum"] = bi["sum"] + bi["top"] * count |
587 | actData["ticket"] = ticket - num | 587 | actData["ticket"] = ticket - num |
588 | actData[id] = bi | 588 | actData[id] = bi |
589 | changeFlag = true | 589 | changeFlag = true |
@@ -1237,4 +1237,34 @@ function _M.buyBattleCommandLvlRpc(agent, data) | @@ -1237,4 +1237,34 @@ function _M.buyBattleCommandLvlRpc(agent, data) | ||
1237 | return true | 1237 | return true |
1238 | end | 1238 | end |
1239 | 1239 | ||
1240 | -return _M | ||
1241 | \ No newline at end of file | 1240 | \ No newline at end of file |
1241 | +function _M.newSignRpc(agent, data) | ||
1242 | + local role = agent.role | ||
1243 | + local msg = MsgPack.unpack(data) | ||
1244 | + local actid = msg.actid | ||
1245 | + local index = msg.index | ||
1246 | + | ||
1247 | + if not role.activity:isOpenById(actid, "NewSign") then return 1 end | ||
1248 | + | ||
1249 | + local actData = role.activity:getActData("NewSign") | ||
1250 | + if (actData[0] or 0) < index then | ||
1251 | + return 2 | ||
1252 | + end | ||
1253 | + if (actData[index] or 0) == 1 then | ||
1254 | + return 3 | ||
1255 | + end | ||
1256 | + | ||
1257 | + local actCfg = csvdb["activity_signInCsv"][actid] | ||
1258 | + if not actCfg then return 4 end | ||
1259 | + actCfg = actCfg[index] | ||
1260 | + if not actCfg then return 5 end | ||
1261 | + | ||
1262 | + actData[index] = 1 | ||
1263 | + role.activity:updateActData("NewSign", actData) | ||
1264 | + | ||
1265 | + local award = actCfg.reward:toNumMap() | ||
1266 | + local reward, change = role:award(award, {log = {desc = "newSign", int1 = actid, int2 = index}}) | ||
1267 | + SendPacket(actionCodes.Activity_newSignRpc, MsgPack.pack(role:packReward(reward, change))) | ||
1268 | + return true | ||
1269 | +end | ||
1270 | + | ||
1271 | +return _M |
src/actions/CarAction.lua
@@ -124,8 +124,8 @@ function _M.runeUpRpc( agent, data ) | @@ -124,8 +124,8 @@ function _M.runeUpRpc( agent, data ) | ||
124 | local runeData = runeSet[id] | 124 | local runeData = runeSet[id] |
125 | if not runeData then return 5 end | 125 | if not runeData then return 5 end |
126 | 126 | ||
127 | - local maxLv = #csvdb["rune_buildCsv"] | ||
128 | - if level >= maxLv then return 6 end | 127 | + --local maxLv = #csvdb["rune_buildCsv"] |
128 | + if level >= runeData.lvLimit then return 6 end | ||
129 | local lvData = csvdb["rune_buildCsv"][level] | 129 | local lvData = csvdb["rune_buildCsv"][level] |
130 | local cost = lvData.cost:toNumMap() | 130 | local cost = lvData.cost:toNumMap() |
131 | if not role:checkItemEnough(cost) then | 131 | if not role:checkItemEnough(cost) then |
src/actions/HeroAction.lua
@@ -617,7 +617,7 @@ function _M.getResetRewardRpc(agent, data) | @@ -617,7 +617,7 @@ function _M.getResetRewardRpc(agent, data) | ||
617 | if level <= 1 and talent == "" then return end | 617 | if level <= 1 and talent == "" then return end |
618 | 618 | ||
619 | local pay = true | 619 | local pay = true |
620 | - if level <= 60 then | 620 | + if level <= 60 or role.activity:isOpen("HeroBackFree") then |
621 | pay = false | 621 | pay = false |
622 | end | 622 | end |
623 | 623 | ||
@@ -853,6 +853,10 @@ function _M.drawHeroRpc(agent, data) | @@ -853,6 +853,10 @@ function _M.drawHeroRpc(agent, data) | ||
853 | elseif values[1] == HeroQuality.SSR then | 853 | elseif values[1] == HeroQuality.SSR then |
854 | weight = unitPool["up_ssr_weight"] | 854 | weight = unitPool["up_ssr_weight"] |
855 | up_pool = unitPool["up_ssr_id"] | 855 | up_pool = unitPool["up_ssr_id"] |
856 | + if btype == 5 then | ||
857 | + local wishPool = role:getProperty("wishPool") or {} | ||
858 | + weight = weight * #wishPool | ||
859 | + end | ||
856 | end | 860 | end |
857 | --print(poolId, rand_v, weight, up_pool, values[1]) | 861 | --print(poolId, rand_v, weight, up_pool, values[1]) |
858 | if rand_v < weight and up_pool then | 862 | if rand_v < weight and up_pool then |
@@ -879,6 +883,15 @@ function _M.drawHeroRpc(agent, data) | @@ -879,6 +883,15 @@ function _M.drawHeroRpc(agent, data) | ||
879 | if heroData[field] ~= values[idx] then ok = false break end | 883 | if heroData[field] ~= values[idx] then ok = false break end |
880 | end | 884 | end |
881 | end | 885 | end |
886 | + -- 随机剔除up池中的角色 | ||
887 | + if up_pool then | ||
888 | + for k, v in ipairs(up_pool) do | ||
889 | + if v == itemData.id then | ||
890 | + ok = false | ||
891 | + break | ||
892 | + end | ||
893 | + end | ||
894 | + end | ||
882 | if not ok then break end | 895 | if not ok then break end |
883 | if oneData[pool_str] > 0 then | 896 | if oneData[pool_str] > 0 then |
884 | resultPool[itemId] = {oneData[pool_str]} -- itemId, count, 概率 | 897 | resultPool[itemId] = {oneData[pool_str]} -- itemId, count, 概率 |
src/models/Activity.lua
@@ -35,6 +35,8 @@ Activity.ActivityType = { | @@ -35,6 +35,8 @@ Activity.ActivityType = { | ||
35 | FriendEnergy = 30, -- 好友互赠能量活动 | 35 | FriendEnergy = 30, -- 好友互赠能量活动 |
36 | AdvLevel = 33, -- 拾荒关卡 | 36 | AdvLevel = 33, -- 拾荒关卡 |
37 | BattleCommand = 34, -- 战令活动 | 37 | BattleCommand = 34, -- 战令活动 |
38 | + NewSign = 36, -- 活动签到,单独的签到界面 | ||
39 | + HeroBackFree = 37, -- 无损耗归还 | ||
38 | 40 | ||
39 | CalendaTaskTmp = 38, -- 新春任务活动 | 41 | CalendaTaskTmp = 38, -- 新春任务活动 |
40 | } | 42 | } |
@@ -85,6 +87,7 @@ Activity.schema = { | @@ -85,6 +87,7 @@ Activity.schema = { | ||
85 | act30 = {"table", {}}, -- {magic = 0, limit = 0, reward = {id = 1, id = 1}, giveAE = {}, getAE = {}} 奖励字段1表示领取过奖励 | 87 | act30 = {"table", {}}, -- {magic = 0, limit = 0, reward = {id = 1, id = 1}, giveAE = {}, getAE = {}} 奖励字段1表示领取过奖励 |
86 | 88 | ||
87 | act34 = {"table", {}}, -- 战令记录{unlock = 1, freeR = "", payR = "", lvl = 10, sum = 100} | 89 | act34 = {"table", {}}, -- 战令记录{unlock = 1, freeR = "", payR = "", lvl = 10, sum = 100} |
90 | + act36 = {"table", {}}, -- 每日活跃签到 {0=day, 1=1,2=1,3=1} | ||
88 | } | 91 | } |
89 | 92 | ||
90 | function Activity:data() | 93 | function Activity:data() |
@@ -110,6 +113,7 @@ function Activity:data() | @@ -110,6 +113,7 @@ function Activity:data() | ||
110 | act30 = self:getProperty("act30"), | 113 | act30 = self:getProperty("act30"), |
111 | 114 | ||
112 | act34 = self:getProperty("act34"), | 115 | act34 = self:getProperty("act34"), |
116 | + act36 = self:getProperty("act36"), | ||
113 | } | 117 | } |
114 | end | 118 | end |
115 | 119 | ||
@@ -1001,4 +1005,25 @@ activityFunc[Activity.ActivityType.BattleCommand] = { | @@ -1001,4 +1005,25 @@ activityFunc[Activity.ActivityType.BattleCommand] = { | ||
1001 | } | 1005 | } |
1002 | 1006 | ||
1003 | 1007 | ||
1008 | +activityFunc[Activity.ActivityType.NewSign] = { | ||
1009 | + -- ["check"] = function(self, actType, notify) -- 检查 | ||
1010 | + -- end, | ||
1011 | + ["init"] = function(self, actType, isCrossDay, notify) | ||
1012 | + if not isCrossDay then | ||
1013 | + activityFunc[Activity.ActivityType.NewSign]["crossDay"](self, actType, notify) | ||
1014 | + end | ||
1015 | + end, | ||
1016 | + -- ["close"] = function(self, actType, notify) | ||
1017 | + -- end, | ||
1018 | + ["crossDay"] = function(self, actType, notify) | ||
1019 | + local curData = self:getActData(actType) | ||
1020 | + curData[0] = (curData[0] or 0) + 1 | ||
1021 | + local actData = csvdb["activity_signInCsv"][48] or {} | ||
1022 | + if curData[0] > #actData then return end -- 满了就忽略了 | ||
1023 | + | ||
1024 | + -- 没满更新一下 | ||
1025 | + self:updateActData(actType, curData, not notify) | ||
1026 | + end, | ||
1027 | +} | ||
1028 | + | ||
1004 | return Activity | 1029 | return Activity |
src/models/RoleLog.lua
@@ -55,6 +55,7 @@ local ItemReason = { | @@ -55,6 +55,7 @@ local ItemReason = { | ||
55 | actFriendHelp = 139,-- 好友能量互助活动 | 55 | actFriendHelp = 139,-- 好友能量互助活动 |
56 | actBattleCommand = 140, -- 活动战令 | 56 | actBattleCommand = 140, -- 活动战令 |
57 | actBuyBpLevel = 141, -- 购买活动战令等级 | 57 | actBuyBpLevel = 141, -- 购买活动战令等级 |
58 | + newSign = 142,-- 新的活动签到 | ||
58 | 59 | ||
59 | 60 | ||
60 | advHang = 301, -- 拾荒挂机 | 61 | advHang = 301, -- 拾荒挂机 |
@@ -126,6 +127,7 @@ local ItemReason = { | @@ -126,6 +127,7 @@ local ItemReason = { | ||
126 | 127 | ||
127 | -- pvp | 128 | -- pvp |
128 | pvpCHead = 1301, -- pvp 跨服竞技场头像 | 129 | pvpCHead = 1301, -- pvp 跨服竞技场头像 |
130 | + crossPvpBet = 1302, -- 竞猜 | ||
129 | 131 | ||
130 | --adv | 132 | --adv |
131 | chooseEvent = 1351, -- 冒险选择 | 133 | chooseEvent = 1351, -- 冒险选择 |
@@ -879,4 +881,4 @@ function RoleLog.bind(Role) | @@ -879,4 +881,4 @@ function RoleLog.bind(Role) | ||
879 | 881 | ||
880 | 882 | ||
881 | end | 883 | end |
882 | -return RoleLog | ||
883 | \ No newline at end of file | 884 | \ No newline at end of file |
885 | +return RoleLog |
src/models/RolePvp.lua
@@ -521,7 +521,7 @@ function Role:changeCrossServerPvpSelfInfo(cType) | @@ -521,7 +521,7 @@ function Role:changeCrossServerPvpSelfInfo(cType) | ||
521 | change[cType] = self:getProperty(cType) | 521 | change[cType] = self:getProperty(cType) |
522 | elseif cType == "format" then | 522 | elseif cType == "format" then |
523 | -- 是否过了时间 | 523 | -- 是否过了时间 |
524 | - local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) | 524 | + local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) + RESET_TIME * 3600 |
525 | local aday = 3600 * 24 | 525 | local aday = 3600 * 24 |
526 | local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 | 526 | local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 |
527 | local ctime = crossTime % aday -- 当前在本天 经过多少时间 | 527 | local ctime = crossTime % aday -- 当前在本天 经过多少时间 |
@@ -615,7 +615,7 @@ end | @@ -615,7 +615,7 @@ end | ||
615 | 615 | ||
616 | function Role:setCrossServerPvpBet(idx) | 616 | function Role:setCrossServerPvpBet(idx) |
617 | if not self:isTimeResetOpen(TimeReset.PvpCross) then return false , 1 end | 617 | if not self:isTimeResetOpen(TimeReset.PvpCross) then return false , 1 end |
618 | - local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) | 618 | + local crossTime = skynet.timex() - self:getTimeResetStartTime(TimeReset.PvpCross) + RESET_TIME * 3600 |
619 | local aday = 3600 * 24 | 619 | local aday = 3600 * 24 |
620 | local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 | 620 | local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 |
621 | local ctime = crossTime % aday -- 当前在本天 经过多少时间 | 621 | local ctime = crossTime % aday -- 当前在本天 经过多少时间 |
src/services/pvpd.lua
@@ -84,7 +84,7 @@ function CMD.updateRoleInfo(change) | @@ -84,7 +84,7 @@ function CMD.updateRoleInfo(change) | ||
84 | CMD.refreshRoleInfo(change) | 84 | CMD.refreshRoleInfo(change) |
85 | local pvpd = cluster.query("center", "pvpd") | 85 | local pvpd = cluster.query("center", "pvpd") |
86 | if pvpd then | 86 | if pvpd then |
87 | - pcall(cluster.call, "center", pvpd, "updateRoleInfo", change) | 87 | + pcall(cluster.send, "center", pvpd, "updateRoleInfo", change) |
88 | end | 88 | end |
89 | end | 89 | end |
90 | 90 | ||
@@ -92,7 +92,7 @@ local function getDayAndTime() | @@ -92,7 +92,7 @@ local function getDayAndTime() | ||
92 | local startTime = getStartTime() | 92 | local startTime = getStartTime() |
93 | local now = skynet.timex() | 93 | local now = skynet.timex() |
94 | 94 | ||
95 | - local crossTime = now - startTime | 95 | + local crossTime = now - startTime + RESET_TIME * 3600 |
96 | local aday = 3600 * 24 | 96 | local aday = 3600 * 24 |
97 | local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 | 97 | local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 |
98 | local ctime = crossTime % aday -- 当前在本天 经过多少时间 | 98 | local ctime = crossTime % aday -- 当前在本天 经过多少时间 |