跨服相关修改

dev_chengFeng
yuanshuai 2022-04-25 17:57:31 +08:00
parent 21342783bd
commit 55833325bf
4 changed files with 42 additions and 2 deletions

View File

@ -1700,6 +1700,8 @@ FUNCTION_OPEN_TYPE = {
Gem = 122,--命格
FlyUp = 125,--飞升
HOMELAND = 124,--家园 浮生们
CROSS_CART=127,--跨服聊天
CROSS_RANK=128,--跨服排行榜
}
TaskGetBtnIconDef = {

View File

@ -2693,3 +2693,41 @@ function ConnectTable(curTable,targetTable)
end
return curTable
end
---检测功能开启方法
function CheckFunctionOpen(_funId)
local data = ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,_funId)
-- 当前玩家等级
local playerLv = PlayerManager.level
--开启规则
--1关卡开启
--2玩家等级开启
--3鸿蒙阵神将等级
local openRule = data.OpenRules
if openRule then
if openRule[1] == 1 and not FightPointPassManager.IsFightPointPass(openRule[2]) then -- 关卡开启
return false
elseif openRule[1] == 2 and playerLv < openRule[2] then -- 等级开启
return false
elseif openRule[1] == 3 and HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv) < openRule[2] then -- 鸿蒙阵神将共鸣等级
return false
end
end
--1#创角
--2#开服
local curTime=GetTimeStamp()
if data.IfOpen then
local type=data.IfOpen[1]
local dayNum=data.IfOpen[2]
if type==1 then
if curTime<PlayerManager.userCreateTime+dayNum*24*60*60 then
return false
end
elseif type==2 then
if curTime<PlayerManager.GetServerOpenTime()+dayNum*24*60*60 then
return false
end
end
end
return true
end

View File

@ -111,7 +111,7 @@ function this.IsChannelOpen(channel)
end
elseif channel == CHAT_CHANNEL.JUMP_SERVER then
-- 开服前七天, 未跨服都显示未跨服
if GetTimeStamp() - PlayerManager.GetServerOpenTime() < 7*24*60*60 or PlayerManager.isCross == 0 then
if not CheckFunctionOpen(FUNCTION_OPEN_TYPE.CROSS_CART) or PlayerManager.isCross == 0 then
return false, "未划分跨服分组"
end
end

View File

@ -77,7 +77,7 @@ end
function this.PageTabIsLockCheck(index)
if index == 2 then
-- 开服前七天, 未跨服都不打开跨服排行榜
if GetTimeStamp() - PlayerManager.GetServerOpenTime() < 7*24*60*60 or PlayerManager.isCross == 0 then
if not CheckFunctionOpen(FUNCTION_OPEN_TYPE.CROSS_RANK) or PlayerManager.isCross == 0 then
return true, "未划分跨服分组!"
end
else