[SPIGOT-7171] Ability to get the IP/hostname players are requesting status of Created: 15/Oct/22 Updated: 25/Dec/24 Resolved: 28/Oct/22 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | New Feature | Priority: | Minor |
Reporter: | Marco Sirabella | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None |
Version: | 3599-Spigot-4aa5ead-aaf484f |
Guidelines Read: | Yes |
Description |
very related:
Basically, both of handshake packet's login (`PlayerLoginEvent`) & status (`ServerListPingEvent`) options embed the server address & port in it, but on the spigot side only `PlayerLoginEvent.getHostname()` exposes this. I would like for `ServerListPingEvent` to have an equivalent `.getHostname()` Somehow bungeecord manages a way around this with `ProxyPingEvent.getConnection().getVirtualHost().getHostName()` but I would not like to pull bungeecord in just for this small feature. |
Comments |
Comment by md_5 [ 28/Oct/22 ] |
Method added to mirror login event |
Comment by Marco Sirabella [ 15/Oct/22 ] |
Thanks for the quick response! `getAddress()` returns the address from the client sending the ping, while I would like the address/hostname/port that the client is pinging to |
Comment by Doc [ 15/Oct/22 ] |
Not tested but pretty sure you can get this info using https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/server/ServerListPingEvent.html#getAddress()
|