2022-07-16 12:50:09 +00:00
|
|
|
package com.imaginarycode.minecraft.redisbungee.api;
|
2022-04-13 13:14:08 +00:00
|
|
|
|
|
|
|
import com.google.common.collect.ImmutableList;
|
|
|
|
import com.google.common.net.InetAddresses;
|
|
|
|
|
|
|
|
import java.net.InetAddress;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
public class RedisBungeeConfiguration {
|
2022-07-17 11:38:00 +00:00
|
|
|
private final String proxyId;
|
2022-04-13 13:14:08 +00:00
|
|
|
private final List<InetAddress> exemptAddresses;
|
2022-06-15 02:32:22 +00:00
|
|
|
private final boolean overrideBungeeCommands;
|
2022-04-13 13:14:08 +00:00
|
|
|
private static RedisBungeeConfiguration config;
|
|
|
|
|
2022-07-17 11:38:00 +00:00
|
|
|
public RedisBungeeConfiguration(String proxyId, List<String> exemptAddresses, boolean overrideBungeeCommands) {
|
|
|
|
this.proxyId = proxyId;
|
2022-04-13 13:14:08 +00:00
|
|
|
|
|
|
|
ImmutableList.Builder<InetAddress> addressBuilder = ImmutableList.builder();
|
|
|
|
for (String s : exemptAddresses) {
|
|
|
|
addressBuilder.add(InetAddresses.forString(s));
|
|
|
|
}
|
|
|
|
this.exemptAddresses = addressBuilder.build();
|
|
|
|
config = this;
|
2022-06-15 02:32:22 +00:00
|
|
|
this.overrideBungeeCommands = overrideBungeeCommands;
|
2022-04-13 13:14:08 +00:00
|
|
|
}
|
|
|
|
|
2022-07-17 11:38:00 +00:00
|
|
|
public String getProxyId() {
|
|
|
|
return proxyId;
|
2022-04-13 13:14:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public List<InetAddress> getExemptAddresses() {
|
|
|
|
return exemptAddresses;
|
|
|
|
}
|
|
|
|
|
2022-06-15 02:32:22 +00:00
|
|
|
public boolean doOverrideBungeeCommands() {
|
|
|
|
return overrideBungeeCommands;
|
|
|
|
}
|
|
|
|
|
2022-04-13 13:14:08 +00:00
|
|
|
public static RedisBungeeConfiguration getConfig() {
|
|
|
|
return config;
|
|
|
|
}
|
|
|
|
}
|