[FIX] Передача ClientProfile в ServerPinger.

This commit is contained in:
Zaxar163 2019-05-04 13:04:35 +03:00
parent 07607ec1ef
commit 67f1dcf5f9
2 changed files with 4 additions and 4 deletions

View file

@ -332,7 +332,7 @@ function updateProfilesList(profiles) {
serverList.getChildren().clear(); serverList.getChildren().clear();
var index = 0; var index = 0;
profiles.forEach(function(profile, i, arr) { 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); var serverBtn = new javafx.scene.control.ToggleButton(profile);

View file

@ -76,9 +76,9 @@ private static void writeUTF16String(HOutput output, String s) throws IOExceptio
private Instant cacheTime = null; private Instant cacheTime = null;
@LauncherAPI @LauncherAPI
public ServerPinger(InetSocketAddress address, ClientProfile.Version version) { public ServerPinger(ClientProfile profile) {
this.address = Objects.requireNonNull(address, "address"); this.address = Objects.requireNonNull(profile.getServerSocketAddress(), "address");
this.version = Objects.requireNonNull(version, "version"); this.version = Objects.requireNonNull(profile.getVersion(), "version");
} }
private Result doPing() throws IOException { private Result doPing() throws IOException {