13
0
geforkt von Mirrors/Velocity
This is creating more problems than it actually solves
Dieser Commit ist enthalten in:
Andrew Steinborn 2020-08-22 02:40:35 -04:00
Ursprung c47d25c88a
Commit 1f621300f6
5 geänderte Dateien mit 1 neuen und 30 gelöschten Zeilen

Datei anzeigen

@ -150,11 +150,4 @@ public interface ProxyConfig {
* @return read timeout (in milliseconds)
*/
int getReadTimeout();
/**
* Get how long this proxy will wait until performing an initial read timeout.
*
* @return read timeout (in milliseconds)
*/
int getInitialReadTimeout();
}

Datei anzeigen

@ -329,11 +329,6 @@ public class VelocityConfiguration implements ProxyConfig {
return advanced.getReadTimeout();
}
@Override
public int getInitialReadTimeout() {
return advanced.getInitialReadTimeout();
}
public boolean isProxyProtocol() {
return advanced.isProxyProtocol();
}
@ -627,7 +622,6 @@ public class VelocityConfiguration implements ProxyConfig {
private boolean failoverOnUnexpectedServerDisconnect = true;
private boolean announceProxyCommands = true;
private boolean logCommandExecutions = false;
private int initialReadTimeout = 3000;
private Advanced() {
}
@ -647,7 +641,6 @@ public class VelocityConfiguration implements ProxyConfig {
.getOrElse("failover-on-unexpected-server-disconnect", true);
this.announceProxyCommands = config.getOrElse("announce-proxy-commands", true);
this.logCommandExecutions = config.getOrElse("log-command-executions", false);
this.initialReadTimeout = config.getIntOrElse("initial-read-timeout", 3000);
}
}
@ -699,10 +692,6 @@ public class VelocityConfiguration implements ProxyConfig {
return logCommandExecutions;
}
public int getInitialReadTimeout() {
return initialReadTimeout;
}
@Override
public String toString() {
return "Advanced{"

Datei anzeigen

@ -25,7 +25,6 @@ import com.velocitypowered.proxy.config.PlayerInfoForwarding;
import com.velocitypowered.proxy.config.VelocityConfiguration;
import com.velocitypowered.proxy.connection.MinecraftConnection;
import com.velocitypowered.proxy.connection.MinecraftSessionHandler;
import com.velocitypowered.proxy.network.Connections;
import com.velocitypowered.proxy.protocol.StateRegistry;
import com.velocitypowered.proxy.protocol.packet.Disconnect;
import com.velocitypowered.proxy.protocol.packet.EncryptionRequest;
@ -34,7 +33,6 @@ import com.velocitypowered.proxy.protocol.packet.ServerLogin;
import com.velocitypowered.proxy.protocol.packet.ServerLoginSuccess;
import com.velocitypowered.proxy.protocol.packet.SetCompression;
import io.netty.buffer.ByteBuf;
import io.netty.handler.timeout.ReadTimeoutHandler;
import java.net.InetSocketAddress;
import java.security.GeneralSecurityException;
import java.security.KeyPair;
@ -200,12 +198,6 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
}
private void initializePlayer(GameProfile profile, boolean onlineMode) {
// Restore normal timeout for connection.
mcConnection.getChannel().pipeline()
.replace(Connections.READ_TIMEOUT, Connections.READ_TIMEOUT,
new ReadTimeoutHandler(server.getConfiguration().getReadTimeout(),
TimeUnit.MILLISECONDS));
// Some connection types may need to alter the game profile.
profile = mcConnection.getType().addGameProfileTokensIfRequired(profile,
server.getConfiguration().getPlayerInfoForwardingMode());

Datei anzeigen

@ -37,7 +37,7 @@ public class ServerChannelInitializer extends ChannelInitializer<Channel> {
protected void initChannel(final Channel ch) {
ch.pipeline()
.addLast(READ_TIMEOUT,
new ReadTimeoutHandler(this.server.getConfiguration().getInitialReadTimeout(),
new ReadTimeoutHandler(this.server.getConfiguration().getReadTimeout(),
TimeUnit.MILLISECONDS))
.addLast(LEGACY_PING_DECODER, new LegacyPingDecoder())
.addLast(FRAME_DECODER, new MinecraftVarintFrameDecoder())

Datei anzeigen

@ -105,9 +105,6 @@ connection-timeout = 5000
# Specify a read timeout for connections here. The default is 30 seconds.
read-timeout = 30000
# Specify an initial read timeout for connections here. The default is 3 seconds.
initial-read-timeout = 3000
# Enables compatibility with HAProxy.
proxy-protocol = false