forked from GeyserMC/Geyser
Added IGeyserPingPassthrough#getPingInformation(InetSocketAddress) to make logging of the pinging IPs possible (#1633)
Co-authored-by: qlow <info@qlow.eu>
This commit is contained in:
parent
798ae34cd1
commit
a173005767
7 changed files with 48 additions and 26 deletions
|
@ -63,7 +63,7 @@ public class ConnectorServerEventHandler implements BedrockServerEventHandler {
|
|||
GeyserPingInfo pingInfo = null;
|
||||
if (config.isPassthroughMotd() || config.isPassthroughPlayerCounts()) {
|
||||
IGeyserPingPassthrough pingPassthrough = connector.getBootstrap().getGeyserPingPassthrough();
|
||||
pingInfo = pingPassthrough.getPingInformation();
|
||||
pingInfo = pingPassthrough.getPingInformation(inetSocketAddress);
|
||||
}
|
||||
|
||||
BedrockPong pong = new BedrockPong();
|
||||
|
|
|
@ -70,7 +70,7 @@ public class GeyserLegacyPingPassthrough implements IGeyserPingPassthrough, Runn
|
|||
}
|
||||
|
||||
@Override
|
||||
public GeyserPingInfo getPingInformation() {
|
||||
public GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress) {
|
||||
return pingInfo;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,15 +27,29 @@ package org.geysermc.connector.ping;
|
|||
|
||||
import org.geysermc.connector.common.ping.GeyserPingInfo;
|
||||
|
||||
import java.net.Inet4Address;
|
||||
import java.net.InetSocketAddress;
|
||||
|
||||
/**
|
||||
* Interface that retrieves ping passthrough information from the Java server
|
||||
*/
|
||||
public interface IGeyserPingPassthrough {
|
||||
|
||||
/**
|
||||
* Get the MOTD of the server displayed on the multiplayer screen
|
||||
* Get the MOTD of the server displayed on the multiplayer screen. It uses a fake remote, as the remote isn't important in this context.
|
||||
*
|
||||
* @return string of the MOTD
|
||||
*/
|
||||
GeyserPingInfo getPingInformation();
|
||||
default GeyserPingInfo getPingInformation() {
|
||||
return this.getPingInformation(new InetSocketAddress(Inet4Address.getLoopbackAddress(), 69));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the MOTD of the server displayed on the multiplayer screen
|
||||
*
|
||||
* @param inetSocketAddress the ip address of the client pinging the server
|
||||
* @return string of the MOTD
|
||||
*/
|
||||
GeyserPingInfo getPingInformation(InetSocketAddress inetSocketAddress);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue