mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-04-20 17:47:06 +00:00
Allow random server id
This commit is contained in:
parent
78ee62a98a
commit
4a4e6db36f
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<groupId>com.imaginarycode.minecraft</groupId>
|
<groupId>com.imaginarycode.minecraft</groupId>
|
||||||
<artifactId>RedisBungee</artifactId>
|
<artifactId>RedisBungee</artifactId>
|
||||||
<version>0.6</version>
|
<version>0.6.1</version>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
|
@ -415,6 +415,9 @@ public final class RedisBungee extends Plugin {
|
|||||||
final boolean useSSL = configuration.getBoolean("useSSL");
|
final boolean useSSL = configuration.getBoolean("useSSL");
|
||||||
String redisPassword = configuration.getString("redis-password");
|
String redisPassword = configuration.getString("redis-password");
|
||||||
String serverId = configuration.getString("server-id");
|
String serverId = configuration.getString("server-id");
|
||||||
|
if (serverId == null || serverId.isEmpty()) {
|
||||||
|
serverId = UUID.randomUUID().toString();
|
||||||
|
}
|
||||||
|
|
||||||
if (redisPassword != null && (redisPassword.isEmpty() || redisPassword.equals("none"))) {
|
if (redisPassword != null && (redisPassword.isEmpty() || redisPassword.equals("none"))) {
|
||||||
redisPassword = null;
|
redisPassword = null;
|
||||||
|
@ -8,6 +8,7 @@ import redis.clients.jedis.JedisPool;
|
|||||||
|
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public class RedisBungeeConfiguration {
|
public class RedisBungeeConfiguration {
|
||||||
@Getter
|
@Getter
|
||||||
@ -21,7 +22,12 @@ public class RedisBungeeConfiguration {
|
|||||||
|
|
||||||
public RedisBungeeConfiguration(JedisPool pool, Configuration configuration) {
|
public RedisBungeeConfiguration(JedisPool pool, Configuration configuration) {
|
||||||
this.pool = pool;
|
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);
|
this.registerBungeeCommands = configuration.getBoolean("register-bungee-commands", true);
|
||||||
|
|
||||||
List<String> stringified = configuration.getStringList("exempt-ip-addresses");
|
List<String> stringified = configuration.getStringList("exempt-ip-addresses");
|
||||||
|
@ -17,7 +17,7 @@ max-redis-connections: 8
|
|||||||
useSSL: false
|
useSSL: false
|
||||||
|
|
||||||
# An identifier for this BungeeCord instance.
|
# An identifier for this BungeeCord instance.
|
||||||
server-id: test1
|
server-id: ""
|
||||||
|
|
||||||
# Whether or not RedisBungee should install its version of regular BungeeCord commands.
|
# 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
|
# Often, the RedisBungee commands are desired, but in some cases someone may wish to
|
||||||
|
Loading…
Reference in New Issue
Block a user