|
|
@@ -517,6 +517,19 @@ function refreshCardPool(human)
|
|
|
YunYingLogic.onCallBack(human, "onZhanBuBuyCard", CARD_POOL_REFRESH)
|
|
|
end
|
|
|
|
|
|
+
|
|
|
+local function populateHeroMsg(net, heroId)
|
|
|
+ net.heroId = heroId or 0
|
|
|
+ net.heroCamp = 0
|
|
|
+ net.heroName = ""
|
|
|
+ local heroConfig = HeroExcel.hero[heroId]
|
|
|
+ if heroConfig then
|
|
|
+ net.heroCamp = heroConfig.camp
|
|
|
+ net.heroName = heroConfig.name
|
|
|
+ end
|
|
|
+end
|
|
|
+
|
|
|
+
|
|
|
-- ����Ӣ��
|
|
|
function zhanbuHeartHeroQuery(human)
|
|
|
-- �������ݶ�û�У��Ҹ�
|
|
|
@@ -525,21 +538,68 @@ function zhanbuHeartHeroQuery(human)
|
|
|
end
|
|
|
|
|
|
local msgRet = Msg.gc.GC_ZHANBU_HEART_HERO_QUERY
|
|
|
+ -- for i = 1,3 do
|
|
|
+ -- local heroID = human.db.zhanbu.heartHero[i]
|
|
|
+ -- msgRet.heroInfo[i] = heroID or 0
|
|
|
+ -- end
|
|
|
+ -- msgRet.heroInfo[0] = 3
|
|
|
+ -- local len = 0
|
|
|
+ -- for heroID,v in pairs(human.db.heroBook) do
|
|
|
+ -- local heroConfig = HeroExcel.hero[heroID]
|
|
|
+ -- if heroConfig and heroConfig.grade >= 4 then
|
|
|
+ -- len = len + 1
|
|
|
+ -- msgRet.heroList[len] = heroID
|
|
|
+ -- end
|
|
|
+ -- end
|
|
|
+ -- msgRet.heroList[0] = len
|
|
|
+ -- Msg.send(msgRet,human.fd)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ msgRet.isEnd = 0
|
|
|
+ msgRet.isStart = 1
|
|
|
+ msgRet.heroInfo[0] = 3
|
|
|
+ msgRet.heroList[0] = 0
|
|
|
+
|
|
|
for i = 1,3 do
|
|
|
local heroID = human.db.zhanbu.heartHero[i]
|
|
|
- msgRet.heroInfo[i] = heroID or 0
|
|
|
+ populateHeroMsg(msgRet.heroInfo[i], heroID)
|
|
|
end
|
|
|
- msgRet.heroInfo[0] = 3
|
|
|
- local len = 0
|
|
|
- for heroID,v in pairs(human.db.heroBook) do
|
|
|
+
|
|
|
+ local heroIdArr = {}
|
|
|
+ for heroID in pairs(human.db.heroBook) do
|
|
|
local heroConfig = HeroExcel.hero[heroID]
|
|
|
if heroConfig and heroConfig.grade >= 4 then
|
|
|
- len = len + 1
|
|
|
- msgRet.heroList[len] = heroID
|
|
|
+ heroIdArr[#heroIdArr+1] = heroID
|
|
|
end
|
|
|
end
|
|
|
- msgRet.heroList[0] = len
|
|
|
- Msg.send(msgRet,human.fd)
|
|
|
+
|
|
|
+ local heroNum = #heroIdArr
|
|
|
+ local len, msgOnceLen = 0, 20
|
|
|
+
|
|
|
+ for _, heroId in ipairs(heroIdArr) do
|
|
|
+ len = len + 1
|
|
|
+ msgRet.heroList[0] = len
|
|
|
+ populateHeroMsg(msgRet.heroList[len], heroId)
|
|
|
+
|
|
|
+ if len >= msgOnceLen 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
|
|
|
+ msgRet.isStart = 0
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
+ if len > 0 then
|
|
|
+ msgRet.isEnd = 1
|
|
|
+ Msg.send(msgRet,human.fd)
|
|
|
+ end
|
|
|
+
|
|
|
end
|
|
|
|
|
|
-- ��������Ӣ��
|