远端配置无法读取,使用本地缓存 (#1740)

* 远端配置无法读取,使用本地缓存

* 远程配置&本地配置确认

* fix err

* fix-err

* fix-err

* fix-err

* fix-err

* restore

* code clean

* fix-err

* add

* fix

* 远端读取异常日志

Co-authored-by: zkitefly <64117916+zkitefly@users.noreply.github.com>
This commit is contained in:
Cato : Love the world and myself 2022-09-24 18:17:34 +08:00 committed by GitHub
parent a8b09e2195
commit 0f4a5c26df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,11 +185,14 @@ public final class MultiplayerManager {
// 下载 HiPer 配置文件
String certFileContent;
try {
certFileContent = HttpRequest.GET(String.format("https://cert.mcer.cn/%s.yml", token)).getString() + "\nlogging:\n format: json\n file_path: ./hiper.log";
certFileContent = HttpRequest.GET(String.format("https://cert.mcer.cn/%s.yml", token)).getString();
if (!certFileContent.equals("")) {
certFileContent += "\nlogging:\n format: json\n file_path: ./hiper.log";
FileUtils.writeText(HIPER_CONFIG_PATH, certFileContent);
}
} catch (IOException e) {
throw new HiperInvalidTokenException();
LOG.warning(Level.WARNING, "configuration file cloud cache index code has been not available , try to use the local configuration file", e);
}
FileUtils.writeText(HIPER_CONFIG_PATH, certFileContent);
String[] commands = new String[]{HIPER_PATH.toString(), "-config", HIPER_CONFIG_PATH.toString()};
Process process = new ProcessBuilder()