13
0
geforkt von Mirrors/Velocity

Allow disabling BungeeCord plugin message channel.

Dieser Commit ist enthalten in:
Andrew Steinborn 2020-04-28 14:10:54 -04:00
Ursprung 957c0dd307
Commit 37a1a49fda
2 geänderte Dateien mit 18 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -402,6 +402,10 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
return pingPassthrough;
}
public boolean isBungeePluginChannelEnabled() {
return advanced.isBungeePluginMessageChannel();
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
@ -654,6 +658,10 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
@ConfigKey("tcp-fast-open")
private boolean tcpFastOpen = false;
@Comment("Enables BungeeCord plugin messaging channel support on Velocity.")
@ConfigKey("bungee-plugin-message-channel")
private boolean bungeePluginMessageChannel = true;
private Advanced() {
}
@ -666,6 +674,7 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
this.readTimeout = toml.getLong("read-timeout", 30000L).intValue();
this.proxyProtocol = toml.getBoolean("proxy-protocol", false);
this.tcpFastOpen = toml.getBoolean("tcp-fast-open", false);
this.bungeePluginMessageChannel = toml.getBoolean("bungee-plugin-message-channel", true);
}
}
@ -697,6 +706,10 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
return tcpFastOpen;
}
public boolean isBungeePluginMessageChannel() {
return bungeePluginMessageChannel;
}
@Override
public String toString() {
return "Advanced{"
@ -707,6 +720,7 @@ public class VelocityConfiguration extends AnnotatedConfig implements ProxyConfi
+ ", readTimeout=" + readTimeout
+ ", proxyProtocol=" + proxyProtocol
+ ", tcpFastOpen=" + tcpFastOpen
+ ", bungeePluginMessageChannel=" + bungeePluginMessageChannel
+ '}';
}
}

Datei anzeigen

@ -273,6 +273,10 @@ class BungeeCordMessageResponder {
}
boolean process(PluginMessage message) {
if (!proxy.getConfiguration().isBungeePluginChannelEnabled()) {
return false;
}
if (!MODERN_CHANNEL.getId().equals(message.getChannel()) && !LEGACY_CHANNEL.getId()
.equals(message.getChannel())) {
return false;