Skip to content

Commit

Permalink
config setting for too many players logging in kick
Browse files Browse the repository at this point in the history
  • Loading branch information
bierdosenhalter committed Aug 16, 2022
1 parent 89add2a commit 23d9264
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.zeroBzeroT</groupId>
<artifactId>AnarchyQueue</artifactId>
<version>1.5.2</version>
<version>1.5.3</version>
<packaging>jar</packaging>
<name>${project.artifactId}</name>

Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/zeroBzeroT/anarchyqueue/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class Config {
public static int waitOnKick = 0;
public static boolean kick = true;
public static boolean kickOnRestart = false;
public static boolean kickOnTooMany = false;

/**
* Loads a config file, and if it doesn't exist creates one
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/zeroBzeroT/anarchyqueue/Queue.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ public void onServerKick(ServerKickEvent event) {
}

// if config is not set to kick, if the player was kicked while connecting to main or main is restarting
if (!Config.kick || event.getPlayer().getServer().getInfo() == ProxyServer.getInstance().getServerInfo(Config.queue) || (!Config.kickOnRestart && reason.toLowerCase().contains("server is restarting"))) {
if (!Config.kick || event.getPlayer().getServer().getInfo() == ProxyServer.getInstance().getServerInfo(Config.queue)
|| (!Config.kickOnRestart && reason.toLowerCase().contains("server is restarting"))
|| (!Config.kickOnTooMany && reason.toLowerCase().contains("too many people logging in"))) {
// cancel kick and send back to the queue
event.setCancelled(true);
event.setCancelServer(ProxyServer.getInstance().getServerInfo(Config.queue));
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ messagePosition: "&6Position in queue: &l%position%"
messageConnecting: "&6Connecting to the server..."
serverName: "0b0t"
kick: true
kickOnRestart: false
kickOnRestart: false
kickOnTooMany: false

0 comments on commit 23d9264

Please sign in to comment.