aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhackthetime <l4bg0jb7@duck.com>2023-10-04 09:07:14 +0200
committerhackthetime <l4bg0jb7@duck.com>2023-10-04 09:07:14 +0200
commita4aabb5cbd29fda0f8c6aeac867602528e4fd618 (patch)
treec3ac83668b8bc630eeb419510430e5de602a7836 /src/main/java
parent271be1bd2fbb510d4aa2ab14e848a7b2dbf6a181 (diff)
downloadBBsentials-a4aabb5cbd29fda0f8c6aeac867602528e4fd618.tar.gz
BBsentials-a4aabb5cbd29fda0f8c6aeac867602528e4fd618.tar.bz2
BBsentials-a4aabb5cbd29fda0f8c6aeac867602528e4fd618.zip
tried fixing the splash update listener
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/de/hype/bbsentials/client/SplashStatusUpdateListener.java8
-rw-r--r--src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java3
2 files changed, 4 insertions, 7 deletions
diff --git a/src/main/java/de/hype/bbsentials/client/SplashStatusUpdateListener.java b/src/main/java/de/hype/bbsentials/client/SplashStatusUpdateListener.java
index 6b5180a..2463c79 100644
--- a/src/main/java/de/hype/bbsentials/client/SplashStatusUpdateListener.java
+++ b/src/main/java/de/hype/bbsentials/client/SplashStatusUpdateListener.java
@@ -25,9 +25,8 @@ public class SplashStatusUpdateListener implements Runnable {
@Override
public void run() {
BBsentials.splashLobby = true;
+ int maxPlayerCount = BBUtils.getMaximumPlayerCount() - 5;
while (BBsentials.splashLobby) {
- int maxPlayerCount = BBUtils.getMaximumPlayerCount() - 5;
- while (splashLobby && !(status.equals(SplashUpdatePacket.STATUS_DONE) || status.equals(SplashUpdatePacket.STATUS_CANCELED))) {
if (!full&&(BBUtils.getPlayerCount() >= maxPlayerCount)) {
newStatus = SplashUpdatePacket.STATUS_FULL;
full=true;
@@ -36,10 +35,9 @@ public class SplashStatusUpdateListener implements Runnable {
status = newStatus;
connection.sendPacket(new SplashUpdatePacket(packet.splashId, status));
}
- }
try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
+ Thread.sleep(250);
+ } catch (InterruptedException ignored) {
}
}
if (splashed) {
diff --git a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
index abb5265..e6e5096 100644
--- a/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
+++ b/src/main/java/de/hype/bbsentials/communication/BBsentialConnection.java
@@ -344,11 +344,10 @@ public class BBsentialConnection {
public void onSplashNotifyPacket(SplashNotifyPacket packet) {
int waitTime;
-
if (packet.splasherUsername.equals(config.getUsername())) {
SplashStatusUpdateListener splashStatusUpdateListener = new SplashStatusUpdateListener(this, packet);
BBsentials.splashStatusUpdateListener = splashStatusUpdateListener;
- executionService.submit(splashStatusUpdateListener);
+ executionService.execute(splashStatusUpdateListener);
}
else {
SplashManager.addSplash(packet);