mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-04-20 01:27:07 +00:00
fixed bug from last update
This commit is contained in:
parent
f1d26c8d5e
commit
8b22747b09
@ -415,13 +415,8 @@ public final class RedisBungee extends Plugin {
|
||||
final int redisPort = configuration.getInt("redis-port", 6379);
|
||||
final boolean useSSL = configuration.getBoolean("useSSL");
|
||||
String redisPassword = configuration.getString("redis-password");
|
||||
String serverId;
|
||||
String serverId = configuration.getString("server-id");
|
||||
final String randomUUID = UUID.randomUUID().toString();
|
||||
if (configuration.getBoolean("use-random-id-string", false)) {
|
||||
serverId = configuration.getString("server-id") + "-" + randomUUID;
|
||||
} else {
|
||||
serverId = configuration.getString("server-id");
|
||||
}
|
||||
|
||||
if (redisPassword != null && (redisPassword.isEmpty() || redisPassword.equals("none"))) {
|
||||
redisPassword = null;
|
||||
@ -429,6 +424,10 @@ public final class RedisBungee extends Plugin {
|
||||
|
||||
// Configuration sanity checks.
|
||||
if (serverId == null || serverId.isEmpty()) {
|
||||
/*
|
||||
* this check causes the config comments to disappear somehow
|
||||
* I think due snake yaml limitations so as todo: write our own yaml parser?
|
||||
*/
|
||||
String genId = UUID.randomUUID().toString();
|
||||
getLogger().info("Generated server id " + genId + " and saving it to config.");
|
||||
configuration.set("server-id", genId);
|
||||
@ -437,6 +436,10 @@ public final class RedisBungee extends Plugin {
|
||||
getLogger().info("Loaded server id " + serverId + '.');
|
||||
}
|
||||
|
||||
if (configuration.getBoolean("use-random-id-string", false)) {
|
||||
serverId = configuration.getString("server-id") + "-" + randomUUID;
|
||||
}
|
||||
|
||||
if (redisServer != null && !redisServer.isEmpty()) {
|
||||
final String finalRedisPassword = redisPassword;
|
||||
FutureTask<JedisPool> task = new FutureTask<>(new Callable<JedisPool>() {
|
||||
|
Loading…
Reference in New Issue
Block a user