[称号]=============添加罗浮争锋称号 获得 及 到时 后消息推送
parent
8c1130e89f
commit
d8801cae6c
|
@ -138,8 +138,20 @@ function this.RegisterMessage(network)
|
|||
socket:RegistNetMessage(MessageTypeProto_pb.wishDrawCardIndication, this.WishDrawCardInfoIndication)
|
||||
-- --心愿抽卡信息推送
|
||||
socket:RegistNetMessage(MessageTypeProto_pb.ENDLESS_TREASURE_REFRESH_INDICATION, this.EenlessTreasureRefreshIndication)
|
||||
--称号激活推送
|
||||
socket:RegistNetMessage(MessageTypeProto_pb.USER_TITLE_ADD_INDICATION, this.UserTitleAddIndicaiton)
|
||||
end
|
||||
|
||||
--后端推送激活的称号
|
||||
function this.UserTitleAddIndicaiton(buff)
|
||||
local data = buff:DataByte()
|
||||
local msg = PlayerInfoProto_pb.UserTitleAddIndication()
|
||||
msg:ParseFromString(data)
|
||||
LogRed(" id=="..msg.decorationId.." time=="..msg.time)
|
||||
PlayerManager.SetPlayerTitleTime(msg.decorationId,msg.time)
|
||||
end
|
||||
|
||||
|
||||
--后端推送福利红包数据
|
||||
function this.EenlessTreasureRefreshIndication(buffer)
|
||||
local data = buffer:DataByte()
|
||||
|
|
|
@ -430,8 +430,11 @@ function this.InitSkinTitleMountData(userSkinList,userTitleList,userMountList)
|
|||
local singData = {}
|
||||
singData.titleId = userTitleList[i].titleId
|
||||
singData.overTime = userTitleList[i].overTime
|
||||
LogRed(" titleid== "..singData.titleId.." time=="..singData.overTime.." "..GetTimeStamp())
|
||||
if singData.overTime==0 or singData.overTime>GetTimeStamp() then
|
||||
this.userTitleList[singData.titleId] = singData
|
||||
end
|
||||
end
|
||||
this.userMountList = {}--[id] = {mountId , overTime}
|
||||
for i = 1, #userMountList do
|
||||
local singData = {}
|
||||
|
@ -464,7 +467,11 @@ function this.SetPlayerTitleTime(id,validTime)
|
|||
if this.userTitleList then
|
||||
if validTime then--不为空时是设置时间 没有会新加数据
|
||||
if this.userTitleList[id] then
|
||||
if validTime==-1 then
|
||||
this.userTitleList[id] = nil
|
||||
else
|
||||
this.userTitleList[id].overTime = validTime
|
||||
end
|
||||
else
|
||||
local singData = {}
|
||||
singData.titleId = id
|
||||
|
@ -473,6 +480,7 @@ function this.SetPlayerTitleTime(id,validTime)
|
|||
this.SetPlayerTitleRedPoint(PlayerTitleRideSkinRedPointTypeStr.Title,1)
|
||||
end
|
||||
else--为空时是删除数据 倒计时结束时
|
||||
LogRed("time==nil")
|
||||
if this.userTitleList[id] then
|
||||
this.userTitleList[id] = nil
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue