aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch
diff options
context:
space:
mode:
authorJake Potrebic <[email protected]>2023-06-08 09:09:43 -0700
committerJake Potrebic <[email protected]>2023-06-08 09:09:43 -0700
commit1a0280ccc061b692bfb251a5d90f0c98cd91c4c7 (patch)
tree7ef4faeb9fd5c97355872ec42593c69975c77fca /patches/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch
parentf80338725eececbe7386e3672b02d3d67be6c71d (diff)
downloadPaper-1a0280ccc061b692bfb251a5d90f0c98cd91c4c7.tar.gz
Paper-1a0280ccc061b692bfb251a5d90f0c98cd91c4c7.zip
apply a couple network patches
Diffstat (limited to 'patches/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch')
-rw-r--r--patches/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/patches/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch b/patches/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch
new file mode 100644
index 0000000000..32ba58aa32
--- /dev/null
+++ b/patches/server/0597-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch
@@ -0,0 +1,25 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Connor Linfoot <[email protected]>
+Date: Wed, 12 May 2021 08:09:19 +0100
+Subject: [PATCH] Add raw address to AsyncPlayerPreLoginEvent
+
+
+diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+index c9f8f61c43428c519c0dac1b7416bad775e3429f..b026c003e1fc02a9ea426f3126acb788fc09a874 100644
+--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
++++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+@@ -331,12 +331,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
+ public void fireEvents() throws Exception {
+ String playerName = ServerLoginPacketListenerImpl.this.gameProfile.getName();
+ java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress();
++ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) connection.channel.remoteAddress()).getAddress(); // Paper
+ java.util.UUID uniqueId = ServerLoginPacketListenerImpl.this.gameProfile.getId();
+ final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;
+
+ // Paper start
+ com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(ServerLoginPacketListenerImpl.this.gameProfile);
+- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile);
++ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); // Paper - add rawAddress
+ server.getPluginManager().callEvent(asyncEvent);
+ profile = asyncEvent.getPlayerProfile();
+ profile.complete(true); // Paper - setPlayerProfileAPI