mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 09:00:28 +08:00
Fixed regression issues from new code:
- Fixed StackOverFlow from ConfigNode equals using parent - Fixed enable fail due to call to ServerInfo#getServerUUID in constructor
This commit is contained in:
parent
b827e83dd5
commit
5c6442fdb2
@ -330,7 +330,6 @@ public class ConfigNode {
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ConfigNode that = (ConfigNode) o;
|
||||
return Objects.equals(key, that.key) &&
|
||||
Objects.equals(parent, that.parent) &&
|
||||
nodeOrder.equals(that.nodeOrder) &&
|
||||
childNodes.equals(that.childNodes) &&
|
||||
comment.equals(that.comment) &&
|
||||
@ -339,6 +338,6 @@ public class ConfigNode {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(key, parent, nodeOrder, childNodes, comment, value);
|
||||
return Objects.hash(key, childNodes, comment, value);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
@ -43,9 +42,9 @@ public class ServerSettingsManager implements SubSystem {
|
||||
private final PlanFiles files;
|
||||
private final PlanConfig config;
|
||||
private final DBSystem dbSystem;
|
||||
private ServerInfo serverInfo;
|
||||
private final TaskSystem taskSystem;
|
||||
private final ErrorHandler errorHandler;
|
||||
private final UUID serverUUID;
|
||||
private PluginLogger logger;
|
||||
private FileWatcher watcher;
|
||||
|
||||
@ -62,10 +61,10 @@ public class ServerSettingsManager implements SubSystem {
|
||||
this.files = files;
|
||||
this.config = config;
|
||||
this.dbSystem = dbSystem;
|
||||
this.serverInfo = serverInfo;
|
||||
this.taskSystem = taskSystem;
|
||||
this.logger = logger;
|
||||
this.errorHandler = errorHandler;
|
||||
serverUUID = serverInfo.getServerUUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -92,7 +91,7 @@ public class ServerSettingsManager implements SubSystem {
|
||||
|
||||
try {
|
||||
Config config = new ConfigReader(file.toPath()).read();
|
||||
database.save().saveConfig(serverUUID, config);
|
||||
database.save().saveConfig(serverInfo.getServerUUID(), config);
|
||||
} catch (IOException e) {
|
||||
throw new UncheckedIOException(e);
|
||||
}
|
||||
@ -112,7 +111,7 @@ public class ServerSettingsManager implements SubSystem {
|
||||
File configFile = files.getConfigFile();
|
||||
long lastModified = configFile.exists() ? configFile.lastModified() : -1;
|
||||
|
||||
Optional<Config> foundConfig = database.fetch().getNewConfig(lastModified, serverUUID);
|
||||
Optional<Config> foundConfig = database.fetch().getNewConfig(lastModified, serverInfo.getServerUUID());
|
||||
if (foundConfig.isPresent()) {
|
||||
try {
|
||||
new ConfigWriter(configFile.toPath()).write(foundConfig.get());
|
||||
|
Loading…
Reference in New Issue
Block a user