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 | 232 | Activity_commonSignRpc = 666, |
233 | 233 | Activity_friendHelpRpc = 667, |
234 | 234 | Activity_battleCommandRpc = 668, |
235 | - Activity_actCalendaTmpTaskRpc = 659, | |
235 | + Activity_actCalendaTmpTaskRpc = 669, | |
236 | + Activity_newSignRpc = 670, | |
236 | 237 | |
237 | 238 | Radio_startQuestRpc = 700, |
238 | 239 | Radio_finishQuestRpc = 701, |
... | ... | @@ -250,4 +251,4 @@ for key, value in pairs(actionCodes) do |
250 | 251 | actionHandlers[value + rpcResponseBegin] = handlerName .. "Response" |
251 | 252 | end |
252 | 253 | actionHandlers[value] = string.gsub(key, "_", ".") |
253 | -end | |
254 | 254 | \ No newline at end of file |
255 | +end | ... | ... |
src/actions/ActivityAction.lua
... | ... | @@ -583,7 +583,7 @@ function _M.startBattleRpc(agent, data) |
583 | 583 | bi["bossP"] = (bi["bossP"] or 0) + bi["maxP"] * count |
584 | 584 | end |
585 | 585 | |
586 | - bi["sum"] = bi["sum"] + bi["top"] | |
586 | + bi["sum"] = bi["sum"] + bi["top"] * count | |
587 | 587 | actData["ticket"] = ticket - num |
588 | 588 | actData[id] = bi |
589 | 589 | changeFlag = true |
... | ... | @@ -1237,4 +1237,34 @@ function _M.buyBattleCommandLvlRpc(agent, data) |
1237 | 1237 | return true |
1238 | 1238 | end |
1239 | 1239 | |
1240 | -return _M | |
1241 | 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 | 124 | local runeData = runeSet[id] |
125 | 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 | 129 | local lvData = csvdb["rune_buildCsv"][level] |
130 | 130 | local cost = lvData.cost:toNumMap() |
131 | 131 | if not role:checkItemEnough(cost) then | ... | ... |
src/actions/HeroAction.lua
... | ... | @@ -617,7 +617,7 @@ function _M.getResetRewardRpc(agent, data) |
617 | 617 | if level <= 1 and talent == "" then return end |
618 | 618 | |
619 | 619 | local pay = true |
620 | - if level <= 60 then | |
620 | + if level <= 60 or role.activity:isOpen("HeroBackFree") then | |
621 | 621 | pay = false |
622 | 622 | end |
623 | 623 | |
... | ... | @@ -853,6 +853,10 @@ function _M.drawHeroRpc(agent, data) |
853 | 853 | elseif values[1] == HeroQuality.SSR then |
854 | 854 | weight = unitPool["up_ssr_weight"] |
855 | 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 | 860 | end |
857 | 861 | --print(poolId, rand_v, weight, up_pool, values[1]) |
858 | 862 | if rand_v < weight and up_pool then |
... | ... | @@ -879,6 +883,15 @@ function _M.drawHeroRpc(agent, data) |
879 | 883 | if heroData[field] ~= values[idx] then ok = false break end |
880 | 884 | end |
881 | 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 | 895 | if not ok then break end |
883 | 896 | if oneData[pool_str] > 0 then |
884 | 897 | resultPool[itemId] = {oneData[pool_str]} -- itemId, count, 概率 | ... | ... |
src/models/Activity.lua
... | ... | @@ -35,6 +35,8 @@ Activity.ActivityType = { |
35 | 35 | FriendEnergy = 30, -- 好友互赠能量活动 |
36 | 36 | AdvLevel = 33, -- 拾荒关卡 |
37 | 37 | BattleCommand = 34, -- 战令活动 |
38 | + NewSign = 36, -- 活动签到,单独的签到界面 | |
39 | + HeroBackFree = 37, -- 无损耗归还 | |
38 | 40 | |
39 | 41 | CalendaTaskTmp = 38, -- 新春任务活动 |
40 | 42 | } |
... | ... | @@ -85,6 +87,7 @@ Activity.schema = { |
85 | 87 | act30 = {"table", {}}, -- {magic = 0, limit = 0, reward = {id = 1, id = 1}, giveAE = {}, getAE = {}} 奖励字段1表示领取过奖励 |
86 | 88 | |
87 | 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 | 93 | function Activity:data() |
... | ... | @@ -110,6 +113,7 @@ function Activity:data() |
110 | 113 | act30 = self:getProperty("act30"), |
111 | 114 | |
112 | 115 | act34 = self:getProperty("act34"), |
116 | + act36 = self:getProperty("act36"), | |
113 | 117 | } |
114 | 118 | end |
115 | 119 | |
... | ... | @@ -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 | 1029 | return Activity | ... | ... |
src/models/RoleLog.lua
... | ... | @@ -55,6 +55,7 @@ local ItemReason = { |
55 | 55 | actFriendHelp = 139,-- 好友能量互助活动 |
56 | 56 | actBattleCommand = 140, -- 活动战令 |
57 | 57 | actBuyBpLevel = 141, -- 购买活动战令等级 |
58 | + newSign = 142,-- 新的活动签到 | |
58 | 59 | |
59 | 60 | |
60 | 61 | advHang = 301, -- 拾荒挂机 |
... | ... | @@ -126,6 +127,7 @@ local ItemReason = { |
126 | 127 | |
127 | 128 | -- pvp |
128 | 129 | pvpCHead = 1301, -- pvp 跨服竞技场头像 |
130 | + crossPvpBet = 1302, -- 竞猜 | |
129 | 131 | |
130 | 132 | --adv |
131 | 133 | chooseEvent = 1351, -- 冒险选择 |
... | ... | @@ -879,4 +881,4 @@ function RoleLog.bind(Role) |
879 | 881 | |
880 | 882 | |
881 | 883 | end |
882 | -return RoleLog | |
883 | 884 | \ No newline at end of file |
885 | +return RoleLog | ... | ... |
src/models/RolePvp.lua
... | ... | @@ -521,7 +521,7 @@ function Role:changeCrossServerPvpSelfInfo(cType) |
521 | 521 | change[cType] = self:getProperty(cType) |
522 | 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 | 525 | local aday = 3600 * 24 |
526 | 526 | local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 |
527 | 527 | local ctime = crossTime % aday -- 当前在本天 经过多少时间 |
... | ... | @@ -615,7 +615,7 @@ end |
615 | 615 | |
616 | 616 | function Role:setCrossServerPvpBet(idx) |
617 | 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 | 619 | local aday = 3600 * 24 |
620 | 620 | local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 |
621 | 621 | local ctime = crossTime % aday -- 当前在本天 经过多少时间 | ... | ... |
src/services/pvpd.lua
... | ... | @@ -84,7 +84,7 @@ function CMD.updateRoleInfo(change) |
84 | 84 | CMD.refreshRoleInfo(change) |
85 | 85 | local pvpd = cluster.query("center", "pvpd") |
86 | 86 | if pvpd then |
87 | - pcall(cluster.call, "center", pvpd, "updateRoleInfo", change) | |
87 | + pcall(cluster.send, "center", pvpd, "updateRoleInfo", change) | |
88 | 88 | end |
89 | 89 | end |
90 | 90 | |
... | ... | @@ -92,7 +92,7 @@ local function getDayAndTime() |
92 | 92 | local startTime = getStartTime() |
93 | 93 | local now = skynet.timex() |
94 | 94 | |
95 | - local crossTime = now - startTime | |
95 | + local crossTime = now - startTime + RESET_TIME * 3600 | |
96 | 96 | local aday = 3600 * 24 |
97 | 97 | local day = math.ceil(crossTime / aday) -- 当前是第几个比赛日 |
98 | 98 | local ctime = crossTime % aday -- 当前在本天 经过多少时间 | ... | ... |