Paper/patches/server/0593-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch

26 Zeilen
2.1 KiB
Diff

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Connor Linfoot <connorlinfoot@me.com>
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
2023-09-23 00:33:14 +02:00
index 7ae0ecc93a92edeb172d9ed0709c8f7f068cdf4e..2580e8e37cee802aa4f8f3ca5df2cc4914e28daf 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
2023-09-22 07:41:27 +02:00
@@ -289,12 +289,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
public void fireEvents(GameProfile gameprofile) throws Exception {
String playerName = gameprofile.getName();
2021-06-15 04:59:31 +02:00
java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress();
2023-09-22 07:41:27 +02:00
+ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.channel.remoteAddress()).getAddress(); // Paper
java.util.UUID uniqueId = gameprofile.getId();
2021-06-11 14:02:28 +02:00
final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server;
2022-03-01 06:43:03 +01:00
// Paper start
2023-09-22 07:41:27 +02:00
com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile);
2022-03-01 06:43:03 +01:00
- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile);
+ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); // Paper - add rawAddress
2021-06-11 14:02:28 +02:00
server.getPluginManager().callEvent(asyncEvent);
2022-03-01 06:43:03 +01:00
profile = asyncEvent.getPlayerProfile();
profile.complete(true); // Paper - setPlayerProfileAPI