Add IP for players raw IP address

This commit is contained in:
md_5 2013-05-14 21:14:43 +10:00
parent 4b7af7558c
commit 6fd3486dab
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From aec07f66117cb86522e8f507bbd6e53780eb1e36 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 14 May 2013 21:11:29 +1000
Subject: [PATCH] BungeeCord Support
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index dec2214..602ecef 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -646,4 +646,13 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
* yet or has logged out
*/
public void setScoreboard(Scoreboard scoreboard) throws IllegalArgumentException, IllegalStateException;
+
+ // Spigot start
+ /**
+ * Gets the connection address of this player, regardless of whether it has been spoofed or not.
+ *
+ * @return the player's connection address
+ */
+ public InetSocketAddress getRawAddress();
+ // Spigot end
}
--
1.8.2.1

View File

@ -1,4 +1,4 @@
From 27f6ceb7a4ed65d7d04d6be7efce9cbbf5188a65 Mon Sep 17 00:00:00 2001 From ee5ca0a66101f023785a213a33eacb5be00b114f Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au> From: md_5 <md_5@live.com.au>
Date: Sat, 23 Mar 2013 11:15:11 +1100 Date: Sat, 23 Mar 2013 11:15:11 +1100
Subject: [PATCH] BungeeCord Support Subject: [PATCH] BungeeCord Support
@ -78,6 +78,21 @@ index f25852e..b327310 100644
if (metrics == null) { if (metrics == null) {
try { try {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 0b5ea21..fa9b9f1 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -1012,4 +1012,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
this.server.getScoreboardManager().setPlayerBoard(this, scoreboard);
}
+
+ // Spigot start
+ public InetSocketAddress getRawAddress() {
+ return (InetSocketAddress) this.getHandle().playerConnection.networkManager.getSocket().getRemoteSocketAddress();
+ }
+ // Spigot end
}
diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml diff --git a/src/main/resources/configurations/bukkit.yml b/src/main/resources/configurations/bukkit.yml
index eb23dae..62bf79a 100644 index eb23dae..62bf79a 100644
--- a/src/main/resources/configurations/bukkit.yml --- a/src/main/resources/configurations/bukkit.yml