Fixed wait-after-online not doing anything
This commit is contained in:
@@ -89,14 +89,16 @@ public interface AdaptedServer extends Handle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets if the last ping was successfull
|
* Gets if the last ping was successful
|
||||||
* (which almost always means the server is online)
|
* (which almost always means the server is online)
|
||||||
* @return If the server is determined to be online or not
|
* @return If the server is determined to be online or not
|
||||||
*/
|
*/
|
||||||
default boolean isOnline() {
|
default boolean isOnline() {
|
||||||
return getLastPing().isPresent();
|
return getLastPing().isPresent() && !shouldWaitAfterOnline();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean shouldWaitAfterOnline();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the number of players currently online
|
* Gets the number of players currently online
|
||||||
* @return The number of players online
|
* @return The number of players online
|
||||||
|
|||||||
+5
@@ -112,6 +112,11 @@ public class BungeeServer implements AdaptedServer {
|
|||||||
return System.currentTimeMillis()-lastOffline <= (AjQueueAPI.getInstance().getConfig().getDouble("wait-time") * 2 * 1000) && isOnline();
|
return System.currentTimeMillis()-lastOffline <= (AjQueueAPI.getInstance().getConfig().getDouble("wait-time") * 2 * 1000) && isOnline();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldWaitAfterOnline() {
|
||||||
|
return System.currentTimeMillis()-lastOffline <= (AjQueueAPI.getInstance().getConfig().getDouble("wait-after-online") * 2 * 1000) && getLastPing().isPresent();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ServerInfo getHandle() {
|
public ServerInfo getHandle() {
|
||||||
return handle;
|
return handle;
|
||||||
|
|||||||
+5
@@ -117,6 +117,11 @@ public class VelocityServer implements AdaptedServer {
|
|||||||
return System.currentTimeMillis()-lastOffline <= (AjQueueAPI.getInstance().getConfig().getDouble("wait-time") * 2 * 1000) && isOnline();
|
return System.currentTimeMillis()-lastOffline <= (AjQueueAPI.getInstance().getConfig().getDouble("wait-time") * 2 * 1000) && isOnline();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean shouldWaitAfterOnline() {
|
||||||
|
return System.currentTimeMillis()-lastOffline <= (AjQueueAPI.getInstance().getConfig().getDouble("wait-after-online") * 2 * 1000) && getLastPing().isPresent();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RegisteredServer getHandle() {
|
public RegisteredServer getHandle() {
|
||||||
return handle;
|
return handle;
|
||||||
|
|||||||
Reference in New Issue
Block a user