Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-16 21:10:30 +01:00
Ursprung
c47d25c88a
Commit
1f621300f6
@ -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();
|
||||
}
|
||||
|
@ -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{"
|
||||
|
@ -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());
|
||||
|
@ -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())
|
||||
|
@ -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
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren