--
local SERVER_DAY_FUNC_LOCK_QI = 1                       --炼气
local SERVER_DAY_FUNC_LOCK_NEIGONG = 2			    	-- 内功
local SERVER_DAY_FUNC_LOCK_SERVANT = 3		        	-- 觉醒
local SERVER_DAY_FUNC_LOCK_JINGLIAN = 4			    	-- 神品精炼
local SERVER_DAY_FUNC_LOCK_SHENWEN = 5			    	-- 神纹
local SERVER_DAY_FUNC_LOCK_WUGONG = 6			    	-- 自创武功
local SERVER_DAY_FUNC_LOCK_YUANLING = 7		    		-- 元灵  铸灵
local SERVER_DAY_FUNC_LOCK_LINGSHOU = 8			    	-- 灵兽
local SERVER_DAY_FUNC_LOCK_SHENBING = 9				    -- 神兵
local SERVER_DAY_FUNC_LOCK_RONGLIAN = 10				-- 熔炼
local SERVER_DAY_FUNC_LOCK_FANLISHANGCHENG = 11	    	-- 返利商城
local SERVER_DAY_FUNC_LOCK_ENEMY_INVADE = 12			-- 豪杰会(外敌入侵)
local SERVER_DAY_FUNC_LOCK_PRINCES_WAR = 13			    -- 诸侯战争
local SERVER_DAY_FUNC_LOCK_TASK_CLUB = 14				-- 任务集会所
local SERVER_DAY_FUNC_LOCK_INSTANCE_ENTRANCE = 15		-- 副本挑战
local SERVER_DAY_FUNC_LOCK_TREASURE_HUNT = 16			-- 全服寻宝
local SERVER_DAY_FUNC_LOCK_PRIMORD_SPIRIT = 17			-- 元神
-- 第三轮新增
local SERVER_DAY_FUNC_LOCK_SUB_PRO	= 18	            -- 副职业
local SERVER_DAY_FUNC_LOCK_DUANZAO_DJTS	= 19	        -- 装备提升
local SERVER_DAY_FUNC_LOCK_DUANZAO_PZTS	= 20	        -- 品质提升
local SERVER_DAY_FUNC_LOCK_DUANZAO_PSSJ	= 21	        -- 配饰升级
local SERVER_DAY_FUNC_LOCK_DUANZAO_ZBZJ	= 22	        -- 装备追加
local SERVER_DAY_FUNC_LOCK_DUANZAO_MPZJ	= 23	        -- 马匹追加
local SERVER_DAY_FUNC_LOCK_DUANZAO_ZBKD	= 24	        -- 装备开洞
local SERVER_DAY_FUNC_LOCK_DUANZAO_XQBS	= 25	        -- 镶嵌宝石
local SERVER_DAY_FUNC_LOCK_DUANZAO_FBKD	= 26	        -- 法宝开洞
local SERVER_DAY_FUNC_LOCK_DUANZAO_LHXQ	= 27	        -- 龙魂镶嵌
local SERVER_DAY_FUNC_LOCK_DUANZAO_LHSJ	= 28	        -- 龙魂升级
local SERVER_DAY_FUNC_LOCK_DUANZAO_LHFJ	= 29	        -- 龙魂分解
local SERVER_DAY_FUNC_LOCK_DUANZAO_LHHC	= 30	        -- 龙魂合成
local SERVER_DAY_FUNC_LOCK_DUANZAO_BSHC	= 31	        -- 宝石合成
local SERVER_DAY_FUNC_LOCK_DUANZAO_XYBS	= 32	        -- 玄元宝石
local SERVER_DAY_FUNC_LOCK_DUANZAO_SHDZ	= 33	        -- 神魂锻造
local SERVER_DAY_FUNC_LOCK_DUANZAO_SHGH	= 34	        -- 神魂固化
local SERVER_DAY_FUNC_LOCK_DUANZAO_ZBCL	= 35	        -- 装备淬炼
local SERVER_DAY_FUNC_LOCK_DUANZAO_CLGH	= 36	        -- 淬炼固化
local SERVER_DAY_FUNC_LOCK_DUANZAO_SY = 37 	            -- 神佑
local SERVER_DAY_FUNC_LOCK_DUANZAO_JC = 38	            -- 加持
local SERVER_DAY_FUNC_LOCK_DUANZAO_SQRH	= 39	        -- 神器融合  ==服务端的神器
local SERVER_DAY_FUNC_LOCK_DUANZAO_FJXF	= 40	        -- 分解修复  ==服务端的神器
-- 第四轮新增
local SERVER_DAY_FUNC_LOCK_FIRST_PAY = 41	            -- 首冲
local SERVER_DAY_FUNC_LOCK_LUCKY_DRAW = 42	            -- 超值豪礼
local SERVER_DAY_FUNC_LOCK_FULI	= 43	                -- 福利面板

