Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
commit
491b703d95
|
@ -137,6 +137,7 @@ public class TimeUtils {
|
|||
|
||||
public static final TimeZone TIME_ZONE;
|
||||
|
||||
private static final String ymdhms_Format_new = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
public static final String Stand_CeHua_Data_format = "yyyyMMdd HHmmss";
|
||||
|
||||
|
@ -294,6 +295,12 @@ public class TimeUtils {
|
|||
return new SimpleDateFormat(ymdFormat).format(new Date(time));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取时间戳字符串yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
public static String getTimeStamp2(Long time) {
|
||||
return new SimpleDateFormat(ymdhms_Format_new).format(new Date(time));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 是否是同一天
|
||||
|
|
|
@ -8,6 +8,8 @@ import com.ljsd.jieling.db.redis.RedisUtil;
|
|||
import com.ljsd.jieling.logic.dao.ServerConfig;
|
||||
import com.ljsd.jieling.network.NetManager;
|
||||
import com.ljsd.jieling.util.ConfigurableApplicationContextManager;
|
||||
import config.SGameSetting;
|
||||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
|
@ -100,13 +102,16 @@ public class GameApplication {
|
|||
serverConfigTmp.setOpenTime(format);
|
||||
serverConfigTmp.setCacheOpenTime(serverOenTime);
|
||||
serverConfigTmp.setId(1);
|
||||
MongoUtil.getInstence().getMyMongoTemplate().saveWithoutMongoRoot(serverConfigTmp);
|
||||
}else{
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
String openTime = serverConfigTmp.getOpenTime();
|
||||
Date date = simpleDateFormat.parse(openTime);
|
||||
serverConfigTmp.setCacheOpenTime(date.getTime());
|
||||
}
|
||||
int version = STableManager.getConfig(SGameSetting.class).get(1).getWookbookVersion();
|
||||
serverConfigTmp.setVersion(version);
|
||||
serverConfigTmp.setRestartTime(TimeUtils.getTimeStamp2(TimeUtils.now()));
|
||||
MongoUtil.getInstence().getMyMongoTemplate().saveWithoutMongoRoot(serverConfigTmp);
|
||||
serverConfig = serverConfigTmp;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,12 @@ public class ServerConfig extends MongoBase {
|
|||
@Transient
|
||||
private long cacheOpenTime;
|
||||
|
||||
@Field(value = "version")
|
||||
private int version;
|
||||
|
||||
@Field(value = "restartTime")
|
||||
private String restartTime;
|
||||
|
||||
public void setOpenTime(String openTime) {
|
||||
this.openTime = openTime;
|
||||
}
|
||||
|
@ -44,4 +50,28 @@ public class ServerConfig extends MongoBase {
|
|||
public void setCacheOpenTime(long cacheOpenTime) {
|
||||
this.cacheOpenTime = cacheOpenTime;
|
||||
}
|
||||
|
||||
public int getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(int version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public int getNew_worldLevel() {
|
||||
return new_worldLevel;
|
||||
}
|
||||
|
||||
public void setNew_worldLevel(int new_worldLevel) {
|
||||
this.new_worldLevel = new_worldLevel;
|
||||
}
|
||||
|
||||
public String getRestartTime() {
|
||||
return restartTime;
|
||||
}
|
||||
|
||||
public void setRestartTime(String restartTime) {
|
||||
this.restartTime = restartTime;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -115,6 +115,8 @@ public class SGameSetting implements BaseConfig {
|
|||
|
||||
private int defaultSuit;
|
||||
|
||||
private int wookbookVersion;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
@ -325,4 +327,8 @@ public class SGameSetting implements BaseConfig {
|
|||
}
|
||||
|
||||
public int getDefaultSuit() {return defaultSuit; }
|
||||
|
||||
public int getWookbookVersion() {
|
||||
return wookbookVersion;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue