mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-01-30 14:39:56 +08:00
远端配置无法读取,使用本地缓存 (#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:
parent
a8b09e2195
commit
0f4a5c26df
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user