diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2022-07-04 02:58:39 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2022-07-04 02:58:39 -0300 |
commit | 98be9584f2627289dabc6f7d51db69179a973b98 (patch) | |
tree | 7f71b73ca45c34605838151d3b02f6682232308b /src/main/java/ganarchy/friendcode/client | |
parent | 901941591749dc97afe1900b1d7b0d24da6e28d4 (diff) |
Last minute quick fixes
Diffstat (limited to 'src/main/java/ganarchy/friendcode/client')
-rw-r--r-- | src/main/java/ganarchy/friendcode/client/I2PSamPinger.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/ganarchy/friendcode/client/I2PSamPinger.java b/src/main/java/ganarchy/friendcode/client/I2PSamPinger.java index 96448db..0476c61 100644 --- a/src/main/java/ganarchy/friendcode/client/I2PSamPinger.java +++ b/src/main/java/ganarchy/friendcode/client/I2PSamPinger.java @@ -12,7 +12,6 @@ public class I2PSamPinger extends LanServerPinger implements LanSendPing { private I2PSamStreamForwarder stream; private final String port; private volatile Status status = Status.IDLE; - private boolean hasWarned; private volatile boolean stopSam; public I2PSamPinger(String motd, String port) throws IOException { @@ -62,6 +61,9 @@ public class I2PSamPinger extends LanServerPinger implements LanSendPing { @Override public void friendcodeSendPing() { + if (this.status != Status.RUNNING) { + return; + } if (this.stopSam) { if (this.stream != null) { try { @@ -74,7 +76,6 @@ public class I2PSamPinger extends LanServerPinger implements LanSendPing { } catch (IOException ignored) { } this.status = Status.CONNECTION_CLOSED; - this.hasWarned = true; return; } if (this.sam.sendPing() < 0) { @@ -85,8 +86,7 @@ public class I2PSamPinger extends LanServerPinger implements LanSendPing { this.status = Status.CONNECTION_CLOSED; } } - if (this.status == Status.CONNECTION_CLOSED && !this.hasWarned) { - this.hasWarned = true; + if (this.status == Status.CONNECTION_CLOSED) { FriendCode.LOGGER.warn("Friend Code connection closed!"); } } |