mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Send known channels to the server when they send us theirs.
This commit is contained in:
3 files changed
+9
-14
No files matched your search
@@ -38,7 +38,7 @@ public class PacketLogger {
|
||||
common(connection.getReceiving(), connection.getSending(), packet);
|
||||
}
|
||||
|
||||
public void recv( Packet<?> packet) {
|
||||
public void recv(Packet<?> packet) {
|
||||
common(connection.getReceiving(), connection.getReceiving(), packet);
|
||||
}
|
||||
|
||||
@@ -51,12 +51,15 @@ public class PacketLogger {
|
||||
var data = new FriendlyByteBuf(Unpooled.buffer());
|
||||
|
||||
packet.write(data);
|
||||
LOGGER.info(MARKER, "{} {} {}\n{}", side, dir(flow), packet.getClass().getName(), HexDumper.dump(data));
|
||||
LOGGER.info(MARKER, "{} {} {}\n{}", side(side), dir(flow), packet.getClass().getName(), HexDumper.dump(data));
|
||||
} else {
|
||||
LOGGER.info(MARKER, "{} {} {}", side, dir(flow), packet.getClass().getName());
|
||||
LOGGER.info(MARKER, "{} {} {}", side(side), dir(flow), packet.getClass().getName());
|
||||
}
|
||||
}
|
||||
|
||||
private static String side(PacketFlow side) {
|
||||
return side == PacketFlow.CLIENTBOUND ? "CLIENT" : "SERVER";
|
||||
}
|
||||
private static String dir(PacketFlow flow) {
|
||||
return flow == PacketFlow.CLIENTBOUND ? "S->C" : "C->S";
|
||||
}
|
||||
|
||||
@@ -41,6 +41,9 @@ public class ChannelListManager {
|
||||
var ctx = evt.getSource();
|
||||
updateFrom(ctx, evt.getPayload(), ChannelRegistrationChangeEvent.Type.REGISTER);
|
||||
ctx.setPacketHandled(true);
|
||||
// Send the client's channels to the server whenever asked. If we're in the login state then our login wrapper will unwrap for us.
|
||||
if (ctx.isClientSide())
|
||||
addChannels(ctx.getConnection());
|
||||
}
|
||||
|
||||
private static void unregisterListener(CustomPayloadEvent evt) {
|
||||
|
||||
Reference in new issue
Block a user