From d8801cae6c53d567bff632e25bfc030516c16243 Mon Sep 17 00:00:00 2001 From: wangzhenxing Date: Thu, 29 Jul 2021 17:34:40 +0800 Subject: [PATCH] =?UTF-8?q?[=E7=A7=B0=E5=8F=B7]=3D=3D=3D=3D=3D=3D=3D=3D=3D?= =?UTF-8?q?=3D=3D=3D=3D=E6=B7=BB=E5=8A=A0=E7=BD=97=E6=B5=AE=E4=BA=89?= =?UTF-8?q?=E9=94=8B=E7=A7=B0=E5=8F=B7=20=E8=8E=B7=E5=BE=97=20=E5=8F=8A=20?= =?UTF-8?q?=E5=88=B0=E6=97=B6=20=E5=90=8E=E6=B6=88=E6=81=AF=E6=8E=A8?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Net/IndicationManager.lua | 12 ++++++++++++ .../~Lua/Modules/Player/PlayerManager.lua | 12 ++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Net/IndicationManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/IndicationManager.lua index 83d0f59894..43e0ed341b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/IndicationManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/IndicationManager.lua @@ -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() diff --git a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua index fb3a93da55..ad7f3cefff 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua @@ -430,7 +430,10 @@ function this.InitSkinTitleMountData(userSkinList,userTitleList,userMountList) local singData = {} singData.titleId = userTitleList[i].titleId singData.overTime = userTitleList[i].overTime - this.userTitleList[singData.titleId] = singData + 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 @@ -464,7 +467,11 @@ function this.SetPlayerTitleTime(id,validTime) if this.userTitleList then if validTime then--不为空时是设置时间 没有会新加数据 if this.userTitleList[id] then - this.userTitleList[id].overTime = validTime + 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