From 56509fcbe1d23acece24d32a30595980734970bd Mon Sep 17 00:00:00 2001 From: sirjonasxx <36828922+sirjonasxx@users.noreply.github.com> Date: Thu, 17 Jan 2019 19:46:05 +0100 Subject: [PATCH] 1 jar 2/2 --- .../src/main/java/gearth/protocol/HConnection.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/G-Earth/src/main/java/gearth/protocol/HConnection.java b/G-Earth/src/main/java/gearth/protocol/HConnection.java index 0da69f7..9fce1b4 100644 --- a/G-Earth/src/main/java/gearth/protocol/HConnection.java +++ b/G-Earth/src/main/java/gearth/protocol/HConnection.java @@ -1,6 +1,7 @@ package gearth.protocol; import gearth.misc.Cacher; +import gearth.misc.OSValidator; import gearth.protocol.hostreplacer.HostReplacer; import gearth.protocol.hostreplacer.HostReplacerFactory; import gearth.protocol.memory.Rc4Obtainer; @@ -86,6 +87,17 @@ public class HConnection { } } } + + if (OSValidator.isMac()) { + for (int i = 2; i <= autoDetectHosts.size(); i++) { + ProcessBuilder allowLocalHost = new ProcessBuilder("ifconfig", "lo0", "alias", ("127.0.0." + i), "up"); + try { + allowLocalHost.start(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } }