Commit 9991263083fc8b9f68ffe6c40bf246853299e94e

Authored by gaofengduan
1 parent 37ad731e

fix rune

src/actions/HeroAction.lua
@@ -515,7 +515,8 @@ function _M.referEquipsRpc(agent, data) @@ -515,7 +515,8 @@ function _M.referEquipsRpc(agent, data)
515 role:addEquip({type=typ,level=ownLv,count=1,isRefer=true}) 515 role:addEquip({type=typ,level=ownLv,count=1,isRefer=true})
516 end 516 end
517 end 517 end
518 - hero:updateProperty({field = "equip", value = hero:getProperty("equip"):setv(typ, level)}) 518 + local x = hero:getProperty("equip"):setv(typ, level)
  519 + hero:updateProperty({field = "equip", value = x})
519 end 520 end
520 SendPacket(actionCodes.Hero_referEquipsRpc, "") 521 SendPacket(actionCodes.Hero_referEquipsRpc, "")
521 return true 522 return true
@@ -559,7 +560,8 @@ function _M.referRunesRpc(agent, data) @@ -559,7 +560,8 @@ function _M.referRunesRpc(agent, data)
559 local ownRune = role.runeBag[uid] 560 local ownRune = role.runeBag[uid]
560 ownRune:updateProperty({field = "refer",value = hero:getProperty("id")}) 561 ownRune:updateProperty({field = "refer",value = hero:getProperty("id")})
561 end 562 end
562 - hero:updateProperty({field = "rune", value = hero:getProperty("rune"):setv(typ,uid)}) 563 + local x = hero:getProperty("rune"):setv(typ,uid)
  564 + hero:updateProperty({field = "rune", value = x})
563 end 565 end
564 SendPacket(actionCodes.Hero_referRunesRpc, "") 566 SendPacket(actionCodes.Hero_referRunesRpc, "")
565 return true 567 return true
src/actions/RoleAction.lua
@@ -154,18 +154,17 @@ function _M.loginRpc( agent, data ) @@ -154,18 +154,17 @@ function _M.loginRpc( agent, data )
154 SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(response)) 154 SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(response))
155 155
156 local equipResp = {equipBag = {}} 156 local equipResp = {equipBag = {}}
157 - for _,set in pairs(role.equipBag) do  
158 - for _,equip in pairs(set) do  
159 - local data = equip:data()  
160 - if not equipResp.equipBag[data.type] then equipResp.equipBag[data.type] = {} end  
161 - equipResp.equipBag[data.type][data.level] = data 157 + for typ,set in pairs(role.equipBag) do
  158 + for level,equip in pairs(set) do
  159 + if not equipResp.equipBag[typ] then equipResp.equipBag[typ] = {} end
  160 + equipResp.equipBag[typ][level] = equip:data()
162 end 161 end
163 end 162 end
164 SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(equipResp)) 163 SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(equipResp))
165 164
166 local runeResp = {runeBag = {}} 165 local runeResp = {runeBag = {}}
167 for _,rune in pairs(role.runeBag) do 166 for _,rune in pairs(role.runeBag) do
168 - table_insert(runeResp.runeBag, rune:data()) 167 + runeResp.runeBag[rune:getProperty("uid")]=rune:data()
169 end 168 end
170 SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(runeResp)) 169 SendPacket(actionCodes.Role_loginRpc, MsgPack.pack(runeResp))
171 170
1 -Subproject commit 67615e0a0a3ec5653f4b6e457d45c32dd3afed79 1 +Subproject commit 779ba6c66cf7c9f29882da760f161b39428343bd
src/models/Hero.lua
@@ -21,7 +21,6 @@ Hero.schema = { @@ -21,7 +21,6 @@ Hero.schema = {
21 21
22 function Hero:ctor( properties ) 22 function Hero:ctor( properties )
23 Hero.super.ctor(self, properties) 23 Hero.super.ctor(self, properties)
24 - self.runes = {} --符文-零件自增 id  
25 end 24 end
26 25
27 function Hero:notifyUpdateProperty(field, newValue, oldValue) 26 function Hero:notifyUpdateProperty(field, newValue, oldValue)