|
|
@@ -334,4 +334,50 @@ function queryHeroBookById(human,heroID,star)
|
|
|
heroGrid.star = star
|
|
|
HeroGrid.makeHeroSimple(msgRet.hero, heroGrid, nil, human, nil, true)
|
|
|
Msg.send(msgRet, human.fd)
|
|
|
+end
|
|
|
+
|
|
|
+-- 查询所有激活的图鉴英雄
|
|
|
+function HeroBook_AllHeroTujian_Query(human)
|
|
|
+ local msgRet = Msg.gc.GC_ALL_HERO_BOOK_QUERY
|
|
|
+ msgRet.list[0] = 0
|
|
|
+ msgRet.isEnd = 0
|
|
|
+
|
|
|
+ if not human.db.heroBook then
|
|
|
+ msgRet.isEnd = 1
|
|
|
+ return Msg.send(msgRet, human.fd)
|
|
|
+ end
|
|
|
+
|
|
|
+ local heroIdArr = {}
|
|
|
+ for heroId in pairs(human.db.heroBook) do
|
|
|
+ heroIdArr[#heroIdArr+1] = heroId
|
|
|
+ end
|
|
|
+
|
|
|
+ local len = 0
|
|
|
+ local msgMaxLen = 20
|
|
|
+ local heroNum = #heroIdArr
|
|
|
+
|
|
|
+ for _, heroId in ipairs(heroIdArr) do
|
|
|
+ len = len + 1
|
|
|
+ msgRet.list[0] = len
|
|
|
+ local showStar = getTuJianStar(human, heroId)
|
|
|
+ local heroGrid = HeroGrid.getCacheHeroGridTujian(heroId)
|
|
|
+ heroGrid.star = showStar
|
|
|
+ HeroGrid.makeHeroSimple(msgRet.list[len], heroGrid, nil, human, nil, true)
|
|
|
+
|
|
|
+ if len >= msgMaxLen then
|
|
|
+ heroNum = heroNum - len
|
|
|
+ if heroNum <= 0 then
|
|
|
+ msgRet.isEnd = 1
|
|
|
+ return Msg.send(msgRet, human.fd)
|
|
|
+ end
|
|
|
+
|
|
|
+ Msg.send(msgRet, human.fd)
|
|
|
+ len = 0
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ if len > 0 then
|
|
|
+ msgRet.isEnd = 1
|
|
|
+ Msg.send(msgRet, human.fd)
|
|
|
+ end
|
|
|
end
|