--18到39的功能的value是转世+等级。转世 * 1000 + 等级
-- [SERVER_DAY_FUNC_LOCK_SUB_PRO] = { ["Day"] = 0, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_DJTS] = { ["Day"] = 40, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_PZTS] = { ["Day"] = 30, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_PSSJ] = { ["Day"] = 20, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_ZBZJ] = { ["Day"] = 10, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_MPZJ] = { ["Day"] = 5, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_ZBKD] = { ["Day"] = 6, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_XQBS] = { ["Day"] = 7, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_FBKD] = { ["Day"] = 8, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_LHXQ] = { ["Day"] = 9, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_LHSJ] = { ["Day"] = 10, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_LHFJ] = { ["Day"] = 11, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_LHHC] = { ["Day"] = 12, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_BSHC] = { ["Day"] = 13, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_XYBS] = { ["Day"] = 14, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_SHDZ] = { ["Day"] = 15, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_SHGH] = { ["Day"] = 28, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_ZBCL] = { ["Day"] = 28, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_CLGH] = { ["Day"] = 28, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_SY] = { ["Day"] = 28, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_JC] = { ["Day"] = 28, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_SQRH] = { ["Day"] = 28, ["Value"] = 2120, },
-- [SERVER_DAY_FUNC_LOCK_DUANZAO_FJXF] = { ["Day"] = 28, ["Value"] = 2120, },
	
    --18到43的功能的value是转世+等级。转世 * 1000 + 等级
    -- [SERVER_DAY_FUNC_LOCK_FIRST_PAY] = {
        -- ["Day"] = 10,
        -- ["Value"] = 50,
    -- },

    -- [SERVER_DAY_FUNC_LOCK_LUCKY_DRAW] = {
        -- ["Day"] = 10,
        -- ["Value"] = 60,
    -- },

    -- [SERVER_DAY_FUNC_LOCK_FULI] = {
        -- ["Day"] = 10,
        -- ["Value"] = 70,
    -- },
	
