Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2025-01-12 08:01:13 +01:00
Remove System.out.println() stuff
Dieser Commit ist enthalten in:
Ursprung
034039a27d
Commit
dc540ae776
@ -23,14 +23,12 @@ public class LoginSessionHandler implements MinecraftSessionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (packet instanceof SetCompression) {
|
if (packet instanceof SetCompression) {
|
||||||
System.out.println("Enabling compression on server connection, this is inefficient!");
|
|
||||||
SetCompression sc = (SetCompression) packet;
|
SetCompression sc = (SetCompression) packet;
|
||||||
connection.getChannel().setCompressionThreshold(sc.getThreshold());
|
connection.getChannel().setCompressionThreshold(sc.getThreshold());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet instanceof ServerLoginSuccess) {
|
if (packet instanceof ServerLoginSuccess) {
|
||||||
// the player has been logged on.
|
// the player has been logged on.
|
||||||
System.out.println("Player connected to remote server");
|
|
||||||
connection.getChannel().setState(StateRegistry.PLAY);
|
connection.getChannel().setState(StateRegistry.PLAY);
|
||||||
connection.getProxyPlayer().setConnectedServer(connection);
|
connection.getProxyPlayer().setConnectedServer(connection);
|
||||||
connection.getProxyPlayer().getConnection().setSessionHandler(new com.velocitypowered.proxy.connection.client.PlaySessionHandler(connection.getProxyPlayer()));
|
connection.getProxyPlayer().getConnection().setSessionHandler(new com.velocitypowered.proxy.connection.client.PlaySessionHandler(connection.getProxyPlayer()));
|
||||||
|
@ -21,7 +21,6 @@ public class PlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
if (packet instanceof Ping) {
|
if (packet instanceof Ping) {
|
||||||
// Make sure to reply back to the server so it doesn't think we're gone.
|
// Make sure to reply back to the server so it doesn't think we're gone.
|
||||||
connection.getChannel().write(packet);
|
connection.getChannel().write(packet);
|
||||||
connection.getProxyPlayer().getConnection().write(packet);
|
|
||||||
} else if (packet instanceof Disconnect) {
|
} else if (packet instanceof Disconnect) {
|
||||||
// The server wants to disconnect us. TODO fallback handling
|
// The server wants to disconnect us. TODO fallback handling
|
||||||
Disconnect original = (Disconnect) packet;
|
Disconnect original = (Disconnect) packet;
|
||||||
|
@ -36,7 +36,6 @@ public class StatusSessionHandler implements MinecraftSessionHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Status request
|
// Status request
|
||||||
System.out.println("Got status request!");
|
|
||||||
ServerPing ping = new ServerPing(
|
ServerPing ping = new ServerPing(
|
||||||
new ServerPing.Version(340, "1.12.2"),
|
new ServerPing.Version(340, "1.12.2"),
|
||||||
new ServerPing.Players(0, 0),
|
new ServerPing.Players(0, 0),
|
||||||
|
@ -24,7 +24,6 @@ public class LegacyPingEncoder extends MessageToByteEncoder<LegacyPingResponse>
|
|||||||
String serializedResponse = serialize(msg);
|
String serializedResponse = serialize(msg);
|
||||||
out.writeShort(serializedResponse.length());
|
out.writeShort(serializedResponse.length());
|
||||||
out.writeBytes(serializedResponse.getBytes(StandardCharsets.UTF_16BE));
|
out.writeBytes(serializedResponse.getBytes(StandardCharsets.UTF_16BE));
|
||||||
System.out.println(ByteBufUtil.prettyHexDump(out));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String serialize(LegacyPingResponse response) {
|
private String serialize(LegacyPingResponse response) {
|
||||||
|
@ -40,7 +40,6 @@ public class MinecraftDecoder extends MessageToMessageDecoder<ByteBuf> {
|
|||||||
throw new CorruptedFrameException("Error decoding " + packet.getClass() + " Direction " + direction
|
throw new CorruptedFrameException("Error decoding " + packet.getClass() + " Direction " + direction
|
||||||
+ " Protocol " + protocolVersion + " State " + state + " ID " + Integer.toHexString(packetId), e);
|
+ " Protocol " + protocolVersion + " State " + state + " ID " + Integer.toHexString(packetId), e);
|
||||||
}
|
}
|
||||||
System.out.println("IN: " + packet);
|
|
||||||
out.add(new PacketWrapper(packet, slice));
|
out.add(new PacketWrapper(packet, slice));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,6 @@ public class MinecraftEncoder extends MessageToByteEncoder<MinecraftPacket> {
|
|||||||
int packetId = mappings.getId(msg);
|
int packetId = mappings.getId(msg);
|
||||||
ProtocolUtils.writeVarInt(out, packetId);
|
ProtocolUtils.writeVarInt(out, packetId);
|
||||||
msg.encode(out, direction, protocolVersion);
|
msg.encode(out, direction, protocolVersion);
|
||||||
System.out.println("OUT: " + msg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getProtocolVersion() {
|
public int getProtocolVersion() {
|
||||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren