mirror of
https://github.com/BGHDDevelopment/PlayerBalancer.git
synced 2024-09-17 10:14:10 +02:00
Fixed the fallback principal option and renamed it to something better
This commit is contained in:
parent
0aec00e9ff
commit
ed6dc85bd0
@ -88,8 +88,10 @@ public class FallbackCommand extends Command {
|
||||
|
||||
return target;
|
||||
} else {
|
||||
if (plugin.getSettings().getGeneralProps().isFallbackPrincipal()) {
|
||||
if (plugin.getSettings().getBalancerProps().isDefaultPrincipal()) {
|
||||
return plugin.getSectionManager().getPrincipal();
|
||||
} else {
|
||||
MessageUtils.send(player, messages.getUnavailableServerMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -190,6 +190,10 @@ public class ManageCommand extends Command {
|
||||
.color(ChatColor.WHITE)
|
||||
.append("\"")
|
||||
.color(ChatColor.AQUA)
|
||||
.append("\nAddress: ")
|
||||
.color(ChatColor.GRAY)
|
||||
.append(server.getAddress().toString())
|
||||
.color(ChatColor.AQUA)
|
||||
.create()))
|
||||
.append(String.format(" (%d/%d) ",
|
||||
status.getOnline(),
|
||||
|
@ -124,8 +124,10 @@ public class ServerKickListener implements Listener {
|
||||
|
||||
return target;
|
||||
} else {
|
||||
if (plugin.getSettings().getGeneralProps().isFallbackPrincipal()) {
|
||||
if (plugin.getSettings().getBalancerProps().isDefaultPrincipal()) {
|
||||
return plugin.getSectionManager().getPrincipal();
|
||||
} else {
|
||||
MessageUtils.send(player, messages.getUnavailableServerMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,8 @@ public class StatusManager {
|
||||
stopped = false;
|
||||
tactic = plugin.getSettings().getServerCheckerProps().getTactic();
|
||||
plugin.getLogger().info(String.format("Starting the ping task, the interval is %s",
|
||||
plugin.getSettings().getServerCheckerProps().getInterval()));
|
||||
plugin.getSettings().getServerCheckerProps().getInterval()
|
||||
));
|
||||
|
||||
task = plugin.getProxy().getScheduler().schedule(plugin, () -> {
|
||||
storage.forEach((k, v) -> v.setOutdated(true));
|
||||
|
@ -17,9 +17,6 @@ public class GeneralProps {
|
||||
@Setting(value = "redis-bungee")
|
||||
private boolean redisBungee;
|
||||
|
||||
@Setting(value = "fallback-principal")
|
||||
private boolean fallbackPrincipal;
|
||||
|
||||
@Setting
|
||||
private String version;
|
||||
|
||||
@ -55,14 +52,6 @@ public class GeneralProps {
|
||||
this.redisBungee = redisBungee;
|
||||
}
|
||||
|
||||
public boolean isFallbackPrincipal() {
|
||||
return fallbackPrincipal;
|
||||
}
|
||||
|
||||
public void setFallbackPrincipal(boolean fallbackPrincipal) {
|
||||
this.fallbackPrincipal = fallbackPrincipal;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
@ -78,7 +67,6 @@ public class GeneralProps {
|
||||
", silent=" + silent +
|
||||
", autoReload=" + autoReload +
|
||||
", redisBungee=" + redisBungee +
|
||||
", fallbackPrincipal=" + fallbackPrincipal +
|
||||
", version='" + version + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
@ -12,6 +12,9 @@ public class BalancerProps {
|
||||
@Setting(value = "principal-section")
|
||||
private String principalSectionName;
|
||||
|
||||
@Setting(value = "default-principal")
|
||||
private boolean defaultPrincipal;
|
||||
|
||||
@Setting(value = "dummy-sections")
|
||||
private List<String> dummySectionNames;
|
||||
|
||||
@ -64,6 +67,14 @@ public class BalancerProps {
|
||||
this.showPlayers = showPlayers;
|
||||
}
|
||||
|
||||
public boolean isDefaultPrincipal() {
|
||||
return defaultPrincipal;
|
||||
}
|
||||
|
||||
public void setDefaultPrincipal(boolean defaultPrincipal) {
|
||||
this.defaultPrincipal = defaultPrincipal;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BalancerProps{" +
|
||||
|
Loading…
Reference in New Issue
Block a user