mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-03-09 22:25:31 +00:00
make platforms can't see each other when using same redis server and network id
This commit is contained in:
parent
287f037774
commit
8177260991
@ -92,5 +92,5 @@ public interface RedisBungeePlugin<P> extends EventsPlatform {
|
||||
|
||||
void executeAsyncAfter(Runnable runnable, TimeUnit timeUnit, int time);
|
||||
|
||||
|
||||
String platformId();
|
||||
}
|
||||
|
@ -97,8 +97,9 @@ public interface ConfigLoader extends GenericConfigLoader {
|
||||
}
|
||||
|
||||
plugin.logInfo("Loaded network id " + networkId);
|
||||
|
||||
|
||||
// TO avoid proxies from different platforms from seeing each other.
|
||||
networkId = plugin.platformId() + "-" + networkId;
|
||||
plugin.logInfo("Platform is {} so network id is now is {}", plugin.platformId(), networkId);
|
||||
|
||||
boolean reconnectToLastServer = node.getNode("reconnect-to-last-server").getBoolean();
|
||||
boolean handleMotd = node.getNode("handle-motd").getBoolean(true);
|
||||
|
@ -50,6 +50,8 @@ useSSL: false
|
||||
|
||||
# An identifier for this network, which helps to separate redisbungee instances on same redis instance.
|
||||
# You can use environment variable 'REDISBUNGEE_NETWORK_ID' to override
|
||||
# Depending on the platform bungeecord or velocity system will append platform id to the network id
|
||||
# to prevent proxies from different platforms from seeing each other. since 0.13.0
|
||||
network-id: "main"
|
||||
|
||||
# An identifier for this BungeeCord / Velocity instance. Will randomly generate if leaving it blank.
|
||||
|
@ -355,9 +355,13 @@ public class RedisBungee extends Plugin implements RedisBungeePlugin<ProxiedPlay
|
||||
return api.getJedisPool();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onLangConfigLoad(LangConfiguration langConfiguration) {
|
||||
this.langConfiguration = langConfiguration;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String platformId() {
|
||||
return "bungeecord";
|
||||
}
|
||||
}
|
||||
|
@ -367,4 +367,9 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player>, Con
|
||||
public InputStream getResourceAsStream(String name) {
|
||||
return this.getClass().getClassLoader().getResourceAsStream(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String platformId() {
|
||||
return "velocity";
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user