Log message when loading server information
This commit is contained in:
parent
dbb11be8e0
commit
2c67e063ea
|
@ -23,6 +23,8 @@ import com.djrapitops.plan.identification.storage.ServerDBLoader;
|
|||
import com.djrapitops.plan.identification.storage.ServerFileLoader;
|
||||
import com.djrapitops.plan.identification.storage.ServerLoader;
|
||||
import com.djrapitops.plan.processing.Processing;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
import com.djrapitops.plan.settings.locale.lang.PluginLang;
|
||||
import net.playeranalytics.plugin.server.PluginLogger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -41,6 +43,8 @@ public class BungeeServerInfo extends ServerInfo {
|
|||
|
||||
private final Processing processing;
|
||||
private final Addresses addresses;
|
||||
|
||||
private final Locale locale;
|
||||
private final PluginLogger logger;
|
||||
|
||||
@Inject
|
||||
|
@ -50,6 +54,7 @@ public class BungeeServerInfo extends ServerInfo {
|
|||
ServerDBLoader fromDatabase,
|
||||
Processing processing,
|
||||
Addresses addresses,
|
||||
Locale locale,
|
||||
PluginLogger logger
|
||||
) {
|
||||
super(serverProperties);
|
||||
|
@ -57,11 +62,13 @@ public class BungeeServerInfo extends ServerInfo {
|
|||
this.fromDatabase = fromDatabase;
|
||||
this.processing = processing;
|
||||
this.addresses = addresses;
|
||||
this.locale = locale;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadServerInfo() {
|
||||
logger.info(locale.getString(PluginLang.LOADING_SERVER_INFO));
|
||||
checkIfDefaultIP();
|
||||
|
||||
this.server = fromFile.load(null).orElseGet(() -> fromDatabase.load(null)
|
||||
|
|
|
@ -25,6 +25,9 @@ import com.djrapitops.plan.identification.storage.ServerLoader;
|
|||
import com.djrapitops.plan.processing.Processing;
|
||||
import com.djrapitops.plan.settings.config.PlanConfig;
|
||||
import com.djrapitops.plan.settings.config.paths.PluginSettings;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
import com.djrapitops.plan.settings.locale.lang.PluginLang;
|
||||
import net.playeranalytics.plugin.server.PluginLogger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
@ -47,6 +50,9 @@ public class ServerServerInfo extends ServerInfo {
|
|||
private final Processing processing;
|
||||
private final Addresses addresses;
|
||||
|
||||
private final Locale locale;
|
||||
private final PluginLogger logger;
|
||||
|
||||
@Inject
|
||||
public ServerServerInfo(
|
||||
ServerProperties serverProperties,
|
||||
|
@ -54,7 +60,9 @@ public class ServerServerInfo extends ServerInfo {
|
|||
ServerDBLoader fromDatabase,
|
||||
Processing processing,
|
||||
PlanConfig config,
|
||||
Addresses addresses
|
||||
Addresses addresses,
|
||||
Locale locale,
|
||||
PluginLogger logger
|
||||
) {
|
||||
super(serverProperties);
|
||||
this.fromFile = fromFile;
|
||||
|
@ -62,10 +70,13 @@ public class ServerServerInfo extends ServerInfo {
|
|||
this.processing = processing;
|
||||
this.addresses = addresses;
|
||||
this.config = config;
|
||||
this.locale = locale;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadServerInfo() {
|
||||
logger.info(locale.getString(PluginLang.LOADING_SERVER_INFO));
|
||||
Optional<Server> loaded = fromFile.load(null);
|
||||
server = loaded.orElseGet(this::registerNew);
|
||||
processing.submitNonCritical(this::updateStorage);
|
||||
|
|
|
@ -83,7 +83,8 @@ public enum PluginLang implements Lang {
|
|||
DB_APPLIED_PATCHES_ALREADY("Database - Patches Applied Already", "All database patches already applied."),
|
||||
DB_NOTIFY_CLEAN("Database Notify - Clean", "Removed data of ${0} players."),
|
||||
DB_NOTIFY_SQLITE_WAL("Database Notify - SQLite No WAL", "SQLite WAL mode not supported on this server version, using default. This may or may not affect performance."),
|
||||
DB_MYSQL_LAUNCH_OPTIONS_FAIL("Database MySQL - Launch Options Error", "Launch Options were faulty, using default (${0})");
|
||||
DB_MYSQL_LAUNCH_OPTIONS_FAIL("Database MySQL - Launch Options Error", "Launch Options were faulty, using default (${0})"),
|
||||
LOADING_SERVER_INFO("ServerInfo - Loading", "Loading server identifying information");
|
||||
|
||||
private final String identifier;
|
||||
private final String defaultValue;
|
||||
|
|
|
@ -23,6 +23,8 @@ import com.djrapitops.plan.identification.storage.ServerDBLoader;
|
|||
import com.djrapitops.plan.identification.storage.ServerFileLoader;
|
||||
import com.djrapitops.plan.identification.storage.ServerLoader;
|
||||
import com.djrapitops.plan.processing.Processing;
|
||||
import com.djrapitops.plan.settings.locale.Locale;
|
||||
import com.djrapitops.plan.settings.locale.lang.PluginLang;
|
||||
import net.playeranalytics.plugin.server.PluginLogger;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -41,6 +43,8 @@ public class VelocityServerInfo extends ServerInfo {
|
|||
|
||||
private final Processing processing;
|
||||
private final Addresses addresses;
|
||||
|
||||
private final Locale locale;
|
||||
private final PluginLogger logger;
|
||||
|
||||
@Inject
|
||||
|
@ -48,7 +52,9 @@ public class VelocityServerInfo extends ServerInfo {
|
|||
ServerProperties serverProperties,
|
||||
ServerFileLoader fromFile,
|
||||
ServerDBLoader fromDatabase,
|
||||
Processing processing, Addresses addresses,
|
||||
Processing processing,
|
||||
Addresses addresses,
|
||||
Locale locale,
|
||||
PluginLogger logger
|
||||
) {
|
||||
super(serverProperties);
|
||||
|
@ -56,11 +62,13 @@ public class VelocityServerInfo extends ServerInfo {
|
|||
this.fromDatabase = fromDatabase;
|
||||
this.processing = processing;
|
||||
this.addresses = addresses;
|
||||
this.locale = locale;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadServerInfo() {
|
||||
logger.info(locale.getString(PluginLang.LOADING_SERVER_INFO));
|
||||
checkIfDefaultIP();
|
||||
|
||||
this.server = fromFile.load(null).orElseGet(() -> fromDatabase.load(null)
|
||||
|
|
Loading…
Reference in New Issue