From 67f1dcf5f99cc043c7c1732ae6bcd99895c08e6c Mon Sep 17 00:00:00 2001 From: Zaxar163 Date: Sat, 4 May 2019 13:04:35 +0300 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=9F=D0=B5=D1=80=D0=B5=D0=B4=D0=B0?= =?UTF-8?q?=D1=87=D0=B0=20ClientProfile=20=D0=B2=20ServerPinger.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Launcher/runtime/dialog/dialog.js | 2 +- .../main/java/ru/gravit/launcher/client/ServerPinger.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Launcher/runtime/dialog/dialog.js b/Launcher/runtime/dialog/dialog.js index 0cff19d2..122a7816 100644 --- a/Launcher/runtime/dialog/dialog.js +++ b/Launcher/runtime/dialog/dialog.js @@ -332,7 +332,7 @@ function updateProfilesList(profiles) { serverList.getChildren().clear(); var index = 0; profiles.forEach(function(profile, i, arr) { - pingers[profile] = new ServerPinger(profile.getServerSocketAddress(), profile.getVersion()); + pingers[profile] = new ServerPinger(profile); var serverBtn = new javafx.scene.control.ToggleButton(profile); diff --git a/Launcher/src/main/java/ru/gravit/launcher/client/ServerPinger.java b/Launcher/src/main/java/ru/gravit/launcher/client/ServerPinger.java index 6052e4eb..69928887 100644 --- a/Launcher/src/main/java/ru/gravit/launcher/client/ServerPinger.java +++ b/Launcher/src/main/java/ru/gravit/launcher/client/ServerPinger.java @@ -76,9 +76,9 @@ private static void writeUTF16String(HOutput output, String s) throws IOExceptio private Instant cacheTime = null; @LauncherAPI - public ServerPinger(InetSocketAddress address, ClientProfile.Version version) { - this.address = Objects.requireNonNull(address, "address"); - this.version = Objects.requireNonNull(version, "version"); + public ServerPinger(ClientProfile profile) { + this.address = Objects.requireNonNull(profile.getServerSocketAddress(), "address"); + this.version = Objects.requireNonNull(profile.getVersion(), "version"); } private Result doPing() throws IOException {