From f030ce263921af392b38e193fd8e4c5cb8c47ee4 Mon Sep 17 00:00:00 2001 From: Vincent <79623093+V1nc3ntWasTaken@users.noreply.github.com> Date: Thu, 4 Aug 2022 21:19:37 -0500 Subject: [PATCH 1/3] Updated version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8bcb3cb..17091e7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ me.doclic NoEncryption - 3.0 + 3.1-SNAPSHOT jar NoEncryption From c8d53fad28eb08fb0b96985ba5e05aa578d5ddef Mon Sep 17 00:00:00 2001 From: Vincent <79623093+V1nc3ntWasTaken@users.noreply.github.com> Date: Thu, 4 Aug 2022 21:22:24 -0500 Subject: [PATCH 2/3] Added integration with GitHub issue forms --- .github/ISSUE_TEMPLATE/bug_report.yml | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..9ab382a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,63 @@ +name: 🐞 Bug Report +description: Report a bug for NoEncryption (Must be using V1nc3ntWasTaken's fork). +body: + - type: checkboxes + attributes: + label: Is there an existing issue for this? + description: Please search to see if an issue already exists for the bug you encountered. + options: + - label: I have searched the existing issues and have not found a duplicate relating to my issue. + required: true + - type: checkboxes + attributes: + label: Are you using the latest version of NoEncryption (Must be using V1nc3ntWasTaken's fork)? + description: Please make sure you're using the latest version of NoEncryption as it's possible your issue has already been fixed. + options: + - label: I am using the latest version of MockBukkit. + required: true + - type: dropdown + id: ne-version + attributes: + label: NoEncryption Version + description: What NoEncryption version is your server running (Must be using V1nc3ntWasTaken's fork)? + options: + - 3.0 + - 2.1 + - type: dropdown + id: mv-version + attributes: + label: Minecraft Version + description: What Minecraft version is your server running? + options: + - 1.19.1 + - 1.19 + validations: + required: true + - type: textarea + id: fw-version + attributes: + label: Server Type + description: What server type and version are you running? Use the contents of /version + validations: + required: true + - type: textarea + id: bug-description + attributes: + label: Describe the bug + description: Describe the bug in as much detail as you can. + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Reproducible Test + description: Please write a test that can reliably reproduce the bug. Include any plugins that you may interact with in the time span. + validations: + required: true + - type: textarea + attributes: + label: Anything else? + description: | + Links? References? Anything that will give us more context about the issue you are encountering! + validations: + required: false \ No newline at end of file From 7a41328f140378cde8b79a5b5b7ecbbd47b33bf0 Mon Sep 17 00:00:00 2001 From: Vincent <79623093+V1nc3ntWasTaken@users.noreply.github.com> Date: Thu, 4 Aug 2022 21:23:37 -0500 Subject: [PATCH 3/3] Fixed a bug where system messages would kick the user --- .../doclic/noencryption/PlayerListener.java | 13 +++++-------- .../CompatiblePacketListener.java | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/main/java/me/doclic/noencryption/PlayerListener.java b/src/main/java/me/doclic/noencryption/PlayerListener.java index 27d5c42..24d0914 100644 --- a/src/main/java/me/doclic/noencryption/PlayerListener.java +++ b/src/main/java/me/doclic/noencryption/PlayerListener.java @@ -1,11 +1,8 @@ package me.doclic.noencryption; -import io.netty.channel.Channel; -import io.netty.channel.ChannelDuplexHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelPipeline; -import io.netty.channel.ChannelPromise; -import me.doclic.noencryption.compatibility.*; +import io.netty.channel.*; +import me.doclic.noencryption.compatibility.CompatiblePacketListener; +import me.doclic.noencryption.compatibility.CompatiblePlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -20,7 +17,7 @@ public void onPlayerJoin (PlayerJoinEvent e) { final Player player = e.getPlayer(); final ChannelPipeline pipeline = new CompatiblePlayer().getChannel(player).pipeline(); - pipeline.addBefore("packet_handler", player.getUniqueId().toString(), new ChannelDuplexHandler() { + pipeline.addBefore("packet_handler", "no_encryption", new ChannelDuplexHandler() { @Override public void channelRead(ChannelHandlerContext channelHandlerContext, Object packet) throws Exception { @@ -47,7 +44,7 @@ public void onPlayerQuit (PlayerQuitEvent e) { final Player player = e.getPlayer(); final Channel channel = new CompatiblePlayer().getChannel(player); - channel.eventLoop().submit(() -> channel.pipeline().remove(player.getUniqueId().toString())); + channel.eventLoop().submit(() -> channel.pipeline().remove("no_encryption")); } diff --git a/src/main/java/me/doclic/noencryption/compatibility/CompatiblePacketListener.java b/src/main/java/me/doclic/noencryption/compatibility/CompatiblePacketListener.java index c955525..442002b 100644 --- a/src/main/java/me/doclic/noencryption/compatibility/CompatiblePacketListener.java +++ b/src/main/java/me/doclic/noencryption/compatibility/CompatiblePacketListener.java @@ -2,8 +2,11 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelPromise; +import net.md_5.bungee.chat.ComponentSerializer; import net.minecraft.network.chat.*; +import net.minecraft.network.protocol.game.ClientboundPlayerChatHeaderPacket; import net.minecraft.network.protocol.game.ClientboundPlayerChatPacket; +import net.minecraft.network.protocol.game.ClientboundSystemChatPacket; import java.util.Optional; import java.util.UUID; @@ -40,6 +43,22 @@ public Object writePacket(ChannelHandlerContext channelHandlerContext, Object pa chatType); } + if (packet instanceof final ClientboundSystemChatPacket clientboundSystemChatPacket) { + return new ClientboundSystemChatPacket( + ComponentSerializer.parse(clientboundSystemChatPacket.content()), + clientboundSystemChatPacket.overlay()); + } + + if (packet instanceof final ClientboundPlayerChatHeaderPacket clientboundPlayerChatHeaderPacket) { + return new ClientboundPlayerChatHeaderPacket( + new SignedMessageHeader( + new MessageSignature(new byte[0]), + new UUID(0,0)), + new MessageSignature(new byte[0]), + clientboundPlayerChatHeaderPacket.bodyDigest() + ); + } + return packet; }