aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhackthetime <l4bg0jb7@duck.com>2023-10-05 13:49:09 +0200
committerhackthetime <l4bg0jb7@duck.com>2023-10-05 13:49:09 +0200
commit2b2b36dbadf2eb75809f9a53e2a2c0b87c85508a (patch)
tree33abc3c2cc685b233d4816d03f412e4daa03a0de /src/main/java
parent77b627252c4e22b28cfdf1aa561c621d1e8ca552 (diff)
downloadBBsentials-2b2b36dbadf2eb75809f9a53e2a2c0b87c85508a.tar.gz
BBsentials-2b2b36dbadf2eb75809f9a53e2a2c0b87c85508a.tar.bz2
BBsentials-2b2b36dbadf2eb75809f9a53e2a2c0b87c85508a.zip
bug fix for the Disconnect Packet not reconnecting.
added a custom random delay to the Packet to allow setting a custom delay time server side to reduce load at the reconnect time.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java2
-rw-r--r--src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
index 1d1e3c1..0d43bd9 100644
--- a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
+++ b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
@@ -422,7 +422,7 @@ public class BBsentialConnection {
else {
BBsentials.conditionalReconnectToBBserver();
}
- }, (long) (packet.waitBeforeReconnect[i] + (Math.random() * packet.random)), TimeUnit.SECONDS);
+ }, (long) (packet.waitBeforeReconnect[i] + (Math.random() * packet.randomExtraDelay)), TimeUnit.SECONDS);
}
}
diff --git a/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java b/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java
index ab04d1a..7cb461e 100644
--- a/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java
+++ b/src/main/java/de/hype/bbsentials/packets/packets/DisconnectPacket.java
@@ -5,16 +5,18 @@ import de.hype.bbsentials.constants.enviromentShared.InternalReasonConstants;
public class DisconnectPacket extends AbstractPacket {
- public DisconnectPacket(InternalReasonConstants internalReason, int[] waitBeforeReconnect, String displayReason, String displayMessage) {
+ public DisconnectPacket(InternalReasonConstants internalReason, int[] waitBeforeReconnect, int randomExtraDelay, String displayReason, String displayMessage) {
super(1, 1); //Min and Max supportet Version
this.internalReason = internalReason;
this.waitBeforeReconnect = waitBeforeReconnect;
this.displayReason = displayReason;
this.displayMessage = displayMessage;
+ this.randomExtraDelay = randomExtraDelay;
}
public final InternalReasonConstants internalReason;
public final int[] waitBeforeReconnect;
+ public final int randomExtraDelay;
public final String displayReason;
public final String displayMessage;