fix actionbar message saying server is restarting when its not

This commit is contained in:
ajgeiss0702
2020-07-20 08:04:29 -07:00
parent 6ce0975f6c
commit 8bc1303724
3 changed files with 22 additions and 2 deletions
+9 -1
View File
@@ -199,7 +199,11 @@ public class Manager {
int len = plys.size();
if(!s.isJoinable(p)) {
String status = msgs.get("status.offline.restarting");
String status = "unknown";
if(!s.isOnline()) {
status = msgs.get("status.offline.restarting");
}
if(s.getOfflineTime() > pl.config.getInt("offline-time")) {
status = msgs.get("status.offline.offline");
@@ -209,6 +213,10 @@ public class Manager {
status = msgs.get("status.offline.restricted");
}
if(s.isFull()) {
status = msgs.get("status.offline.full");
}
if(s.isPaused()) {
status = msgs.get("status.offline.paused");
}
+8 -1
View File
@@ -141,10 +141,17 @@ public class Server {
return (!whitelisted || whitelistedplayers.contains(p.getName())) &&
this.isOnline() &&
this.canAccess(p) &&
this.isFull() &&
!this.isFull() &&
!this.isPaused();
}
public String getJoinableDebug(ProxiedPlayer p) {
return (!whitelisted || whitelistedplayers.contains(p.getName())) + "\n" +
this.isOnline() +"\n"+
this.canAccess(p) +"\n"+
!this.isFull() +"\n"+
!this.isPaused();
}
boolean paused = false;
@@ -70,6 +70,11 @@ public class ManageCommand extends Command {
sender.sendMessage(Main.formatMessage(pl.isp()+""));
return;
}
if(args[0].equalsIgnoreCase("statusdebug")) {
Server s = Manager.getInstance().getSingleServer((ProxiedPlayer) sender);
if(s == null) return;
sender.sendMessage(Main.formatMessage(s.getJoinableDebug((ProxiedPlayer) sender)));
}
if(args[0].equalsIgnoreCase("player")) {
sender.sendMessage(Main.formatMessage("/ajQueue <player> <server>"));
return;