mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2025-03-10 06:35:29 +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);
|
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);
|
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 reconnectToLastServer = node.getNode("reconnect-to-last-server").getBoolean();
|
||||||
boolean handleMotd = node.getNode("handle-motd").getBoolean(true);
|
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.
|
# 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
|
# 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"
|
network-id: "main"
|
||||||
|
|
||||||
# An identifier for this BungeeCord / Velocity instance. Will randomly generate if leaving it blank.
|
# 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();
|
return api.getJedisPool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLangConfigLoad(LangConfiguration langConfiguration) {
|
public void onLangConfigLoad(LangConfiguration langConfiguration) {
|
||||||
this.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) {
|
public InputStream getResourceAsStream(String name) {
|
||||||
return this.getClass().getClassLoader().getResourceAsStream(name);
|
return this.getClass().getClassLoader().getResourceAsStream(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String platformId() {
|
||||||
|
return "velocity";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user