【逐胜之巅优化】功能改为在开服指定天数后开启
parent
a552dabd2c
commit
744a0d4e5b
|
@ -44,6 +44,7 @@ import com.ljsd.jieling.netty.cocdex.Tea;
|
|||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.thread.task.RPCWorldServerTask;
|
||||
import config.SSpecialConfig;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
@ -118,6 +119,7 @@ public class GlobalDataManaager implements IManager {
|
|||
continue;
|
||||
}
|
||||
//开服几天后开启
|
||||
if(getServerOpenTimeCompareSpecialTimeResult()){
|
||||
int[]limitDay = sGlobalSystemConfig.getIfOpen();
|
||||
if(limitDay.length>0 && limitDay != null){
|
||||
if( limitDay[0] == 2 ){
|
||||
|
@ -129,6 +131,7 @@ public class GlobalDataManaager implements IManager {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
long endTime = openTimeOfFuntionCache.get(id).getEndTime();
|
||||
if(now > endTime){
|
||||
|
@ -149,16 +152,17 @@ public class GlobalDataManaager implements IManager {
|
|||
long mod = passTims % (diffTime + seasonInterval); // 每个周期的时间+间隔时间
|
||||
if(mod < diffTime ){//新的周期开启 一轮周期的时间
|
||||
//开服几天后开启
|
||||
if(getServerOpenTimeCompareSpecialTimeResult()){
|
||||
int[]limitDay = sGlobalSystemConfig.getIfOpen();
|
||||
if(limitDay.length>0 && limitDay != null){
|
||||
if( limitDay[0] == 2 ){
|
||||
//此时是开服第几天
|
||||
long day = TimeUtils.getGapDaysByTwoTime(GameApplication.serverConfig.getOpenTime(),TimeUtils.getTimeStamp2(TimeUtils.now()))+1;
|
||||
if(day < limitDay[1]){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
openList.add(id);
|
||||
//计算开启时间、关闭时间
|
||||
long turns = passTims / ((diffTime + seasonInterval));
|
||||
|
@ -326,6 +330,7 @@ public class GlobalDataManaager implements IManager {
|
|||
long passTims = now - seasonOpenLong;
|
||||
if(passTims>0){
|
||||
//开服几天后开启
|
||||
if(getServerOpenTimeCompareSpecialTimeResult()){
|
||||
int[]limitDay = sGlobalSystemConfig.getIfOpen();
|
||||
if(limitDay.length>0 && limitDay != null){
|
||||
if( limitDay[0] == 2 ){
|
||||
|
@ -336,6 +341,7 @@ public class GlobalDataManaager implements IManager {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
long mod = passTims % (diffTime + seasonInterval);
|
||||
long turns = passTims / ((diffTime + seasonInterval));
|
||||
if(mod > diffTime ){
|
||||
|
@ -344,6 +350,8 @@ public class GlobalDataManaager implements IManager {
|
|||
long addTim = turns * (diffTime + seasonInterval);
|
||||
timeOpenOfThis =seasonOpenLong+addTim;
|
||||
timeCloseOfThis =seasonEndLong+addTim;
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -489,4 +497,22 @@ public class GlobalDataManaager implements IManager {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从抽卡获取服务器开服时间
|
||||
* @return
|
||||
*/
|
||||
public boolean getServerOpenTimeCompareSpecialTimeResult(){
|
||||
// 开服时间
|
||||
long serverOpenTime = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime());
|
||||
// 根据格式获取时间戳 例子 :20210720
|
||||
int value = SSpecialConfig.getIntegerValue(SSpecialConfig.DATA_OF_UNLOCK_THE_EVEREST);
|
||||
long time = TimeUtils.stringToTimeLong(String.valueOf(value), "yyyyMMdd");
|
||||
// 规定时间之前开服的返回0
|
||||
if (serverOpenTime < time){
|
||||
return false;
|
||||
}else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,6 +110,7 @@ public class SSpecialConfig implements BaseConfig {
|
|||
|
||||
public static final String LING_LONG_COST = "LingLongCost";//玲珑宝镜消耗道具ID
|
||||
public static final String Data_Of_Unlock_All_Wish_Hero = "DataOfUnlockAllWishHero";//在这个日期前开服的服务器默认解锁所有卡池内神将作为心愿,不走hero表加入心愿时长的判断
|
||||
public static final String DATA_OF_UNLOCK_THE_EVEREST = "DataOfUnlockTheEverest";
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
|
Loading…
Reference in New Issue