2020-08-06 17:52:32 +08:00
|
|
|
RankingManager = {}
|
2020-05-09 13:31:21 +08:00
|
|
|
local this = RankingManager
|
|
|
|
this.CurPage=0
|
2020-08-22 13:49:47 +08:00
|
|
|
this.curRankingData={}--战力排行滚动数据
|
|
|
|
this.curRankingMyRankData={} --我的数据
|
2020-05-09 13:31:21 +08:00
|
|
|
this.mainLevelConfig={}
|
|
|
|
this.isRequest=0--防止连续请求
|
|
|
|
|
|
|
|
function this.Initialize()
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
--初始化排行数据(待优化)
|
2020-08-22 15:34:02 +08:00
|
|
|
function this.InitData(rankType,fun,id)
|
2020-08-22 18:03:43 +08:00
|
|
|
local activiteId = (id ~= nil and id > 0) and id or nil--点金时需要 当为公会副本是为章节id
|
2020-08-22 13:49:47 +08:00
|
|
|
NetManager.RequestRankInfo(rankType, function (msg)--请求数据
|
|
|
|
this.ReceiveRankingData(msg,fun)
|
2020-08-22 15:34:02 +08:00
|
|
|
end,activiteId)
|
2020-05-09 13:31:21 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
---战力战力
|
|
|
|
--接收服务器战力数据
|
2020-08-22 13:49:47 +08:00
|
|
|
function this.ReceiveRankingData(msg,fun)
|
2020-05-09 13:31:21 +08:00
|
|
|
--自身数据
|
2020-08-22 13:49:47 +08:00
|
|
|
this.curRankingData = {}
|
|
|
|
this.curRankingMyRankData=msg.myRankInfo
|
2020-05-09 13:31:21 +08:00
|
|
|
--滚动数据
|
2020-08-22 13:49:47 +08:00
|
|
|
local length=#this.curRankingData
|
2020-05-09 13:31:21 +08:00
|
|
|
for i, rank in ipairs(msg.ranks) do
|
2020-08-22 13:49:47 +08:00
|
|
|
this.curRankingData[length+i]=rank
|
2020-05-09 13:31:21 +08:00
|
|
|
end
|
2020-08-22 13:49:47 +08:00
|
|
|
if fun then fun() end
|
|
|
|
-- Game.GlobalEvent:DispatchEvent(GameEvent.RankingList.AllRankingList)
|
2020-05-09 13:31:21 +08:00
|
|
|
end
|
|
|
|
--获取排行榜信息
|
2020-08-22 13:49:47 +08:00
|
|
|
function this.GetRankingInfo()
|
|
|
|
return this.curRankingData, this.curRankingMyRankData
|
2020-05-09 13:31:21 +08:00
|
|
|
end
|
|
|
|
|
2020-06-13 11:47:13 +08:00
|
|
|
function this.GetGoldExperSortInfo()
|
|
|
|
return this.GoldExperData,this.GoldExperMyRankData
|
|
|
|
end
|
2020-06-08 13:57:30 +08:00
|
|
|
--膜拜信息
|
|
|
|
local RankProud = {}
|
2020-06-30 18:59:44 +08:00
|
|
|
local firstRankProud = {}--后端临时数据
|
2020-06-08 13:57:30 +08:00
|
|
|
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-06-30 18:59:44 +08:00
|
|
|
function this.SetAllFirstRankProud(types,_firstRankProud)
|
|
|
|
for i = 1, #_firstRankProud do
|
|
|
|
firstRankProud[types[i]] = _firstRankProud[i]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
function this.GetAllFirstRankProud()
|
|
|
|
return firstRankProud
|
|
|
|
end
|
2020-06-13 11:47:13 +08:00
|
|
|
|
|
|
|
--数据拆分 d数据
|
|
|
|
function this.CutDate(d)
|
|
|
|
local dt,db={},{}
|
|
|
|
for i, v in ipairs(d) do
|
|
|
|
if i==1 then
|
|
|
|
table.insert(dt,v)
|
|
|
|
else
|
|
|
|
table.insert(db,v)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return dt,db
|
|
|
|
end
|
|
|
|
|
2020-06-30 18:59:44 +08:00
|
|
|
--膜拜红点
|
|
|
|
function this.RefreshRedPoint()
|
|
|
|
if (ActTimeCtrlManager.SingleFuncState(FUNCTION_OPEN_TYPE.ALLRANKING)) then
|
|
|
|
local proud = RankingManager.GetRankProud()
|
|
|
|
local allFirstRankProud = RankingManager.GetAllFirstRankProud()
|
|
|
|
if proud then
|
|
|
|
for i, v in pairs(proud) do
|
|
|
|
--LogGreen("proud[i] "..v)
|
|
|
|
--LogGreen("allFirstRankProud[i].uid "..allFirstRankProud[i].uid)
|
|
|
|
if v == 0 and allFirstRankProud[i].uid ~= 0 then--没有膜拜过
|
|
|
|
return true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return false
|
|
|
|
else
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2020-06-23 18:36:24 +08:00
|
|
|
return this
|