mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-02-05 06:51:45 +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.BungeePlugin;
|
||||||
import com.djrapitops.plugin.settings.ColorScheme;
|
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.IPlan;
|
||||||
import main.java.com.djrapitops.plan.api.exceptions.DatabaseInitException;
|
import main.java.com.djrapitops.plan.api.exceptions.DatabaseInitException;
|
||||||
import main.java.com.djrapitops.plan.command.commands.ReloadCommand;
|
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 WebServer webServer;
|
||||||
private Database db;
|
private Database db;
|
||||||
private BungeeServerInfoManager serverInfoManager;
|
private BungeeServerInfoManager serverInfoManager;
|
||||||
private InformationManager infoManager;
|
private BungeeInformationManager infoManager;
|
||||||
private ServerVariableHolder variableHolder;
|
private ServerVariableHolder variableHolder;
|
||||||
|
|
||||||
private ProcessingQueue processingQueue;
|
private ProcessingQueue processingQueue;
|
||||||
@ -81,14 +82,20 @@ public class PlanBungee extends BungeePlugin<PlanBungee> implements IPlan {
|
|||||||
|
|
||||||
webServer.initServer();
|
webServer.initServer();
|
||||||
|
|
||||||
infoManager.attemptConnection();
|
|
||||||
|
|
||||||
if (!webServer.isEnabled()) {
|
if (!webServer.isEnabled()) {
|
||||||
Log.error("WebServer was not successfully initialized.");
|
Log.error("WebServer was not successfully initialized.");
|
||||||
disablePlugin();
|
disablePlugin();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getRunnableFactory().createNew("Enable Bukkit Connection Task", new AbsRunnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
infoManager.attemptConnection();
|
||||||
|
infoManager.sendConfigSettings();
|
||||||
|
}
|
||||||
|
}).runTaskAsynchronously();
|
||||||
|
|
||||||
getProxy().registerChannel("Plan");
|
getProxy().registerChannel("Plan");
|
||||||
registerListener(new BungeePluginChannelListener(this));
|
registerListener(new BungeePluginChannelListener(this));
|
||||||
|
|
||||||
|
@ -353,8 +353,13 @@ public class BungeeInformationManager extends InformationManager {
|
|||||||
@Override
|
@Override
|
||||||
public void updateNetworkPageContent() {
|
public void updateNetworkPageContent() {
|
||||||
Collection<ServerInfo> online = serverInfoManager.getOnlineBukkitServers();
|
Collection<ServerInfo> online = serverInfoManager.getOnlineBukkitServers();
|
||||||
bukkitServers.values().stream()
|
online.stream().map(ServerInfo::getUuid)
|
||||||
.filter(s -> !online.contains(s)).map(ServerInfo::getUuid)
|
|
||||||
.forEach(this::removeNetworkPageContent);
|
.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 {
|
try {
|
||||||
ServerInfo server = bukkitServers.get(serverUUID);
|
ServerInfo server = bukkitServers.get(serverUUID);
|
||||||
if (server == null) {
|
if (server == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user