This commit is contained in:
@@ -4,7 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = "cn.hamster3.server.mixin"
|
||||
version = "1.0.0"
|
||||
version = "1.0.1"
|
||||
description = "为 Velocity 添加网易认证注入"
|
||||
|
||||
base {
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.util.Map;
|
||||
|
||||
public class NeteaseServerConfig {
|
||||
public final class NeteaseServerConfig {
|
||||
private static boolean loaded = false;
|
||||
private static String authUrl = "http://192.168.0.100:9999/check";
|
||||
private static String gameId = "12345678901234567";
|
||||
@@ -17,6 +17,9 @@ public class NeteaseServerConfig {
|
||||
init();
|
||||
}
|
||||
|
||||
private NeteaseServerConfig() {
|
||||
}
|
||||
|
||||
@SuppressWarnings("CallToPrintStackTrace")
|
||||
public static void init() {
|
||||
if (loaded) {
|
||||
@@ -35,9 +38,9 @@ public class NeteaseServerConfig {
|
||||
}
|
||||
try {
|
||||
String readString = Files.readString(file.toPath());
|
||||
Map<String, String> map = new Yaml().load(readString);
|
||||
authUrl = map.getOrDefault("auth-url", "http://192.168.0.100:9999/check");
|
||||
gameId = map.getOrDefault("game-id", "12345678901234567");
|
||||
Map<String, Object> map = new Yaml().load(readString);
|
||||
authUrl = map.getOrDefault("auth-url", "http://192.168.0.100:9999/check").toString();
|
||||
gameId = map.getOrDefault("game-id", "12345678901234567").toString();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user