mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-27 10:31:42 +01:00
Fixed #300
This commit is contained in:
parent
2835b1eaf4
commit
3892fb6e3c
@ -6,6 +6,7 @@ package main.java.com.djrapitops.plan;
|
||||
|
||||
import com.djrapitops.plugin.BungeePlugin;
|
||||
import com.djrapitops.plugin.settings.ColorScheme;
|
||||
import com.djrapitops.plugin.task.AbsRunnable;
|
||||
import main.java.com.djrapitops.plan.api.IPlan;
|
||||
import main.java.com.djrapitops.plan.api.exceptions.DatabaseInitException;
|
||||
import main.java.com.djrapitops.plan.command.commands.ReloadCommand;
|
||||
@ -38,7 +39,7 @@ public class PlanBungee extends BungeePlugin<PlanBungee> implements IPlan {
|
||||
private WebServer webServer;
|
||||
private Database db;
|
||||
private BungeeServerInfoManager serverInfoManager;
|
||||
private InformationManager infoManager;
|
||||
private BungeeInformationManager infoManager;
|
||||
private ServerVariableHolder variableHolder;
|
||||
|
||||
private ProcessingQueue processingQueue;
|
||||
@ -81,14 +82,20 @@ public class PlanBungee extends BungeePlugin<PlanBungee> implements IPlan {
|
||||
|
||||
webServer.initServer();
|
||||
|
||||
infoManager.attemptConnection();
|
||||
|
||||
if (!webServer.isEnabled()) {
|
||||
Log.error("WebServer was not successfully initialized.");
|
||||
disablePlugin();
|
||||
return;
|
||||
}
|
||||
|
||||
getRunnableFactory().createNew("Enable Bukkit Connection Task", new AbsRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
infoManager.attemptConnection();
|
||||
infoManager.sendConfigSettings();
|
||||
}
|
||||
}).runTaskAsynchronously();
|
||||
|
||||
getProxy().registerChannel("Plan");
|
||||
registerListener(new BungeePluginChannelListener(this));
|
||||
|
||||
|
@ -353,8 +353,13 @@ public class BungeeInformationManager extends InformationManager {
|
||||
@Override
|
||||
public void updateNetworkPageContent() {
|
||||
Collection<ServerInfo> online = serverInfoManager.getOnlineBukkitServers();
|
||||
bukkitServers.values().stream()
|
||||
.filter(s -> !online.contains(s)).map(ServerInfo::getUuid)
|
||||
online.stream().map(ServerInfo::getUuid)
|
||||
.forEach(this::removeNetworkPageContent);
|
||||
}
|
||||
|
||||
public void sendConfigSettings() {
|
||||
Collection<ServerInfo> online = serverInfoManager.getOnlineBukkitServers();
|
||||
online.stream().map(ServerInfo::getUuid)
|
||||
.forEach(serverInfoManager::sendConfigSettings);
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public class BungeeServerInfoManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void sendConfigSettings(UUID serverUUID) {
|
||||
public void sendConfigSettings(UUID serverUUID) {
|
||||
try {
|
||||
ServerInfo server = bukkitServers.get(serverUUID);
|
||||
if (server == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user