--Day：开服天数
--Value：开通该功能所需要的条件，系统不同，所需条件的值不同  CurServerTypeClose  屏蔽
--自创武功value：四门炼气达到的分数、神品精炼value：自创武功达到境界、内功心法value：自身装备神品精炼总等级、神纹value：内功心法总值、灵兽value：内功心法总值、元灵value：神纹积分
-- ["NoPreview"] = 1,
-- 表示不用在系统预告中显示，配置为0表示显示系统预告，可缺省默认为0
-- 新增字段["PreviewStartDay"]，表示该功能在开服N天后才显示系统预告
-- STR_FUNC_PREVIEW_  文字
local FunctionLockInfo = {

	-- 炼气
    [SERVER_DAY_FUNC_LOCK_QI] = {
        ["Day"] = 27,
		["PreviewStartDay"] = 25,
    },
	-- 内功
    [SERVER_DAY_FUNC_LOCK_NEIGONG] = {
        ["Day"] = 69,
        ["Value"] = 70,
		["PreviewStartDay"] = 67,
    },
	-- 觉醒
    [SERVER_DAY_FUNC_LOCK_SERVANT] = {
        ["CurServerTypeClose"]=1,
    },
	-- 神品精炼
    [SERVER_DAY_FUNC_LOCK_JINGLIAN] = {
        ["Day"] = 55,
        ["Value"] = 3,
		["PreviewStartDay"] = 53,
    },
	-- 神纹
    [SERVER_DAY_FUNC_LOCK_SHENWEN] = {
        ["Day"] = 83,
        ["Value"] = 2000,
		["PreviewStartDay"] = 81,
    },
	-- 自创武功
    [SERVER_DAY_FUNC_LOCK_WUGONG] = {
        ["Day"] = 41,
        ["Value"] = 360,
		["PreviewStartDay"] = 39,
    },
-- 元灵
    [SERVER_DAY_FUNC_LOCK_YUANLING] = {
        ["Day"] = 99,
        ["Value"] = 100000,
		["PreviewStartDay"] = 97,
    },
	-- 灵兽
    [SERVER_DAY_FUNC_LOCK_LINGSHOU] = {
        ["Day"] = 83,
        ["Value"] = 2000,
		["PreviewStartDay"] = 81,
    },
	-- 神兵 9
    [SERVER_DAY_FUNC_LOCK_SHENBING] = {
        ["NoPreview"] = 1,
        ["Day"] = 0,
        ["Value"] = 500,
    },
	-- 熔炼 10
    [SERVER_DAY_FUNC_LOCK_RONGLIAN] = {
        ["Day"] = 9999,
		["NoPreview"] = 1,
        ["CurServerTypeClose"]=1,
		["PreviewStartDay"] = 9999,
    },
	-- 返利商城 11
    [SERVER_DAY_FUNC_LOCK_FANLISHANGCHENG] = {
        ["Day"] = 0,
        ["NoPreview"] = 1,
    },
	-- 豪杰会(外敌入侵) 12
    [SERVER_DAY_FUNC_LOCK_ENEMY_INVADE] = {
        ["Day"] = 0,
        ["NoPreview"] = 1,
    },
	
	
-- 诸侯战争 13
    [SERVER_DAY_FUNC_LOCK_PRINCES_WAR] = {
        ["CurServerTypeClose"]=1,
		["PreviewStartDay"] = 9999,
    },
-- 任务集会所 14
    [SERVER_DAY_FUNC_LOCK_TASK_CLUB] = {
        ["CurServerTypeClose"]=1,
		["PreviewStartDay"] = 9999,
    },
	-- 副本挑战 15
    [SERVER_DAY_FUNC_LOCK_INSTANCE_ENTRANCE] = {
        ["Day"] = 0,
        ["NoPreview"] = 1,
    },
	
	-- 全服寻宝 16
    [SERVER_DAY_FUNC_LOCK_TREASURE_HUNT] = {
        ["CurServerTypeClose"]=1,
    },
	
	-- 元神 17
    [SERVER_DAY_FUNC_LOCK_PRIMORD_SPIRIT] = {
        ["CurServerTypeClose"]=1,
    },
	-- 副职业 18
    [SERVER_DAY_FUNC_LOCK_SUB_PRO] = {
		-- ["CurServerTypeClose"]=1,
		["Day"] = 0, 
		["Value"] = 30, 
    },
	-- 装备提升 19
    [SERVER_DAY_FUNC_LOCK_DUANZAO_DJTS] = {
		["Day"] = 0, 
		["Value"] = 30, 
    },
	-- 品质提升 20
    [SERVER_DAY_FUNC_LOCK_DUANZAO_PZTS] = {
		["Day"] = 0, 
		["Value"] = 45, 
    },
	-- 配饰升级21
    [SERVER_DAY_FUNC_LOCK_DUANZAO_PSSJ] = {
		["Day"] = 0, 
		["Value"] = 120, 
    },
	-- 装备追加 22
    [SERVER_DAY_FUNC_LOCK_DUANZAO_ZBZJ] = {
		["Day"] = 0, 
		["Value"] = 50, 
    },
	-- 马匹追加 23
    [SERVER_DAY_FUNC_LOCK_DUANZAO_MPZJ] = {
		["Day"] = 0, 
		["Value"] = 50, 
    },
	-- 装备开洞 24
    [SERVER_DAY_FUNC_LOCK_DUANZAO_ZBKD] = {
		["Day"] = 0, 
		["Value"] = 80, 
    },
	-- 镶嵌宝石 25
    [SERVER_DAY_FUNC_LOCK_DUANZAO_XQBS] = {
		["Day"] = 0, 
		["Value"] = 80, 
    },
	-- 法宝开洞 26
    [SERVER_DAY_FUNC_LOCK_DUANZAO_FBKD] = {
		["Day"] = 0, 
		["Value"] = 80, 
    },
	-- 龙魂镶嵌 27
    [SERVER_DAY_FUNC_LOCK_DUANZAO_LHXQ] = {
		["Day"] = 0, 
		["Value"] = 1, 
    },
	-- 龙魂升级 28
    [SERVER_DAY_FUNC_LOCK_DUANZAO_LHSJ] = {
		["Day"] = 0, 
		["Value"] = 1, 
    },
	-- 龙魂分解 29
    [SERVER_DAY_FUNC_LOCK_DUANZAO_LHFJ] = {
		["Day"] = 0, 
		["Value"] = 1, 
    },
	-- 龙魂合成 30
    [SERVER_DAY_FUNC_LOCK_DUANZAO_LHHC] = {
		["Day"] = 00, 
		["Value"] = 1, 
    },
	-- 宝石合成 31
    [SERVER_DAY_FUNC_LOCK_DUANZAO_BSHC] = {
		["Day"] = 0, 
		["Value"] = 95, 
    },
	-- 玄元宝石 32
    [SERVER_DAY_FUNC_LOCK_DUANZAO_XYBS] = {
		["Day"] = 0, 
		["Value"] = 95, 
    },
	-- 神魂锻造 33
    [SERVER_DAY_FUNC_LOCK_DUANZAO_SHDZ] = {
		["Day"] = 0, 
		["Value"] = 1100, 
    },
	-- 神魂固化 34
    [SERVER_DAY_FUNC_LOCK_DUANZAO_SHGH] = {
		["Day"] = 0, 
		["Value"] = 1100, 
    },
	-- 装备淬炼 35
    [SERVER_DAY_FUNC_LOCK_DUANZAO_ZBCL] = {
		["Day"] = 0, 
		["Value"] = 1100, 
    },
	-- 淬炼固化 36
    [SERVER_DAY_FUNC_LOCK_DUANZAO_CLGH] = {
		["Day"] = 0, 
		["Value"] = 1100, 
    },
	-- 神佑 37
    [SERVER_DAY_FUNC_LOCK_DUANZAO_SY] = {
		["Day"] = 0, 
		["Value"] = 60, 
    },
	-- 加持 38
    [SERVER_DAY_FUNC_LOCK_DUANZAO_JC] = {
		["Day"] = 0, 
		["Value"] = 60, 
    },
	-- 神器融合 39
    [SERVER_DAY_FUNC_LOCK_DUANZAO_SQRH] = {
		["Day"] = 27, 
		["Value"] = 100, 
		-- ["NoPreview"] = 1,
		["PreviewStartDay"] = 27,
    },
	-- 分解修复 
    [SERVER_DAY_FUNC_LOCK_DUANZAO_FJXF] = {
		["Day"] = 27, 
		["Value"] = 100, 
		-- ["NoPreview"] = 1,
		["PreviewStartDay"] = 27,
    },
	
	-- 首冲 41
    [SERVER_DAY_FUNC_LOCK_FIRST_PAY] = {
		["Day"] = 0, 
		["Value"] = 50, 
    },
	-- 超值豪礼 42
    -- [SERVER_DAY_FUNC_LOCK_LUCKY_DRAW] = {
        -- ["CurServerTypeClose"]=1,
    -- },
}
-- 老兵服
local FunctionLockVeteranInfo = {
-- 炼气 1
    [SERVER_DAY_FUNC_LOCK_QI] = {
        ["Day"] = 27,
    },
	-- 自创武功 6
    [SERVER_DAY_FUNC_LOCK_WUGONG] = {
        ["Day"] = 27,
        ["Value"] = 0,
    },
	-- 神品精炼 4
    [SERVER_DAY_FUNC_LOCK_JINGLIAN] = {
        -- ["Day"] = 9999,
        -- ["Value"] = 0,
		["NoPreview"] = 1,
		["CurServerTypeClose"]=1,
    },
	-- 内功  2
    [SERVER_DAY_FUNC_LOCK_NEIGONG] = {
        -- ["Day"] = 9999,
        -- ["Value"] = 0,
		["NoPreview"] = 1,
		["CurServerTypeClose"]=1,
    },
	-- 神纹 5
    [SERVER_DAY_FUNC_LOCK_SHENWEN] = {
        ["Day"] = 27,
        ["Value"] = 0,
    },
	-- 灵兽 8
    [SERVER_DAY_FUNC_LOCK_LINGSHOU] = {
        ["Day"] = 27,
        ["Value"] = 0,
    },
	-- 元灵  铸灵  7
    [SERVER_DAY_FUNC_LOCK_YUANLING] = {
        -- ["Day"] = 9999,
        -- ["Value"] = 0,
		["NoPreview"] = 1,
		["CurServerTypeClose"]=1,
    },
	-- 熔炼  10
    [SERVER_DAY_FUNC_LOCK_RONGLIAN] = {
        -- ["Day"] = 9999,
		["NoPreview"] = 1,
		["CurServerTypeClose"]=1,
    },
-- 任务集会所  14
    [SERVER_DAY_FUNC_LOCK_TASK_CLUB] = {
        -- ["Day"] = 9999,
        -- ["Value"] = 0,
		["NoPreview"] = 1,
		["CurServerTypeClose"]=1,
    },
-- 诸侯战争  13
    [SERVER_DAY_FUNC_LOCK_PRINCES_WAR] = {
        -- ["Day"] = 9999,
		["NoPreview"] = 1,
		["CurServerTypeClose"]=1,
    },
		-- 神器融合 39
    [SERVER_DAY_FUNC_LOCK_DUANZAO_SQRH] = {
		["Day"] = 28, 
		["Value"] = 0, 
		-- ["NoPreview"] = 1,
		-- ["PreviewStartDay"] = 27,
    },

}

