Implement a way to get the users real IP.
This commit is contained in:
parent
7444fca999
commit
f7d1c168fc
@ -1,7 +1,9 @@
|
||||
package net.md_5.bungee;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
@ -413,6 +415,15 @@ public class UserConnection extends GenericConnection implements ProxiedPlayer
|
||||
break outer;
|
||||
}
|
||||
break;
|
||||
case "IP":
|
||||
ByteArrayOutputStream b = new ByteArrayOutputStream();
|
||||
DataOutputStream out = new DataOutputStream(b);
|
||||
out.writeUTF("IP");
|
||||
out.writeUTF(name);
|
||||
out.writeUTF(getAddress().getHostString());
|
||||
out.writeInt(getAddress().getPort());
|
||||
getServer().sendData("BungeeCord", b.toByteArray());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user