use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.
the class ServerFileLoader method save.
@Override
public void save(Server server) {
try {
if (!prepared)
prepare();
server.getId().ifPresent(id -> set("Server.ID", id));
set("Server.UUID", server.getUuid());
set("Server.Web_address", server.getWebAddress());
save();
} catch (IOException e) {
throw new EnableException("Failed to write ServerInfoFile.yml: " + e.getMessage());
}
}
use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.
the class BungeeSystemTest method bungeeDoesNotEnableWithDefaultIP.
@Test
void bungeeDoesNotEnableWithDefaultIP() {
EnableException thrown = assertThrows(EnableException.class, () -> {
PlanSystem bungeeSystem = component.getPlanSystem();
try {
PlanConfig config = bungeeSystem.getConfigSystem().getConfig();
config.set(WebserverSettings.PORT, TEST_PORT_NUMBER);
config.set(ProxySettings.IP, "0.0.0.0");
DBSystem dbSystem = bungeeSystem.getDatabaseSystem();
SQLiteDB db = dbSystem.getSqLiteFactory().usingDefaultFile();
db.setTransactionExecutorServiceProvider(MoreExecutors::newDirectExecutorService);
dbSystem.setActiveDatabase(db);
// Throws EnableException
bungeeSystem.enable();
} finally {
bungeeSystem.disable();
}
});
assertEquals("IP setting still 0.0.0.0 - Configure Alternative_IP/IP that connects to the Proxy server.", thrown.getMessage());
}
use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.
the class ServerServerInfo method registerNew.
private Server registerNew(ServerUUID serverUUID) {
Server server = createServerObject(serverUUID);
logger.info("Registering a new server in database with UUID " + serverUUID);
fromDatabase.save(server);
Server stored = fromDatabase.load(serverUUID).orElseThrow(() -> new EnableException("Failed to register server (not found after saving to database)"));
fromFile.save(stored);
return stored;
}
use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.
the class ProxyServerInfo method registerServer.
private Server registerServer() {
Server proxy = createServerObject();
fromDatabase.save(proxy);
Server stored = fromDatabase.load(null).orElseThrow(() -> new EnableException("BungeeCord registration failed (DB)"));
fromFile.save(stored);
return stored;
}
use of com.djrapitops.plan.exceptions.EnableException in project Plan by plan-player-analytics.
the class VelocityServerInfo method registerServer.
private Server registerServer() {
Server proxy = createServerObject();
fromDatabase.save(proxy);
Server stored = fromDatabase.load(null).orElseThrow(() -> new EnableException("Velocity registration failed (DB)"));
fromFile.save(stored);
return stored;
}
Aggregations