add server time

back_recharge
wangyuan 2019-11-08 14:00:23 +08:00
parent 30de1e8ff5
commit 8abdf0aa15
1 changed files with 10 additions and 0 deletions

View File

@ -85,6 +85,16 @@ public class CommonStaticConfig extends AbstractClassStaticConfig {
long cacheOpenTime = GameApplication.serverConfig.getCacheOpenTime();
sGlobalSystemConfig.setSeasonOpenLong(cacheOpenTime + Integer.parseInt(sGlobalSystemConfig.getSeasonOpen()) * 1000);
sGlobalSystemConfig.setSeasonEndLong(cacheOpenTime + Integer.parseInt(sGlobalSystemConfig.getSeasonEnd()) * 1000);
} else if( 4 == sGlobalSystemConfig.getType()){
long cacheOpenTime = GameApplication.serverConfig.getCacheOpenTime();
Calendar calendar = Calendar.getInstance();
calendar.setTimeInMillis(cacheOpenTime);
calendar.set(Calendar.HOUR_OF_DAY,0);
calendar.set(Calendar.MINUTE,0);
calendar.set(Calendar.SECOND,0);
long timeInMillis = calendar.getTimeInMillis();
sGlobalSystemConfig.setSeasonOpenLong(timeInMillis + Integer.parseInt(sGlobalSystemConfig.getSeasonOpen()) * 1000);
sGlobalSystemConfig.setSeasonEndLong(timeInMillis + Integer.parseInt(sGlobalSystemConfig.getSeasonEnd()) * 1000);
} else {
sGlobalSystemConfig.setSeasonOpenLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSeasonOpen(), TimeUtils.Stand_CeHua_Data_format));
sGlobalSystemConfig.setSeasonEndLong(TimeUtils.parseTimeToMiles(sGlobalSystemConfig.getSeasonEnd(), TimeUtils.Stand_CeHua_Data_format));