Commit 71f716c4924afe0dde7f04d1d40fa9b5857f8175
1 parent
dd1c4a13
引导用到的字段
Showing
3 changed files
with
40 additions
and
0 deletions
Show diff stats
src/ProtocolCode.lua
src/actions/RoleAction.lua
| ... | ... | @@ -921,5 +921,37 @@ function _M.changeHeadRpc(agent, data) |
| 921 | 921 | return true |
| 922 | 922 | end |
| 923 | 923 | |
| 924 | +function _M.guideRpc(agent, data) | |
| 925 | + local role = agent.role | |
| 926 | + local msg = MsgPack.unpack(data) | |
| 927 | + | |
| 928 | + local cmdType = msg.cmdType | |
| 929 | + | |
| 930 | + local funcGuide = role:getProperty("funcGuide") | |
| 931 | + local newerGuide = role:getProperty("newerGuide") | |
| 932 | + if cmd == 1 then | |
| 933 | + -- 新手引导 | |
| 934 | + role:updateProperty({field = "newerGuide", value = newerGuide}) | |
| 935 | + elseif cmdType == 2 then | |
| 936 | + -- 系统引导 | |
| 937 | + if not msg.skip then return end | |
| 938 | + local new = math.min(funcGuide:getv(0, 0), msg.skip) | |
| 939 | + if new < 0 then | |
| 940 | + funcGuide = funcGuide:setv(0, new) | |
| 941 | + else | |
| 942 | + funcGuide = funcGuide:setv(0, funcGuide:getv(0, 0) + msg.skip) | |
| 943 | + end | |
| 944 | + | |
| 945 | + if msg.funcType then | |
| 946 | + funcGuide = funcGuide:setv(msg.funcType, 1) | |
| 947 | + end | |
| 948 | + role:updateProperty({field = "funcGuide", value = funcGuide}) | |
| 949 | + else | |
| 950 | + return | |
| 951 | + end | |
| 952 | + | |
| 953 | + SendPacket(actionCodes.Role_guideRpc, "") | |
| 954 | + return true | |
| 955 | +end | |
| 924 | 956 | |
| 925 | 957 | return _M |
| 926 | 958 | \ No newline at end of file | ... | ... |
src/models/Role.lua
| ... | ... | @@ -85,6 +85,10 @@ Role.schema = { |
| 85 | 85 | hangBagLimit = {"number", globalCsv.idle_field_origin}, --背包上限 |
| 86 | 86 | bTeam = {"table", {}}, -- 奖励副本队伍 |
| 87 | 87 | |
| 88 | + --引导相关 | |
| 89 | + newerGuide = {"string","1=1"}, -- 新手引导 master=slave | |
| 90 | + funcGuide = {"string",""}, -- 功能引导 0=0跳过次数(999永久跳过) 1=1功能1触发情况 | |
| 91 | + | |
| 88 | 92 | pvpTC = {"table", {}}, -- pvp 编队普通 |
| 89 | 93 | pvpTSC = {"table", {}}, -- pvp 他人可读的队伍信息 |
| 90 | 94 | pvpTBC = {"table", {}}, -- pvp 他人可用的战斗信息 |
| ... | ... | @@ -263,6 +267,9 @@ function Role:data() |
| 263 | 267 | hangBagLimit = self:getProperty("hangBagLimit"), |
| 264 | 268 | bTeam = self:getProperty("bTeam"), |
| 265 | 269 | |
| 270 | + newerGuide = self:getProperty("newerGuide"), | |
| 271 | + funcGuide = self:getProperty("funcGuide"), | |
| 272 | + | |
| 266 | 273 | pvpTC = self:getProperty("pvpTC"), |
| 267 | 274 | pvpTH = self:getProperty("pvpTH"), |
| 268 | 275 | ... | ... |