2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-05 04:48:02 +00:00

Allow random server id

This commit is contained in:
Weihao 2021-05-08 02:21:35 -04:00
parent 78ee62a98a
commit 4a4e6db36f
4 changed files with 12 additions and 3 deletions

View File

@ -6,7 +6,7 @@
<groupId>com.imaginarycode.minecraft</groupId>
<artifactId>RedisBungee</artifactId>
<version>0.6</version>
<version>0.6.1</version>
<distributionManagement>
<repository>

View File

@ -415,6 +415,9 @@ public final class RedisBungee extends Plugin {
final boolean useSSL = configuration.getBoolean("useSSL");
String redisPassword = configuration.getString("redis-password");
String serverId = configuration.getString("server-id");
if (serverId == null || serverId.isEmpty()) {
serverId = UUID.randomUUID().toString();
}
if (redisPassword != null && (redisPassword.isEmpty() || redisPassword.equals("none"))) {
redisPassword = null;

View File

@ -8,6 +8,7 @@ import redis.clients.jedis.JedisPool;
import java.net.InetAddress;
import java.util.List;
import java.util.UUID;
public class RedisBungeeConfiguration {
@Getter
@ -21,7 +22,12 @@ public class RedisBungeeConfiguration {
public RedisBungeeConfiguration(JedisPool pool, Configuration configuration) {
this.pool = pool;
this.serverId = configuration.getString("server-id");
String serverId = configuration.getString("server-id");
if (serverId == null || serverId.isEmpty()) {
serverId = UUID.randomUUID().toString();
}
this.serverId = serverId;
this.registerBungeeCommands = configuration.getBoolean("register-bungee-commands", true);
List<String> stringified = configuration.getStringList("exempt-ip-addresses");

View File

@ -17,7 +17,7 @@ max-redis-connections: 8
useSSL: false
# An identifier for this BungeeCord instance.
server-id: test1
server-id: ""
# Whether or not RedisBungee should install its version of regular BungeeCord commands.
# Often, the RedisBungee commands are desired, but in some cases someone may wish to