xiyou_sanguo
parent
5262f29863
commit
34e8b1f30c
File diff suppressed because one or more lines are too long
|
|
@ -830,6 +830,18 @@ PLAYERMERIDIANSLEVELUPREQUEST_TYPE_FIELD = protobuf.FieldDescriptor();
|
|||
PLAYERMERIDIANSLEVELUPRESPONSE = protobuf.Descriptor();
|
||||
PLAYERGODLEVELUPREQUEST = protobuf.Descriptor();
|
||||
PLAYERGODLEVELUPRESPONSE = protobuf.Descriptor();
|
||||
GETRANKTIMESSTATUSREQUEST = protobuf.Descriptor();
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD = protobuf.FieldDescriptor();
|
||||
GETRANKTIMESSTATUSRESPONSE = protobuf.Descriptor();
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD = protobuf.FieldDescriptor();
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD = protobuf.FieldDescriptor();
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD = protobuf.FieldDescriptor();
|
||||
GETRANKTIMESREWARDREQUEST = protobuf.Descriptor();
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD = protobuf.FieldDescriptor();
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD = protobuf.FieldDescriptor();
|
||||
GETRANKTIMESREWARDRESPONSE = protobuf.Descriptor();
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD = protobuf.FieldDescriptor();
|
||||
GETRANKTIMESREDRESPONSE = protobuf.Descriptor();
|
||||
|
||||
ERRORMSGRESPONSE_MSG_FIELD.name = "msg"
|
||||
ERRORMSGRESPONSE_MSG_FIELD.full_name = ".rpc.protocols.ErrorMsgResponse.msg"
|
||||
|
|
@ -8377,6 +8389,112 @@ PLAYERGODLEVELUPRESPONSE.enum_types = {}
|
|||
PLAYERGODLEVELUPRESPONSE.fields = {}
|
||||
PLAYERGODLEVELUPRESPONSE.is_extendable = false
|
||||
PLAYERGODLEVELUPRESPONSE.extensions = {}
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD.name = "rankId"
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD.full_name = ".rpc.protocols.GetRankTimesStatusRequest.rankId"
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD.number = 1
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD.index = 0
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD.label = 1
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD.has_default_value = false
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD.default_value = 0
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD.type = 5
|
||||
GETRANKTIMESSTATUSREQUEST_RANKID_FIELD.cpp_type = 1
|
||||
|
||||
GETRANKTIMESSTATUSREQUEST.name = "GetRankTimesStatusRequest"
|
||||
GETRANKTIMESSTATUSREQUEST.full_name = ".rpc.protocols.GetRankTimesStatusRequest"
|
||||
GETRANKTIMESSTATUSREQUEST.nested_types = {}
|
||||
GETRANKTIMESSTATUSREQUEST.enum_types = {}
|
||||
GETRANKTIMESSTATUSREQUEST.fields = {GETRANKTIMESSTATUSREQUEST_RANKID_FIELD}
|
||||
GETRANKTIMESSTATUSREQUEST.is_extendable = false
|
||||
GETRANKTIMESSTATUSREQUEST.extensions = {}
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD.name = "rankId"
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD.full_name = ".rpc.protocols.GetRankTimesStatusResponse.rankId"
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD.number = 1
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD.index = 0
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD.label = 1
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD.has_default_value = false
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD.default_value = 0
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD.type = 5
|
||||
GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD.cpp_type = 1
|
||||
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD.name = "times"
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD.full_name = ".rpc.protocols.GetRankTimesStatusResponse.times"
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD.number = 2
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD.index = 1
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD.label = 1
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD.has_default_value = false
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD.default_value = 0
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD.type = 5
|
||||
GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD.cpp_type = 1
|
||||
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD.name = "list"
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD.full_name = ".rpc.protocols.GetRankTimesStatusResponse.list"
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD.number = 3
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD.index = 2
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD.label = 3
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD.has_default_value = false
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD.default_value = {}
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD.type = 5
|
||||
GETRANKTIMESSTATUSRESPONSE_LIST_FIELD.cpp_type = 1
|
||||
|
||||
GETRANKTIMESSTATUSRESPONSE.name = "GetRankTimesStatusResponse"
|
||||
GETRANKTIMESSTATUSRESPONSE.full_name = ".rpc.protocols.GetRankTimesStatusResponse"
|
||||
GETRANKTIMESSTATUSRESPONSE.nested_types = {}
|
||||
GETRANKTIMESSTATUSRESPONSE.enum_types = {}
|
||||
GETRANKTIMESSTATUSRESPONSE.fields = {GETRANKTIMESSTATUSRESPONSE_RANKID_FIELD, GETRANKTIMESSTATUSRESPONSE_TIMES_FIELD, GETRANKTIMESSTATUSRESPONSE_LIST_FIELD}
|
||||
GETRANKTIMESSTATUSRESPONSE.is_extendable = false
|
||||
GETRANKTIMESSTATUSRESPONSE.extensions = {}
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD.name = "rankId"
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD.full_name = ".rpc.protocols.GetRankTimesRewardRequest.rankId"
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD.number = 1
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD.index = 0
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD.label = 1
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD.has_default_value = false
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD.default_value = 0
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD.type = 5
|
||||
GETRANKTIMESREWARDREQUEST_RANKID_FIELD.cpp_type = 1
|
||||
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD.name = "condition"
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD.full_name = ".rpc.protocols.GetRankTimesRewardRequest.condition"
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD.number = 2
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD.index = 1
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD.label = 1
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD.has_default_value = false
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD.default_value = 0
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD.type = 5
|
||||
GETRANKTIMESREWARDREQUEST_CONDITION_FIELD.cpp_type = 1
|
||||
|
||||
GETRANKTIMESREWARDREQUEST.name = "GetRankTimesRewardRequest"
|
||||
GETRANKTIMESREWARDREQUEST.full_name = ".rpc.protocols.GetRankTimesRewardRequest"
|
||||
GETRANKTIMESREWARDREQUEST.nested_types = {}
|
||||
GETRANKTIMESREWARDREQUEST.enum_types = {}
|
||||
GETRANKTIMESREWARDREQUEST.fields = {GETRANKTIMESREWARDREQUEST_RANKID_FIELD, GETRANKTIMESREWARDREQUEST_CONDITION_FIELD}
|
||||
GETRANKTIMESREWARDREQUEST.is_extendable = false
|
||||
GETRANKTIMESREWARDREQUEST.extensions = {}
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.name = "drop"
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.full_name = ".rpc.protocols.GetRankTimesRewardResponse.drop"
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.number = 1
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.index = 0
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.label = 1
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.has_default_value = false
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.default_value = nil
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.message_type = CommonProto_pb.DROP
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.type = 11
|
||||
GETRANKTIMESREWARDRESPONSE_DROP_FIELD.cpp_type = 10
|
||||
|
||||
GETRANKTIMESREWARDRESPONSE.name = "GetRankTimesRewardResponse"
|
||||
GETRANKTIMESREWARDRESPONSE.full_name = ".rpc.protocols.GetRankTimesRewardResponse"
|
||||
GETRANKTIMESREWARDRESPONSE.nested_types = {}
|
||||
GETRANKTIMESREWARDRESPONSE.enum_types = {}
|
||||
GETRANKTIMESREWARDRESPONSE.fields = {GETRANKTIMESREWARDRESPONSE_DROP_FIELD}
|
||||
GETRANKTIMESREWARDRESPONSE.is_extendable = false
|
||||
GETRANKTIMESREWARDRESPONSE.extensions = {}
|
||||
GETRANKTIMESREDRESPONSE.name = "GetRankTimesRedResponse"
|
||||
GETRANKTIMESREDRESPONSE.full_name = ".rpc.protocols.GetRankTimesRedResponse"
|
||||
GETRANKTIMESREDRESPONSE.nested_types = {}
|
||||
GETRANKTIMESREDRESPONSE.enum_types = {}
|
||||
GETRANKTIMESREDRESPONSE.fields = {}
|
||||
GETRANKTIMESREDRESPONSE.is_extendable = false
|
||||
GETRANKTIMESREDRESPONSE.extensions = {}
|
||||
|
||||
ActiveUserMountRequest = protobuf.Message(ACTIVEUSERMOUNTREQUEST)
|
||||
ActiveUserMountResponse = protobuf.Message(ACTIVEUSERMOUNTRESPONSE)
|
||||
|
|
@ -8490,6 +8608,11 @@ GetPlayerOneTeamInfoRequest = protobuf.Message(GETPLAYERONETEAMINFOREQUEST)
|
|||
GetPlayerOneTeamInfoResponse = protobuf.Message(GETPLAYERONETEAMINFORESPONSE)
|
||||
GetQuestionRequest = protobuf.Message(GETQUESTIONREQUEST)
|
||||
GetQuestionResponse = protobuf.Message(GETQUESTIONRESPONSE)
|
||||
GetRankTimesRedResponse = protobuf.Message(GETRANKTIMESREDRESPONSE)
|
||||
GetRankTimesRewardRequest = protobuf.Message(GETRANKTIMESREWARDREQUEST)
|
||||
GetRankTimesRewardResponse = protobuf.Message(GETRANKTIMESREWARDRESPONSE)
|
||||
GetRankTimesStatusRequest = protobuf.Message(GETRANKTIMESSTATUSREQUEST)
|
||||
GetRankTimesStatusResponse = protobuf.Message(GETRANKTIMESSTATUSRESPONSE)
|
||||
GetSecretBoxInfoResponse = protobuf.Message(GETSECRETBOXINFORESPONSE)
|
||||
GetSomeActitityInfoRespone = protobuf.Message(GETSOMEACTITITYINFORESPONE)
|
||||
GetSomeActivityInfoRequest = protobuf.Message(GETSOMEACTIVITYINFOREQUEST)
|
||||
|
|
|
|||
|
|
@ -379,6 +379,7 @@ function this:InitComponent()
|
|||
local day = math.floor(PlayerManager.serverTime / (24 * 3600))
|
||||
PlayerPrefs.SetInt("day0", day)
|
||||
end
|
||||
RankingManager.CheckChongRankRewardRp()
|
||||
end
|
||||
|
||||
function this:SetPosFunc(v2)
|
||||
|
|
@ -1794,6 +1795,10 @@ function this.TimeFormat()
|
|||
if v.ActiveType > 0 then
|
||||
local QingLong = ActivityGiftManager.IsActivityTypeOpen(v.ActiveType)
|
||||
if QingLong and QingLong > 0 and ActivityGiftManager.IsQualifiled(v.ActiveType) then
|
||||
if v.ActiveType == 110 then
|
||||
--LogError("=============================开服冲榜===============================")
|
||||
activityTabs[k].redpot:SetActive(RankingManager.canGet > 0)
|
||||
end
|
||||
if v.ActiveType == 42 then
|
||||
if ActivityGiftManager.CheckSupremeMission(1, true)
|
||||
and ActivityGiftManager.CheckSupremeMission(2, true)
|
||||
|
|
|
|||
|
|
@ -164,8 +164,14 @@ function this.RegisterMessage(network)
|
|||
socket:RegistNetMessage(MessageTypeProto_pb.GemNewInfoIndication,this.NewGemInfoIndition)
|
||||
--助阵
|
||||
socket:RegistNetMessage(MessageTypeProto_pb.AssistInfoIndication,this.HelpFightIndition)
|
||||
--排行榜红点推送
|
||||
socket:RegistNetMessage(MessageTypeProto_pb.GetRankTimesRedResponse,this.GetRankTimesRedResponse)
|
||||
end
|
||||
--排行榜红点推送
|
||||
function this.GetRankTimesRedResponse(buff)
|
||||
LogError("收到服务器排行榜红点推送=====================")
|
||||
RankingManager.CheckChongRankRewardRp()
|
||||
end
|
||||
|
||||
--助阵推送
|
||||
function this.HelpFightIndition(buff)
|
||||
local data = buff:DataByte()
|
||||
|
|
|
|||
|
|
@ -90,6 +90,37 @@ function this.LoginConfimRequest()
|
|||
DynamicActivityManager.ChangeMingWangLv()
|
||||
end
|
||||
|
||||
function this.GetRankTimesStatusRequest(rankId, func)
|
||||
local data = PlayerInfoProto_pb.GetRankTimesStatusRequest()
|
||||
data.rankId = rankId
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.GetRankTimesStatusRequest, MessageTypeProto_pb
|
||||
.GetRankTimesStatusResponse, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = PlayerInfoProto_pb.GetRankTimesStatusResponse()
|
||||
msg:ParseFromString(data)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
function this.GetRankTimesRewardRequest(rankId, condition, func)
|
||||
local data = PlayerInfoProto_pb.GetRankTimesRewardRequest()
|
||||
data.rankId = rankId
|
||||
data.condition = condition
|
||||
local msg = data:SerializeToString()
|
||||
Network:SendMessageWithCallBack(MessageTypeProto_pb.GetRankTimesRewardRequest, MessageTypeProto_pb
|
||||
.GetRankTimesRewardResponse, msg, function(buffer)
|
||||
local data = buffer:DataByte()
|
||||
local msg = PlayerInfoProto_pb.GetRankTimesRewardResponse()
|
||||
msg:ParseFromString(data)
|
||||
if func then
|
||||
func(msg)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
--请求玩家数据
|
||||
function this.PlayerInfoRequest(func)
|
||||
local data = PlayerInfoProto_pb.GetPlayerInfoRequest()
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ local isFirst = false
|
|||
local _TabData = {
|
||||
[1] = { default = "sz_weixuanzhong", select = "sz_xuanzhong", name = Language[11924] },
|
||||
[2] = { default = "sz_weixuanzhong", select = "sz_xuanzhong", name = Language[11925] },
|
||||
[3] = { default = "sz_weixuanzhong", select = "sz_xuanzhong", name = Language[11925] }
|
||||
[3] = { default = "sz_weixuanzhong", select = "sz_xuanzhong", name = "次数奖励" }
|
||||
}
|
||||
local BtnState = {
|
||||
[0] = { ImgName = "s_slbz_1anniuhuangse", Text = Language[10505] },
|
||||
|
|
@ -104,6 +104,12 @@ end
|
|||
local qaId = 0
|
||||
function this:OnShow()
|
||||
PlayerPrefs.SetInt(PlayerManager.uid .. "kaifuchongbang", 1)
|
||||
if type == 3 then
|
||||
this.redpot:SetActive(RankingManager.canGet > 0)
|
||||
RankingManager.UpdateStatus(curConfig.Id, function()
|
||||
this.UpdateRankingRewardList(curConfig)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
local state = 0
|
||||
|
|
@ -228,20 +234,27 @@ function this.ChangeWindow(config)
|
|||
this.UpdateRewardInfo(go, list[index])
|
||||
end, false)
|
||||
elseif type == 3 then
|
||||
local list = RankingManager.GetNeedRewardData(config.Id)
|
||||
--local list = RankingManager.GetNeedRewardData(4)
|
||||
this.rankTxt:SetActive(false)
|
||||
this.rewardGrid:SetActive(false)
|
||||
this.rankGrid:SetActive(false)
|
||||
this.rankRewardGrid:SetActive(true)
|
||||
this.infoTxt.text = Language[10073]
|
||||
this.RankRwardScrollView:SetData(list, function(index, go)
|
||||
this.UpdateRankReward(go, list[index])
|
||||
end, false)
|
||||
this.UpdateRankingRewardList(config)
|
||||
RankingManager.UpdateStatus(config.Id, function()
|
||||
this.UpdateRankingRewardList(config)
|
||||
end)
|
||||
end
|
||||
end, 0, 1)
|
||||
end
|
||||
|
||||
function this.UpdateRankingRewardList(config)
|
||||
local list = RankingManager.GetNeedRewardData(config.Id)
|
||||
--local list = RankingManager.GetNeedRewardData(4)
|
||||
this.rankTxt:SetActive(false)
|
||||
this.rewardGrid:SetActive(false)
|
||||
this.rankGrid:SetActive(false)
|
||||
this.rankRewardGrid:SetActive(true)
|
||||
this.infoTxt.text = Language[10073]
|
||||
this.RankRwardScrollView:SetData(list, function(index, go)
|
||||
this.UpdateRankReward(go, list[index], config)
|
||||
end, false)
|
||||
end
|
||||
|
||||
function this:BindEvent()
|
||||
Util.AddClick(this.backBtn, function()
|
||||
self:ClosePanel()
|
||||
|
|
@ -266,6 +279,8 @@ function this.TabAdapter(tab, index, status)
|
|||
local list = RankingManager.GetNeedRewardData(curConfig.Id)
|
||||
--local list = RankingManager.GetNeedRewardData(4)
|
||||
tab.gameObject:SetActive(#list > 0)
|
||||
this.redpot = Util.GetGameObject(tab.gameObject, "Redpot")
|
||||
this.redpot:SetActive(RankingManager.canGet > 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -283,6 +298,9 @@ function this.SwitchView(index)
|
|||
return
|
||||
end
|
||||
this.ChangeWindow(curConfig)
|
||||
if index == 3 then
|
||||
this.redpot:SetActive(RankingManager.canGet > 0)
|
||||
end
|
||||
end
|
||||
|
||||
function this.UpdateRewardInfo(go, data)
|
||||
|
|
@ -329,7 +347,7 @@ function this.UpdateRewardInfo(go, data)
|
|||
end
|
||||
end
|
||||
|
||||
function this.UpdateRankReward(go, data)
|
||||
function this.UpdateRankReward(go, data, config)
|
||||
local title = Util.GetGameObject(go, "title/titleText"):GetComponent("Text")
|
||||
local btn = Util.GetGameObject(go, "btn"):GetComponent("Button")
|
||||
local btnImg = Util.GetGameObject(go, "btn"):GetComponent("Image")
|
||||
|
|
@ -343,6 +361,7 @@ function this.UpdateRankReward(go, data)
|
|||
local shows = data.Reward
|
||||
title.text = GetLanguageStrById(data.Text)
|
||||
redPoint:SetActive(data.state == 1)
|
||||
this.redpot:SetActive(RankingManager.canGet > 0)
|
||||
btn.interactable = data.state ~= 2
|
||||
btnImg.sprite = this.spLoader:LoadSprite(BtnState[data.state].ImgName)
|
||||
btnText.text = BtnState[data.state].Text
|
||||
|
|
@ -385,11 +404,12 @@ function this.UpdateRankReward(go, data)
|
|||
if data.state == 0 then
|
||||
JumpManager.GoJump(data.jumpId)
|
||||
elseif data.state == 1 then
|
||||
NetManager.TakeMissionRewardRequest(TaskTypeDef.NiuQiChongTian, data.id, function(msg)
|
||||
NetManager.GetRankTimesRewardRequest(data.Sort, data.value, function(msg)
|
||||
RankingManager.SetRewardDataState(data.id, 2)
|
||||
this.UpdateRankingRewardList(curConfig)
|
||||
this.redpot:SetActive(RankingManager.canGet > 0)
|
||||
UIManager.OpenPanel(UIName.RewardItemPopup, msg.drop, 1, function()
|
||||
CheckRedPointStatus(RedPointType.NiuQiChongTian + self.curPage)
|
||||
CheckRedPointStatus(RedPointType.NiuQiChongTian_4)
|
||||
self:SwitchView(self.curPage, true)
|
||||
--self:SwitchView(self.curPage, true)
|
||||
end)
|
||||
end)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,16 +1,30 @@
|
|||
RankingManager = {}
|
||||
local this = RankingManager
|
||||
local infoConfig = ConfigManager.GetConfig(ConfigName.ChongRankInfo)
|
||||
this.CurPage = 0
|
||||
this.curRankingData = {} --战力排行滚动数据
|
||||
this.curRankingMyRankData = {} --我的数据
|
||||
this.mainLevelConfig = {}
|
||||
this.isRequest = 0 --防止连续请求
|
||||
this.rewardData = {}
|
||||
this.canGet = 0
|
||||
function this.Initialize()
|
||||
this.InitAllRewardData()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.Mission.NiuQiChongTianTask, this.UpdateStatus)
|
||||
Game.GlobalEvent:AddEvent(Protocal.Connect, this.RegisterMessage)
|
||||
--this.CheckChongRankRewardRp()
|
||||
--Game.GlobalEvent:AddEvent(GameEvent.Mission.NiuQiChongTianTask, this.UpdateStatus)
|
||||
end
|
||||
function this.RegisterMessage(network)
|
||||
if network.type ~= SocketType.LOGIN then return end
|
||||
Network = network
|
||||
network.socket:RegistNetMessage(MessageTypeProto_pb.GetRankTimesRedResponse, this.GetRankTimesRedResponse)
|
||||
--Game.GlobalEvent:DispatchEvent(GameEvent.Room.MatchSuccess)
|
||||
end
|
||||
--排行榜红点推送
|
||||
function this.GetRankTimesRedResponse(buff)
|
||||
--LogError("收到服务器排行榜红点推送=====================")
|
||||
RankingManager.CheckChongRankRewardRp()
|
||||
end
|
||||
|
||||
local cur_rankType = 0
|
||||
local cur_activiteId = 0
|
||||
local cur_rankIndex = 0
|
||||
|
|
@ -41,6 +55,27 @@ function this.InitData(rankType, fun, id, rankIndex)
|
|||
end, activiteId, cur_rankIndex, isCross)
|
||||
end
|
||||
|
||||
function this.CheckChongRankRewardRp()
|
||||
this.actData = CommonActPageManager.GetData(ActivityTypeDef.KaiFuChongBang)
|
||||
for _, configInfo in ConfigPairs(infoConfig) do
|
||||
local isOpen = true
|
||||
if this.actData and this.actData.activityId == configInfo.GlobalActivity then
|
||||
local openTime = this.actData.startTime + configInfo.OpenTime
|
||||
local closeTime = this.actData.startTime + configInfo.CloseTime
|
||||
--活动没开启页签不显示
|
||||
if openTime > GetTimeStamp() + configInfo.Preview then
|
||||
isOpen = false
|
||||
end
|
||||
else
|
||||
isOpen = false
|
||||
end
|
||||
if isOpen then
|
||||
this.UpdateStatus(configInfo.Id)
|
||||
else
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--请求排行榜下面数据
|
||||
function this.RequestNextWarPowerPageData(fun)
|
||||
if cur_isMax then
|
||||
|
|
@ -251,21 +286,53 @@ function this.GetNeedRewardData(sort)
|
|||
-- end
|
||||
return needData
|
||||
end
|
||||
function this.UpdateStatus()
|
||||
local temp = TaskManager.GetTypeTaskList(TaskTypeDef.NiuQiChongTian)
|
||||
for k, v in ipairs(temp) do
|
||||
local data = this.GetRewardDataById(v.missionId)
|
||||
if data then
|
||||
data.state = v.state
|
||||
data.progress = v.progress
|
||||
|
||||
function this.UpdateStatus(rankId, func)
|
||||
--local temp = TaskManager.GetTypeTaskList(TaskTypeDef.NiuQiChongTian)
|
||||
this.canGet = 0
|
||||
NetManager.GetRankTimesStatusRequest(rankId, function(msg)
|
||||
local datas = this.GetRewardDataById(rankId)
|
||||
for i = 1, #msg.list do
|
||||
local data = datas[i]
|
||||
if data then
|
||||
if data.value > msg.times then
|
||||
data.state = 0
|
||||
elseif msg.list[i] == 1 then
|
||||
data.state = 2
|
||||
else
|
||||
data.state = 1
|
||||
this.canGet = this.canGet + 1
|
||||
end
|
||||
data.progress = msg.times
|
||||
end
|
||||
end
|
||||
end
|
||||
if func then
|
||||
func()
|
||||
end
|
||||
end)
|
||||
end
|
||||
function this.GetRewardDataById(id)
|
||||
for k, v in ipairs(this.rewardData) do
|
||||
|
||||
function this.SetRewardDataState(id, state)
|
||||
for k, v in pairs(this.rewardData) do
|
||||
if v.id == id then
|
||||
return v
|
||||
--LogError("1修改状态:" .. v.state .. "/" .. state .. "/" .. this.canGet)
|
||||
if v.state == 1 and state ~= 1 then
|
||||
--LogError("2修改状态:" .. v.state .. "/" .. state .. "/" .. this.canGet)
|
||||
this.canGet = this.canGet - 1
|
||||
end
|
||||
v.state = state
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function this.GetRewardDataById(id)
|
||||
local needData = {}
|
||||
for k, v in pairs(this.rewardData) do
|
||||
if v.Sort == id then
|
||||
table.insert(needData, v)
|
||||
end
|
||||
end
|
||||
return needData
|
||||
end
|
||||
|
||||
return this
|
||||
|
|
|
|||
Loading…
Reference in New Issue