Commit 71f716c4924afe0dde7f04d1d40fa9b5857f8175
1 parent
dd1c4a13
引导用到的字段
Showing
3 changed files
with
40 additions
and
0 deletions
Show diff stats
src/ProtocolCode.lua
@@ -41,6 +41,7 @@ actionCodes = { | @@ -41,6 +41,7 @@ actionCodes = { | ||
41 | Role_drawCodeRpc = 126, | 41 | Role_drawCodeRpc = 126, |
42 | Role_changeHeadRpc = 127, | 42 | Role_changeHeadRpc = 127, |
43 | Role_openSpeedUpBoxRpc = 128, | 43 | Role_openSpeedUpBoxRpc = 128, |
44 | + Role_guideRpc = 129, | ||
44 | 45 | ||
45 | Adv_startAdvRpc = 151, | 46 | Adv_startAdvRpc = 151, |
46 | Adv_startHangRpc = 152, | 47 | Adv_startHangRpc = 152, |
src/actions/RoleAction.lua
@@ -921,5 +921,37 @@ function _M.changeHeadRpc(agent, data) | @@ -921,5 +921,37 @@ function _M.changeHeadRpc(agent, data) | ||
921 | return true | 921 | return true |
922 | end | 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 | return _M | 957 | return _M |
926 | \ No newline at end of file | 958 | \ No newline at end of file |
src/models/Role.lua
@@ -85,6 +85,10 @@ Role.schema = { | @@ -85,6 +85,10 @@ Role.schema = { | ||
85 | hangBagLimit = {"number", globalCsv.idle_field_origin}, --背包上限 | 85 | hangBagLimit = {"number", globalCsv.idle_field_origin}, --背包上限 |
86 | bTeam = {"table", {}}, -- 奖励副本队伍 | 86 | bTeam = {"table", {}}, -- 奖励副本队伍 |
87 | 87 | ||
88 | + --引导相关 | ||
89 | + newerGuide = {"string","1=1"}, -- 新手引导 master=slave | ||
90 | + funcGuide = {"string",""}, -- 功能引导 0=0跳过次数(999永久跳过) 1=1功能1触发情况 | ||
91 | + | ||
88 | pvpTC = {"table", {}}, -- pvp 编队普通 | 92 | pvpTC = {"table", {}}, -- pvp 编队普通 |
89 | pvpTSC = {"table", {}}, -- pvp 他人可读的队伍信息 | 93 | pvpTSC = {"table", {}}, -- pvp 他人可读的队伍信息 |
90 | pvpTBC = {"table", {}}, -- pvp 他人可用的战斗信息 | 94 | pvpTBC = {"table", {}}, -- pvp 他人可用的战斗信息 |
@@ -263,6 +267,9 @@ function Role:data() | @@ -263,6 +267,9 @@ function Role:data() | ||
263 | hangBagLimit = self:getProperty("hangBagLimit"), | 267 | hangBagLimit = self:getProperty("hangBagLimit"), |
264 | bTeam = self:getProperty("bTeam"), | 268 | bTeam = self:getProperty("bTeam"), |
265 | 269 | ||
270 | + newerGuide = self:getProperty("newerGuide"), | ||
271 | + funcGuide = self:getProperty("funcGuide"), | ||
272 | + | ||
266 | pvpTC = self:getProperty("pvpTC"), | 273 | pvpTC = self:getProperty("pvpTC"), |
267 | pvpTH = self:getProperty("pvpTH"), | 274 | pvpTH = self:getProperty("pvpTH"), |
268 | 275 |