2020-05-09 13:31:21 +08:00
|
|
|
|
RankingManager = {}
|
|
|
|
|
local this = RankingManager
|
|
|
|
|
|
|
|
|
|
--需要显示的排行
|
|
|
|
|
local NeedRanking={
|
|
|
|
|
--[1]={Id=53,OpenLv=0,Name="外敌",PanelType=0},
|
2020-05-25 19:16:23 +08:00
|
|
|
|
[1]={Id=8,OpenLv=0,Name="逐胜",PanelType=0,Des="逐胜"},
|
2020-05-09 13:31:21 +08:00
|
|
|
|
[2]={Id=30,OpenLv=0,Name="试炼",PanelType=0,Des="试炼副本"},
|
|
|
|
|
[3]={Id=55,OpenLv=0,Name="战力",PanelType=0,Des=""},
|
2020-05-25 19:16:23 +08:00
|
|
|
|
[4]={Id=44,OpenLv=0,Name="试练",PanelType=0,Des="试练"},
|
2020-05-09 13:31:21 +08:00
|
|
|
|
[5]={Id=26,OpenLv=0,Name="关卡",PanelType=0,Des=""},
|
|
|
|
|
}
|
|
|
|
|
--Tab按钮显示文字
|
|
|
|
|
local TabTextData={
|
|
|
|
|
-- [1]={txt=""},
|
|
|
|
|
[1]={txt=""},
|
|
|
|
|
[2]={txt=""},
|
|
|
|
|
[3]={txt=""},
|
|
|
|
|
[4]={txt=""},
|
|
|
|
|
[5]={txt=""},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.CurPage=0
|
|
|
|
|
this.WarPowerData={}--战力排行滚动数据
|
|
|
|
|
this.WarPowerMyRankData={} --我的数据
|
2020-05-25 19:16:23 +08:00
|
|
|
|
this.ArenaData={}--逐胜场
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.ArenaMyRankData={}
|
|
|
|
|
this.TrialData={}--试炼
|
|
|
|
|
this.TrialMyRankData={}
|
|
|
|
|
this.MonsterData={}--兽潮
|
|
|
|
|
this.MonsterMyRankData={}
|
|
|
|
|
this.AdventureData={}--外敌
|
|
|
|
|
this.AdventureMyRankData={}
|
|
|
|
|
this.CustomsPassData={}--关卡
|
|
|
|
|
this.CustomsPassMyRankData={}
|
2020-06-08 13:57:30 +08:00
|
|
|
|
this.GuildData={}--公会
|
|
|
|
|
this.GuildMyRankData={}
|
2020-05-09 13:31:21 +08:00
|
|
|
|
|
|
|
|
|
--是否加载完成
|
|
|
|
|
this.LoadCompleted={
|
|
|
|
|
WarPower=0,
|
|
|
|
|
Arena=0,
|
|
|
|
|
Trial=0,
|
|
|
|
|
Monster=0,
|
|
|
|
|
FightAlien=0,
|
|
|
|
|
CustomsPass=0,
|
2020-06-08 13:57:30 +08:00
|
|
|
|
GuildForce=0,
|
2020-05-09 13:31:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.mainLevelConfig={}
|
|
|
|
|
this.isRequest=0--防止连续请求
|
|
|
|
|
|
|
|
|
|
function this.Initialize()
|
|
|
|
|
this.InitNeedRanking()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--初始化需要显示的排行
|
|
|
|
|
function this.InitNeedRanking()
|
|
|
|
|
this.mainLevelConfig=ConfigManager.GetConfig(ConfigName.MainLevelConfig)
|
|
|
|
|
--开启等级赋值
|
|
|
|
|
for i = 1, #NeedRanking do
|
|
|
|
|
NeedRanking[i].OpenLv=ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,NeedRanking[i].Id).OpenRules[2]
|
|
|
|
|
end
|
|
|
|
|
--排序
|
|
|
|
|
table.sort(NeedRanking,function(a,b)
|
|
|
|
|
return a.OpenLv<b.OpenLv
|
|
|
|
|
end)
|
|
|
|
|
--面板类型赋值
|
|
|
|
|
for i = 1, #NeedRanking do
|
|
|
|
|
NeedRanking[i].PanelType=i
|
|
|
|
|
end
|
|
|
|
|
--for i = 1, #NeedRanking do
|
|
|
|
|
-- Log(NeedRanking[i].Name)
|
|
|
|
|
--end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--根据活动开启等级,获取排序后活动名
|
|
|
|
|
function this.GetSortName()
|
|
|
|
|
local nameTable={}
|
|
|
|
|
for i = 1, #NeedRanking do
|
|
|
|
|
nameTable[i]=NeedRanking[i].Name
|
|
|
|
|
end
|
|
|
|
|
return nameTable
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--获取Tab文字内容
|
|
|
|
|
function this.GetTabTextData()
|
|
|
|
|
local _tabTextName=RankingManager.GetSortName()
|
|
|
|
|
for i = 1, #_tabTextName do
|
|
|
|
|
TabTextData[i].txt=_tabTextName[i]
|
|
|
|
|
end
|
|
|
|
|
return TabTextData
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
--根据点击面板类型 获取当前排行信息
|
|
|
|
|
--type 需要的信息类型
|
|
|
|
|
--index 当前点击值
|
|
|
|
|
function this.GetCurRankingInfo(type,index)
|
|
|
|
|
if type=="Id" then
|
|
|
|
|
for i = 1, #NeedRanking do
|
|
|
|
|
if NeedRanking[i].PanelType==index then
|
|
|
|
|
return NeedRanking[i].Id
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
elseif type=="OpenLv" then
|
|
|
|
|
for i = 1, #NeedRanking do
|
|
|
|
|
if NeedRanking[i].PanelType==index then
|
|
|
|
|
return NeedRanking[i].OpenLv
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
elseif type=="Des" then
|
|
|
|
|
for i = 1, #NeedRanking do
|
|
|
|
|
if NeedRanking[i].PanelType==index then
|
|
|
|
|
return NeedRanking[i].Des
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--初始化排行数据(待优化)
|
|
|
|
|
function this.InitData(type,fun)
|
|
|
|
|
if type==FUNCTION_OPEN_TYPE.ALLRANKING then--如果加载为指定的功能类型
|
|
|
|
|
if this.LoadCompleted.WarPower==0 then--当未加载该数据时
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ALLRANKING) then--判断该功能是否解锁
|
2020-05-09 13:31:21 +08:00
|
|
|
|
Log("已解锁 请求战力数据")
|
|
|
|
|
NetManager.RequestRankInfo(RANK_TYPE.FORCE_RANK, function (msg)--请求数据
|
|
|
|
|
this.ReceiveWarPowerData(msg)
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end, ActivityTypeDef.WarPowerSort)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--else
|
|
|
|
|
-- Log("战力未解锁")
|
|
|
|
|
-- this.warPowerData={}
|
|
|
|
|
-- this.warPowerMsg={}
|
|
|
|
|
-- if fun then fun() end
|
|
|
|
|
--end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else--当存在该功能数据时 执行回调
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if type==FUNCTION_OPEN_TYPE.ARENA then
|
|
|
|
|
if this.LoadCompleted.Arena==0 then
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--if ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.ARENA) then --根据是否有资格开启 逐胜场排行在赛季结束时 tab不锁定 需要显示数据
|
2020-05-25 19:16:23 +08:00
|
|
|
|
Log("已解锁 请求逐胜排名数据")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
NetManager.RequestArenaRankData(1,function(page,msg)
|
|
|
|
|
this.ReceiveArenaData(page,msg)
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--else
|
|
|
|
|
-- Log("逐胜排名未解锁")
|
|
|
|
|
-- this.ArenaData={}
|
|
|
|
|
-- this.ArenaMyRankData={}
|
|
|
|
|
-- if fun then fun() end
|
|
|
|
|
--end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if type==FUNCTION_OPEN_TYPE.TRIAL then
|
|
|
|
|
if this.LoadCompleted.Trial==0 then
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.TRIAL) then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
Log("已解锁 请求试炼排名数据")
|
|
|
|
|
NetManager.RequestRankInfo(RANK_TYPE.TRIAL_RANK, function(msg)
|
|
|
|
|
this.ReceiveTrialData(msg)
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--else
|
|
|
|
|
-- Log("试炼排名未解锁")
|
|
|
|
|
-- this.TrialData={}
|
|
|
|
|
-- this.TrialMyRankData={}
|
|
|
|
|
-- if fun then fun() end
|
|
|
|
|
--end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if type==FUNCTION_OPEN_TYPE.MONSTER_COMING then
|
|
|
|
|
if this.LoadCompleted.Monster==0 then
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.MONSTER_COMING) then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
Log("已解锁 请求兽潮来袭排名数据")
|
|
|
|
|
NetManager.RequestRankInfo(RANK_TYPE.MONSTER_RANK, function(msg)
|
|
|
|
|
this.ReceiveMonsterData(msg)
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--else
|
|
|
|
|
-- Log("兽潮排名未解锁")
|
|
|
|
|
-- this.MonsterData={}
|
|
|
|
|
-- this.MonsterMyRankData={}
|
|
|
|
|
-- if fun then fun() end
|
|
|
|
|
--end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if type==FUNCTION_OPEN_TYPE.FIGHT_ALIEN then
|
|
|
|
|
if this.LoadCompleted.FightAlien==0 then
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.FIGHT_ALIEN) then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
Log("已解锁 请求外敌排名数据")
|
|
|
|
|
NetManager.GetAdventureRankRequest(1,function(page,msg)
|
|
|
|
|
this.ReceiveAdventureData(page,msg)
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--else
|
|
|
|
|
-- Log("外敌排名未解锁")
|
|
|
|
|
-- this.AdventureData={}
|
|
|
|
|
-- this.AdventureMyRankData={}
|
|
|
|
|
-- if fun then fun() end
|
|
|
|
|
--end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if type==FUNCTION_OPEN_TYPE.CUSTOMSPASS then
|
|
|
|
|
if this.LoadCompleted.CustomsPass==0 then
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.CUSTOMSPASS) then
|
2020-05-09 13:31:21 +08:00
|
|
|
|
if this.isRequest==1 then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
this.isRequest=1
|
|
|
|
|
Log("已解锁 请求关卡排名数据")
|
|
|
|
|
NetManager.RequestRankInfo(RANK_TYPE.FIGHT_LEVEL_RANK, function(msg)
|
|
|
|
|
this.ReceiveCustomsPassData(msg)
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end)
|
2020-06-08 13:57:30 +08:00
|
|
|
|
--else
|
|
|
|
|
-- Log("关卡排名未解锁")
|
|
|
|
|
-- this.CustomsPassData={}
|
|
|
|
|
-- this.CustomsPassMyRankData={}
|
|
|
|
|
-- if fun then fun() end
|
|
|
|
|
--end
|
|
|
|
|
else
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if type==FUNCTION_OPEN_TYPE.GUILD then
|
|
|
|
|
--this.GuildData={}--公会
|
|
|
|
|
--this.GuildMyRankData={}
|
|
|
|
|
if this.LoadCompleted.GuildForce==0 then
|
|
|
|
|
--if ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.GUILD) then
|
|
|
|
|
if this.isRequest==1 then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
this.isRequest=1
|
|
|
|
|
Log("已解锁 请求公会战力数据")
|
|
|
|
|
NetManager.RequestRankInfo(RANK_TYPE.GUILD_FORCE_RANK, function(msg)
|
|
|
|
|
this.ReceiveGuildForeData(msg)
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end)
|
|
|
|
|
--else
|
|
|
|
|
-- Log("公会未解锁")
|
|
|
|
|
-- this.GuildData={}
|
|
|
|
|
-- this.GuildMyRankData={}
|
|
|
|
|
-- if fun then fun() end
|
|
|
|
|
--end
|
2020-05-09 13:31:21 +08:00
|
|
|
|
else
|
|
|
|
|
if fun then fun() end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
--清空数据
|
|
|
|
|
function this.ClearData()
|
|
|
|
|
this.CurPage=0
|
|
|
|
|
this.WarPowerData={}--战力排行滚动数据
|
|
|
|
|
this.WarPowerMyRankData={} --我的数据
|
2020-05-25 19:16:23 +08:00
|
|
|
|
this.ArenaData={}--逐胜场
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.ArenaMyRankData={}
|
|
|
|
|
this.TrialData={}--试炼
|
|
|
|
|
this.TrialMyRankData={}
|
|
|
|
|
this.MonsterData={}--兽潮
|
|
|
|
|
this.MonsterMyRankData={}
|
|
|
|
|
this.AdventureData={}--外敌
|
|
|
|
|
this.AdventureMyRankData={}
|
|
|
|
|
this.CustomsPassData={}--关卡
|
|
|
|
|
this.CustomsPassMyRankData={}
|
2020-06-08 13:57:30 +08:00
|
|
|
|
this.GuildData={}--公会
|
|
|
|
|
this.GuildMyRankData={}
|
2020-05-09 13:31:21 +08:00
|
|
|
|
this.LoadCompleted.WarPower=0
|
|
|
|
|
this.LoadCompleted.Arena=0
|
|
|
|
|
this.LoadCompleted.Trial=0
|
|
|
|
|
this.LoadCompleted.Monster=0
|
|
|
|
|
this.LoadCompleted.FightAlien=0
|
|
|
|
|
this.LoadCompleted.CustomsPass=0
|
2020-06-08 13:57:30 +08:00
|
|
|
|
this.LoadCompleted.GuildForce=0
|
2020-05-09 13:31:21 +08:00
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---战力战力
|
|
|
|
|
--接收服务器战力数据
|
|
|
|
|
function this.ReceiveWarPowerData(msg)
|
|
|
|
|
--if this.CurPage >= page then return end
|
|
|
|
|
--this.CurPage=page
|
|
|
|
|
--if page==1 then
|
|
|
|
|
-- this.WarPowerData={}
|
|
|
|
|
--end
|
|
|
|
|
|
|
|
|
|
--自身数据
|
|
|
|
|
this.WarPowerMyRankData.myRank=msg.myRankInfo.rank
|
|
|
|
|
this.WarPowerMyRankData.myForce=msg.myRankInfo.param1
|
|
|
|
|
--滚动数据
|
|
|
|
|
local length=#this.WarPowerData
|
|
|
|
|
for i, rank in ipairs(msg.ranks) do
|
|
|
|
|
this.WarPowerData[length+i]=rank
|
|
|
|
|
end
|
|
|
|
|
this.LoadCompleted.WarPower=1 Log("战力 数据加载完成")
|
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnWarPowerChange)
|
|
|
|
|
end
|
|
|
|
|
--请求下一页数据
|
|
|
|
|
function this.RequestNextWarPowerPageData()
|
|
|
|
|
Log("来呀打我呀!!, 就不给你分页")
|
|
|
|
|
--if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ALLRANKING) then
|
|
|
|
|
-- PopupTipPanel.ShowTip("本赛季已结束")
|
|
|
|
|
-- return
|
|
|
|
|
--end
|
|
|
|
|
----判断是否符合刷新条件
|
|
|
|
|
--local rankNum = #this.WarPowerData
|
|
|
|
|
---- 最多显示100
|
|
|
|
|
--local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig, 7)
|
|
|
|
|
--local MaxNum = config and tonumber(config.Value) or 100
|
|
|
|
|
--if rankNum >= MaxNum then return end
|
|
|
|
|
---- 上一页数据少于20条,则没有下一页数,不再刷新
|
|
|
|
|
--if rankNum % 20 > 0 then
|
|
|
|
|
-- return
|
|
|
|
|
--end
|
|
|
|
|
--
|
|
|
|
|
-- 请求下一页
|
|
|
|
|
--NetManager.RequestWarPowerSortData(this.CurPage + 1,ActivityTypeDef.WarPowerSort,function(page,msg)
|
|
|
|
|
-- this.ReceiveWarPowerData(page,msg)
|
|
|
|
|
--end)
|
|
|
|
|
end
|
|
|
|
|
--获取排行榜信息
|
|
|
|
|
function this.GetWarPowerInfo()
|
|
|
|
|
return this.WarPowerData, this.WarPowerMyRankData
|
|
|
|
|
end
|
|
|
|
|
|
2020-05-25 19:16:23 +08:00
|
|
|
|
---逐胜场
|
2020-05-09 13:31:21 +08:00
|
|
|
|
function this.ReceiveArenaData(page,msg)
|
|
|
|
|
if this.CurPage >= page then return end
|
|
|
|
|
this.CurPage=page
|
|
|
|
|
if page==1 then
|
|
|
|
|
this.ArenaData={}
|
|
|
|
|
end
|
|
|
|
|
--自身数据
|
|
|
|
|
this.ArenaMyRankData.myRank=msg.myRank
|
|
|
|
|
this.ArenaMyRankData.myScore=msg.myscore
|
|
|
|
|
--滚动数据
|
|
|
|
|
local length=#this.ArenaData
|
|
|
|
|
for i, rank in ipairs(msg.rankInfos) do
|
|
|
|
|
this.ArenaData[length+i]=rank
|
|
|
|
|
end
|
2020-05-25 19:16:23 +08:00
|
|
|
|
this.LoadCompleted.Arena=1 Log("逐胜 数据加载完成")
|
2020-05-09 13:31:21 +08:00
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnArenaChange)
|
|
|
|
|
end
|
|
|
|
|
function this.RequestNextArenaPageData()
|
|
|
|
|
if not ActTimeCtrlManager.IsQualifiled(FUNCTION_OPEN_TYPE.ARENA) then
|
|
|
|
|
--PopupTipPanel.ShowTip("本赛季已结束")
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
--判断是否符合刷新条件
|
|
|
|
|
local rankNum = #this.ArenaData
|
|
|
|
|
-- 最多显示100
|
|
|
|
|
local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig, 3)
|
|
|
|
|
local MaxNum = config and tonumber(config.Value) or 100
|
|
|
|
|
if rankNum >= MaxNum then return end
|
|
|
|
|
-- 上一页数据少于20条,则没有下一页数,不再刷新
|
|
|
|
|
if rankNum % 20 > 0 then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
-- 请求下一页
|
|
|
|
|
NetManager.RequestArenaRankData(this.CurPage + 1,function(page,msg)
|
|
|
|
|
this.ReceiveArenaData(page,msg)
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
function this.GetArenaInfo()
|
|
|
|
|
return this.ArenaData, this.ArenaMyRankData
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---试炼
|
|
|
|
|
function this.ReceiveTrialData(msg)
|
|
|
|
|
--自身数据
|
|
|
|
|
this.TrialMyRankData.rank=msg.myRankInfo.rank
|
|
|
|
|
this.TrialMyRankData.highestTower=msg.myRankInfo.param1
|
|
|
|
|
--滚动数据
|
|
|
|
|
local length=#this.TrialData
|
|
|
|
|
for i, rank in ipairs(msg.ranks) do
|
|
|
|
|
this.TrialData[length+i]=rank
|
|
|
|
|
end
|
|
|
|
|
this.LoadCompleted.Trial=1 Log("试炼 数据加载完成")
|
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnTrialChange)
|
|
|
|
|
end
|
|
|
|
|
function this.GetTrialInfo()
|
|
|
|
|
return this.TrialData, this.TrialMyRankData
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---兽潮
|
|
|
|
|
function this.ReceiveMonsterData(msg)
|
|
|
|
|
--自身数据
|
|
|
|
|
this.MonsterMyRankData.myRank=msg.myRankInfo.rank
|
|
|
|
|
this.MonsterMyRankData.myScore=msg.myRankInfo.param1
|
|
|
|
|
--滚动数据
|
|
|
|
|
local length=#this.MonsterData
|
|
|
|
|
for i, rank in ipairs(msg.ranks) do
|
|
|
|
|
this.MonsterData[length+i]=rank
|
|
|
|
|
end
|
|
|
|
|
this.LoadCompleted.Monster=1
|
|
|
|
|
Log("兽潮 数据加载完成")
|
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnMonsterChange)
|
|
|
|
|
end
|
|
|
|
|
function this.GetMonsterInfo()
|
|
|
|
|
return this.MonsterData, this.MonsterMyRankData
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---外敌
|
|
|
|
|
function this.ReceiveAdventureData(page,msg)
|
|
|
|
|
if this.CurPage >= page then return end
|
|
|
|
|
this.CurPage=page
|
|
|
|
|
if page==1 then
|
|
|
|
|
this.AdventureData={}
|
|
|
|
|
end
|
|
|
|
|
--自身数据
|
|
|
|
|
this.AdventureMyRankData.rank=msg.myInfo.rank
|
|
|
|
|
this.AdventureMyRankData.hurt=msg.myInfo.hurt
|
|
|
|
|
--滚动数据
|
|
|
|
|
local length=#this.AdventureData
|
|
|
|
|
for i, rank in ipairs(msg.adventureRankItemInfo) do
|
|
|
|
|
this.AdventureData[length+i]=rank
|
|
|
|
|
end
|
|
|
|
|
this.LoadCompleted.FightAlien=1
|
|
|
|
|
Log("外敌 数据加载完成")
|
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnAdventureChange)
|
|
|
|
|
end
|
|
|
|
|
function this.RequestNextAdventurePageData()
|
|
|
|
|
if not ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.FIGHT_ALIEN) then
|
|
|
|
|
PopupTipPanel.ShowTip("本赛季已结束")
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
--判断是否符合刷新条件
|
|
|
|
|
local rankNum = #this.AdventureData
|
|
|
|
|
-- 最多显示100
|
|
|
|
|
local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig, 6)
|
|
|
|
|
local MaxNum = config and tonumber(config.Value) or 100
|
|
|
|
|
if rankNum >= MaxNum then return end
|
|
|
|
|
-- 上一页数据少于20条,则没有下一页数,不再刷新
|
|
|
|
|
if rankNum % 20 > 0 then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
-- 请求下一页
|
|
|
|
|
NetManager.GetAdventureRankRequest(this.CurPage + 1,function(page,msg)
|
|
|
|
|
this.ReceiveAdventureData(page,msg)
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
function this.GetAdventureInfo()
|
|
|
|
|
return this.AdventureData,this.AdventureMyRankData
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
---关卡
|
|
|
|
|
function this.ReceiveCustomsPassData(msg)
|
|
|
|
|
if this.LoadCompleted.CustomsPass==1 then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
--自身数据
|
|
|
|
|
|
|
|
|
|
this.CustomsPassMyRankData.myRank=msg.myRankInfo.rank
|
|
|
|
|
this.CustomsPassMyRankData.fightId=msg.myRankInfo.param1
|
|
|
|
|
--滚动数据
|
|
|
|
|
local length=#this.CustomsPassData
|
|
|
|
|
for i, rank in ipairs(msg.ranks) do
|
|
|
|
|
this.CustomsPassData[length+i]=rank
|
|
|
|
|
end
|
|
|
|
|
this.LoadCompleted.CustomsPass=1
|
|
|
|
|
Log("关卡 数据加载完成")
|
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnCustomsPassChange)
|
|
|
|
|
end
|
|
|
|
|
function this.GetCustomsPassInfo()
|
|
|
|
|
return this.CustomsPassData,this.CustomsPassMyRankData
|
|
|
|
|
end
|
2020-06-08 13:57:30 +08:00
|
|
|
|
---公会
|
|
|
|
|
function this.ReceiveGuildForeData(msg)
|
|
|
|
|
--this.GuildData={}--公会
|
|
|
|
|
--this.GuildMyRankData={}
|
|
|
|
|
if this.LoadCompleted.GuildForce==1 then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
--自身数据
|
|
|
|
|
|
|
|
|
|
this.GuildMyRankData.myRank=msg.myRankInfo.rank
|
|
|
|
|
this.GuildMyRankData.myForce=msg.myRankInfo.param1
|
|
|
|
|
--滚动数据
|
|
|
|
|
local length=#this.GuildData
|
|
|
|
|
for i, rank in ipairs(msg.ranks) do
|
|
|
|
|
this.GuildData[length+i]=rank
|
|
|
|
|
end
|
|
|
|
|
this.LoadCompleted.GuildForce=1
|
|
|
|
|
Log("关卡 数据加载完成")
|
|
|
|
|
Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.OnGuildForceChange)
|
|
|
|
|
end
|
|
|
|
|
function this.GetGuildForeInfo()
|
|
|
|
|
return this.GuildData,this.GuildMyRankData
|
|
|
|
|
end
|
|
|
|
|
--膜拜信息
|
|
|
|
|
local RankProud = {}
|
|
|
|
|
function this.SetAllRankProud(types,prouds)
|
|
|
|
|
for i = 1, #types do
|
|
|
|
|
RankProud[types[i]] = prouds[i]
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
function this.SetSingleRankProud(type,proud)
|
|
|
|
|
RankProud[type] = proud
|
|
|
|
|
end
|
|
|
|
|
function this.GetRankProud()
|
|
|
|
|
return RankProud
|
|
|
|
|
end
|
|
|
|
|
|
2020-05-09 13:31:21 +08:00
|
|
|
|
return this
|