diff --git a/core/src/main/java/com/rtm516/mcxboxbroadcast/core/CustomIceConfigSource.java b/core/src/main/java/com/rtm516/mcxboxbroadcast/core/CustomIceConfigSource.java index 2c9a4de..60bc617 100644 --- a/core/src/main/java/com/rtm516/mcxboxbroadcast/core/CustomIceConfigSource.java +++ b/core/src/main/java/com/rtm516/mcxboxbroadcast/core/CustomIceConfigSource.java @@ -77,6 +77,12 @@ public class CustomIceConfigSource implements ConfigSource { put("ice4j.harvest.mapping.static-mappings", ""); }}; + @NotNull + @Override + public String getName() { + return ""; + } + @NotNull @Override public String getDescription() { @@ -87,8 +93,6 @@ public String getDescription() { @Override public Function1 getterFor(@NotNull KType kType) { return s -> { - System.out.println("getterFor: " + s + " " + kType); - String value = config.get(s); if (value != null) { String typeName = kType.getClassifier().toString(); @@ -99,41 +103,24 @@ public Function1 getterFor(@NotNull KType kType) { if (value.isEmpty()) { return new ArrayList<>(); } else { - System.out.println("List not empty: " + s + " " + value + " " + kType); return null; } } - Object out = switch (typeName) { + return switch (typeName) { case "kotlin.Boolean" -> Boolean.parseBoolean(value); case "kotlin.Int" -> Integer.parseInt(value); case "kotlin.Long" -> Long.parseLong(value); case "kotlin.Double" -> Double.parseDouble(value); case "java.time.Duration" -> Duration.ofMillis(Long.parseLong(value)); - default -> { - System.out.println("Unknown type: " + typeName); - yield null; - } + default -> null; }; - - if (out == null) { - System.out.println("Failed to parse: " + s + " " + value + " " + kType); - } - - return out; } - System.out.println("Unknown key: " + s + " " + kType); return null; }; } - @NotNull - @Override - public String getName() { - return ""; - } - public static void install() { JitsiConfig.Companion.useDebugNewConfig(new CustomIceConfigSource()); } diff --git a/core/src/main/java/com/rtm516/mcxboxbroadcast/core/ping/PingUtil.java b/core/src/main/java/com/rtm516/mcxboxbroadcast/core/ping/PingUtil.java index 9f81f4b..ad7524f 100644 --- a/core/src/main/java/com/rtm516/mcxboxbroadcast/core/ping/PingUtil.java +++ b/core/src/main/java/com/rtm516/mcxboxbroadcast/core/ping/PingUtil.java @@ -39,7 +39,7 @@ public static Promise ping(InetSocketAddress server, long timeout, .group(workerEventLoopGroup) .option(RakChannelOption.RAK_GUID, ThreadLocalRandom.current().nextLong()) .handler(new ClientPingHandler(promise, timeout, timeUnit)) - .bind(ThreadLocalRandom.current().nextInt(10000, 15000)) + .bind(0) .addListener((ChannelFuture future) -> { if (future.cause() != null) { promise.tryFailure(future.cause());