use of com.djrapitops.plan.extension.implementation.storage.queries.HasExtensionDataForPluginQuery in project Plan by plan-player-analytics.
the class ExtensionDisableOnGameServerTask method checkAndDisableProxyExtension.
private void checkAndDisableProxyExtension(ServerUUID proxyUUID, String pluginName) {
Database db = dbSystem.getDatabase();
ExtensionSettings extensionSettings = config.getExtensionSettings();
boolean isInstalledOnProxy = db.query(new HasExtensionDataForPluginQuery(pluginName, proxyUUID));
if (isInstalledOnProxy && extensionSettings.isEnabled(pluginName)) {
extensionSettings.setEnabled(pluginName, false);
logger.info("Set " + pluginName + " Extension as disabled in config since it is already enabled on the proxy server. This is to avoid duplicate data.");
}
}
Aggregations