-- 通用服务器类别功能开关配置
local FunctionLockInfoDefault = {
  [SERVER_DAY_FUNC_LOCK_DUANZAO_PSSJ] = {
    ["CurServerTypeClose"] = 1,
  },
}

-- 新增
local CoinsServeFuctionPreviewStartDay = 0
local CoinsServeFuctionPreviewEndDay = 999

local function GetFunctionLockInfo(type, key)
    -- 根据服务器类型返回系统预告的开启时间，默认服务器为0
    if type == "StartDay" then
        if UserData_IsCoinsServer() == true or UserData_IsOldSoldierServer() == true then
            return CoinsServeFuctionPreviewStartDay
        end

        return 0
    end

    -- 根据服务器类型返回系统预告的结束时间，默认服务器为0
    if type == "EndDay" then
        if UserData_IsCoinsServer() == true or UserData_IsOldSoldierServer() == true then
            return CoinsServeFuctionPreviewEndDay
        end

        return 0
    end

    local func = FunctionLockInfoDefault
    if UserData_IsCoinsServer() == true then
        func = FunctionLockInfo
    elseif UserData_IsOldSoldierServer() == true then
        func = FunctionLockVeteranInfo
    end

    if func[type] == nil then
        return nil
    end

    if func[type][key] == nil then
        return nil
    end

    return func[type][key]
end

local function Unload()
    FunctionLockInfo = nil
    FunctionLockVeteranInfo = nil
end

local FunctionLock = {
    GetFunctionLockInfo = GetFunctionLockInfo,
    Unload = Unload,
}

-- global
FunctionLock_Unload = FunctionLock.Unload
FunctionLock_GetFunctionLockInfo = FunctionLock.GetFunctionLockInfo
return FunctionLock