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