Skip to content

Commit

Permalink
Add online check delay option
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Sep 12, 2020
1 parent e4d7a16 commit e4cbd4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/Xera/Bungee/Queue/Bungee/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Config {
public static boolean POSITIONMESSAGEHOTBAR, ENABLEKICKMESSAGE, SERVERPINGINFOENABLE,
ENABLEAUTHSERVER, ALWAYSQUEUE, CUSTOMPROTOCOLENABLE, REGISTERTAB, AUTHFIRST;

public static int MAINSERVERSLOTS,QUEUEMOVEDELAY, QUEUESERVERSLOTS;
public static int MAINSERVERSLOTS, QUEUEMOVEDELAY, QUEUESERVERSLOTS, SERVERONLINECHECKDELAY;

public static List<String> SERVERPINGINFO, HEADER, FOOTER, HEADERPRIORITY, FOOTERPRIORITY;
}
6 changes: 3 additions & 3 deletions src/main/java/Xera/Bungee/Queue/Bungee/XeraBungeeQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,15 @@ public void onEnable() {
}

BungeeEvents.mainonline = error == null;
}), 500, 2000, TimeUnit.MILLISECONDS);
}), 500, Config.SERVERONLINECHECKDELAY, TimeUnit.MILLISECONDS);

getProxy().getScheduler().schedule(this, () -> ProxyServer.getInstance().getServerInfo(Config.QUEUESERVER).ping((result, error) -> {
if (error != null) {
getLogger().warning("Queue Server is down!!!");
}

BungeeEvents.queueonline = error == null;
}), 500, 2000, TimeUnit.MILLISECONDS);
}), 500, Config.SERVERONLINECHECKDELAY, TimeUnit.MILLISECONDS);

getProxy().getScheduler().schedule(this, () -> {
if (Config.ENABLEAUTHSERVER) {
Expand All @@ -396,7 +396,7 @@ public void onEnable() {
} else {
BungeeEvents.authonline = true;
}
}, 500, 2000, TimeUnit.MILLISECONDS);
}, 500, Config.SERVERONLINECHECKDELAY, TimeUnit.MILLISECONDS);
}

void processConfig() {
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/bungeeconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ REGISTERTAB: true
# Server is full message
SERVERISFULLMESSAGE: "&6YOURSERVER is full"

# It is not recommended to decrease this number (milliseconds)
SERVERONLINECHECKDELAY: 2000

# Position in queue message by default only sends in chat every 10 seconds
# you can have it on the hotbar by setting POSITIONMESSAGEHOTBAR: "false" to true
POSITIONMESSAGEHOTBAR: false
Expand Down

0 comments on commit e4cbd4b

Please sign in to comment.