mirror of
https://github.com/ViaVersion/ViaProxy.git
synced 2025-04-15 07:44:25 -04:00
Added config option to disable ViaProxy transfer packet rewriting
This commit is contained in:
parent
45dcdfdc98
commit
80c970698d
2 changed files with 17 additions and 1 deletions
src/main/java/net/raphimc/viaproxy
|
@ -155,6 +155,13 @@ public class ViaProxyConfig {
|
|||
})
|
||||
private boolean bungeecordPlayerInfoPassthrough = false;
|
||||
|
||||
@Option("rewrite-transfer-packets")
|
||||
@Description({
|
||||
"Enabling this will rewrite transfer packets to point back to ViaProxy. This allows ViaProxy to perform protocol translation when forwarding the player to the actual server from the transfer packet.",
|
||||
"This should be left enabled unless you are a server owner and the servers you are transferring to perform their own protocol translation."
|
||||
})
|
||||
private boolean rewriteTransferPackets = true;
|
||||
|
||||
@Option("custom-motd")
|
||||
@Description("Custom MOTD to send when clients ping the proxy. Leave empty to use the target server's MOTD.")
|
||||
private String customMotd = "";
|
||||
|
@ -454,6 +461,15 @@ public class ViaProxyConfig {
|
|||
this.save();
|
||||
}
|
||||
|
||||
public boolean shouldRewriteTransferPackets() {
|
||||
return this.rewriteTransferPackets;
|
||||
}
|
||||
|
||||
public void setRewriteTransferPackets(final boolean rewriteTransferPackets) {
|
||||
this.rewriteTransferPackets = rewriteTransferPackets;
|
||||
this.save();
|
||||
}
|
||||
|
||||
public String getCustomMotd() {
|
||||
return this.customMotd;
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ public class Client2ProxyHandler extends SimpleChannelInboundHandler<Packet> {
|
|||
this.proxyConnection.getPacketHandlers().add(new CompressionPacketHandler(this.proxyConnection));
|
||||
this.proxyConnection.getPacketHandlers().add(new LoginPacketHandler(this.proxyConnection));
|
||||
this.proxyConnection.getPacketHandlers().add(new DisconnectPacketHandler(this.proxyConnection));
|
||||
if (clientVersion.newerThanOrEqualTo(ProtocolVersion.v1_20_5)) {
|
||||
if (ViaProxy.getConfig().shouldRewriteTransferPackets() && clientVersion.newerThanOrEqualTo(ProtocolVersion.v1_20_5)) {
|
||||
this.proxyConnection.getPacketHandlers().add(new TransferPacketHandler(this.proxyConnection));
|
||||
}
|
||||
if (clientVersion.newerThanOrEqualTo(ProtocolVersion.v1_20_2) || serverVersion.newerThanOrEqualTo(ProtocolVersion.v1_20_2)) {
|
||||
|
|
Loading…
Add table
Reference in a new issue