From ea4661b254417487bcf9a4dd45ae76a7ac1f518c Mon Sep 17 00:00:00 2001 From: ZhangBiao Date: Fri, 5 Nov 2021 15:50:49 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=97=A0=E5=B0=BD=E5=89=AF=E6=9C=AC?= =?UTF-8?q?=E3=80=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Carbon/EndLessCarbonPanel.lua | 2 +- .../~Lua/Modules/Map/View/EndLessMapView.lua | 5 +++-- .../~Lua/Modules/Mission/MissionManager.lua | 2 +- .../~Lua/Modules/Player/PlayerManager.lua | 11 +++++++++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Carbon/EndLessCarbonPanel.lua b/Assets/ManagedResources/~Lua/Modules/Carbon/EndLessCarbonPanel.lua index c5fef4a5f0..251a664a28 100644 --- a/Assets/ManagedResources/~Lua/Modules/Carbon/EndLessCarbonPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Carbon/EndLessCarbonPanel.lua @@ -221,8 +221,8 @@ function this.ShowCountTime() tempLeftTime = leftTime end if leftTime < 0 then + PlayerManager.RequestEnergy() leftTime = 0 - PlayerManager.RefreshItemNumBySerTime() end this.actCountTime.text = GetTimeMaoHaoStrBySeconds(math.floor(leftTime)).."后恢复1点" end, 1, -1, true) diff --git a/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua b/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua index de390050d2..b1d260f4ca 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/View/EndLessMapView.lua @@ -381,6 +381,7 @@ function EndLessMapView:OnShow() EndLessMapManager.openedFormat = false + PlayerManager.RequestEnergy() this.isPanelClose = false -- 刷新倒计时显示 this:ShowCountTime() @@ -765,9 +766,9 @@ function EndLessMapView:ShowCountTime() this:RefreshEnergyShow() tempLeftTime = leftTime end - if leftTime < 0 then + if leftTime <= 0 then + PlayerManager.RequestEnergy() leftTime = 0 - PlayerManager.RefreshItemNumBySerTime() end if not this.isPanelClose then this.actCountTime.text = GetTimeMaoHaoStrBySeconds(math.floor(leftTime)).."后恢复1点" diff --git a/Assets/ManagedResources/~Lua/Modules/Mission/MissionManager.lua b/Assets/ManagedResources/~Lua/Modules/Mission/MissionManager.lua index e22f108b22..06f6a1c8ec 100644 --- a/Assets/ManagedResources/~Lua/Modules/Mission/MissionManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Mission/MissionManager.lua @@ -449,7 +449,7 @@ local funcList = { --事件点触发 function this.EventPointTrigger(eventId) Game.GlobalEvent:DispatchEvent(GameEvent.Map.RefreshHeroHp,false,nil,false) - PlayerManager.RefreshItemNumBySerTime() + PlayerManager.RequestEnergy() MyPCall(function () Log("EventPointTrigger中得到的事件ID " .. eventId) if eventId == 0 or eventId < 0 then diff --git a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua index c0e420d364..f31ee89641 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/PlayerManager.lua @@ -176,10 +176,9 @@ function this.RefreshItemNumBySerTime() end end end -local nextRefreshTime = 0 function this.RefreshItemNumById(itemId) if not BagManager.bagDatas[itemId] then return end - nextRefreshTime = BagManager.bagDatas[itemId].nextFlushTime + local nextRefreshTime = BagManager.bagDatas[itemId].nextFlushTime if(nextRefreshTime) then if this.serverTime >= nextRefreshTime and nextRefreshTime ~= 0 then if isAddItem[itemId] then @@ -213,6 +212,14 @@ function this.RefreshItemNumById(itemId) end end this.curLevelAndExp = {} + +--无尽请求行动力刷新 +function this.RequestEnergy() + NetManager.RefreshEnergyRequest({1},function() + -- LogWarn("无尽请求行动力刷新") + end) +end + function this.BcakUpdateUserExp(_msg) if not UIManager.IsOpen(UIName.FightMopUpEndPanel) then Log("后端更新玩家等级 和 经验 ".._msg.level.." ".._msg.exp)