bug修复

This commit is contained in:
xiekaidong 2023-09-19 18:11:52 +08:00
parent 72e966f8c1
commit 466aee0b61
6 changed files with 36 additions and 4 deletions

View File

@ -17,6 +17,7 @@ ItemConst.ITEM_ID_RANDOM_FRAGMENT = 19
ItemConst.ITEM_ID_ARENA_BOUNTY_EXP = 21 ItemConst.ITEM_ID_ARENA_BOUNTY_EXP = 21
ItemConst.ITEM_ID_ARENA_TICKET = 22 ItemConst.ITEM_ID_ARENA_TICKET = 22
ItemConst.ITEM_ID_FOURTEEN_DAY_EXCHANGE = 51 ItemConst.ITEM_ID_FOURTEEN_DAY_EXCHANGE = 51
ItemConst.ITEM_ID_BOSS_RUSH = 52
ItemConst.ITEM_ID_GLOD_WING = 49 ItemConst.ITEM_ID_GLOD_WING = 49
ItemConst.ITEM_ID_SLIVER_WING = 50 ItemConst.ITEM_ID_SLIVER_WING = 50
ItemConst.ITEM_ID_RUNES = 55 ItemConst.ITEM_ID_RUNES = 55

View File

@ -125,7 +125,7 @@ function ActPvpMatchResultUI:refreshPlayerInfos()
end end
if not self.playerHeadCell then if not self.playerHeadCell then
self.playerHeadCell = CellManager:addCellComp(uiMap["act_pvp_match_result_ui.match_result.match.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL) self.playerHeadCell = CellManager:addCellComp(uiMap["act_pvp_match_result_ui.match_result.self.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL)
end end
self.playerHeadCell:refresh(DataManager.PlayerData:getUsingAvatarId(), DataManager.PlayerData:getUsingFrameId()) self.playerHeadCell:refresh(DataManager.PlayerData:getUsingAvatarId(), DataManager.PlayerData:getUsingFrameId())
uiMap["act_pvp_match_result_ui.match_result.self.info.tx_name"]:setText(DataManager.PlayerData:getNickname()) uiMap["act_pvp_match_result_ui.match_result.self.info.tx_name"]:setText(DataManager.PlayerData:getNickname())

View File

@ -173,20 +173,31 @@ end
function ActBossRushData:getIsOpen() function ActBossRushData:getIsOpen()
if GFunc.isShenhe() then if GFunc.isShenhe() then
self.isOpen = false
return false return false
end end
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.ACTIVITY, true) then if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.ACTIVITY, true) then
self.isOpen = false
return false return false
end end
if Time:getServerTime() <= DataManager:getRegisterTs() + self:getConditionDay() then -- 前14天的号看不到 if Time:getServerTime() <= DataManager:getRegisterTs() + self:getConditionDay() then -- 前14天的号看不到
if self.fightCount > 0 or self.proBounght or self.utralBounght then if self.fightCount > 0 or self.proBounght or self.utralBounght then
-- 兼容已参与的玩家 -- 兼容已参与的玩家
else else
self.isOpen = false
return false return false
end end
end end
local time = Time:getServerTime() local time = Time:getServerTime()
return self.endTime > time and time > self.startTime local isOpen = false
if self.endTime > time and time > self.startTime then
isOpen = true
end
if self.isOpen == false and isOpen then -- 没开->开
DataManager.BagData.ItemData:clearItemCount(GConst.ItemConst.ITEM_ID_BOSS_RUSH)
end
self.isOpen = isOpen
return isOpen
end end
function ActBossRushData:getRp() function ActBossRushData:getRp()

View File

@ -116,17 +116,29 @@ end
function ActPvpData:getIsOpen() function ActPvpData:getIsOpen()
if GFunc.isShenhe() or not self.endTime then if GFunc.isShenhe() or not self.endTime then
self.isOpen = false
return false return false
end end
if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.ACTIVITY, true) then if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.ACTIVITY, true) then
self.isOpen = false
return false return false
end end
if Time:getServerTime() <= DataManager:getRegisterTs() + self:getConditionDay() then -- 前14天的号看不到 if Time:getServerTime() <= DataManager:getRegisterTs() + self:getConditionDay() then -- 前14天的号看不到
self.isOpen = false
return false return false
end end
local time = Time:getServerTime() local time = Time:getServerTime()
return self.endTime > time and time > self.startTime local isOpen = false
if self.endTime > time and time > self.startTime then
isOpen = true
end
if self.isOpen == false and isOpen then -- 没开->开
DataManager.ShopData:resetGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, PRO_ACT_ID)
DataManager.ShopData:resetGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, UTRAL_ACT_ID)
end
self.isOpen = isOpen
return isOpen
end end
function ActPvpData:getRemainTime() function ActPvpData:getRemainTime()

View File

@ -231,6 +231,15 @@ function ItemData:_addItemNumById(id, num)
self:setDirty() self:setDirty()
end end
-- 清空道具,用于活动重开的时候清除对应道具
function ItemData:clearItemCount(id)
if not self.items[id] then
return
end
self.items[id]:setNum(0)
self:setDirty()
end
function ItemData:setDirty() function ItemData:setDirty()
self.data.dirty = not self.data.dirty self.data.dirty = not self.data.dirty
end end

View File

@ -42,7 +42,6 @@ end
-- 设置数量 -- 设置数量
function ItemEntity:setNum(num) function ItemEntity:setNum(num)
Logger.logHighlight("设置:"..num)
self.data.num = num self.data.num = num
self:setDirty() self:setDirty()
end end