探索特权修改提交
parent
22367a5573
commit
ceeef789ed
|
@ -2788,6 +2788,24 @@ function CheckGMIsOpen(type,value)
|
|||
end
|
||||
|
||||
|
||||
function GetTaiChuPriLv()
|
||||
local lv=0
|
||||
local datas=ConfigManager.GetAllConfigsDataByKey(ConfigName.GMMaster,"Type",9)
|
||||
if datas then
|
||||
table.sort(datas,function(a,b)
|
||||
return a.Id<b.Id
|
||||
end)
|
||||
for i = 1, #datas do
|
||||
local buy=OperatingManager.IsBuyGift(datas[i].PackID)
|
||||
if buy then
|
||||
lv=i
|
||||
end
|
||||
end
|
||||
end
|
||||
return lv
|
||||
end
|
||||
|
||||
|
||||
---检测功能开启方法
|
||||
function CheckFunctionOpen(_funId)
|
||||
local data = ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,_funId)
|
||||
|
|
|
@ -104,7 +104,9 @@ local function _CompareCondition(type, condition, value)
|
|||
-- LogError("DynamicActivityManager.curLevel=="..DynamicActivityManager.curLevel.." condition=="..condition)
|
||||
return DynamicActivityManager.curLevel >= condition
|
||||
elseif type==11 then
|
||||
-- body
|
||||
|
||||
elseif type==12 then
|
||||
return GetTaiChuPriLv() >= condition
|
||||
else
|
||||
return false
|
||||
end
|
||||
|
@ -138,6 +140,9 @@ function PrivilegeManager.GetPrivilegeNumberById(privilegeId, value)
|
|||
if not _CompareCondition(unlockType, condition[1], value) then break end
|
||||
-- 保存当前值
|
||||
tValue = condition[2]
|
||||
-- if privilegeId==4 or privilegeId==33 then
|
||||
-- LogError("tValue==========="..tValue)
|
||||
-- end
|
||||
end
|
||||
-- 根据类型返回相应得数值
|
||||
if privilegeData.IfFloat == 1 then
|
||||
|
@ -155,14 +160,25 @@ function PrivilegeManager.GetPrivilegeNumber(privilegeType, conValue)
|
|||
local privilegeList = this._PrivilegeTypeList[privilegeType]
|
||||
if not privilegeList then return 0 end
|
||||
local value = 0
|
||||
-- if privilegeType==4 or privilegeType==33 then
|
||||
-- LogError("privilegeType==========="..privilegeType)
|
||||
-- end
|
||||
|
||||
for _, config in ipairs(privilegeList) do
|
||||
local privilegeId = config.Id
|
||||
-- if privilegeType==4 or privilegeType==33 then
|
||||
-- LogError("id=============="..privilegeId)
|
||||
-- end
|
||||
local v = this.GetPrivilegeNumberById(privilegeId, conValue)
|
||||
-- -1表示一直存在,无限次数
|
||||
if v < 0 then return v end
|
||||
-- 所有值相同类型值相加
|
||||
value = value + v
|
||||
end
|
||||
-- if privilegeType==4 or privilegeType==33 then
|
||||
-- LogError("value=============="..value)
|
||||
-- end
|
||||
|
||||
return value
|
||||
end
|
||||
|
||||
|
@ -222,7 +238,6 @@ end
|
|||
function PrivilegeManager.GetPrivilegeRemainValue(privilegeType)
|
||||
local originalValue = this.GetPrivilegeNumber(privilegeType)
|
||||
local usedTimes = this.GetPrivilegeUsedTimes(privilegeType)
|
||||
--LogBlue(string.format("originalValue:%s, usedTimes:%s",tostring(originalValue),tostring(usedTimes)))
|
||||
local remainNum = originalValue - usedTimes
|
||||
-- 剩余次数不会小于0,修正
|
||||
if remainNum < 0 then
|
||||
|
|
Loading…
Reference in New Issue