mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +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";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user