mirror of
https://github.com/Nan1t/NanoLimbo.git
synced 2025-07-12 12:40:14 +02:00
Returning max version if using ip forwarding
This commit is contained in:
parent
088570b28e
commit
018d7b1e6f
@ -91,6 +91,10 @@ public class ClientConnection extends ChannelInboundHandlerAdapter {
|
||||
return address;
|
||||
}
|
||||
|
||||
public Version getClientVersion() {
|
||||
return clientVersion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
|
||||
if (state.equals(State.PLAY)) {
|
||||
|
@ -19,9 +19,13 @@ public class PacketStatusResponse implements PacketOut {
|
||||
|
||||
@Override
|
||||
public void encode(ByteMessage msg, Version version) {
|
||||
int protocol = server.getConfig().getInfoForwarding().isNone()
|
||||
? version.getProtocolNumber()
|
||||
: Version.getMax().getProtocolNumber();
|
||||
|
||||
String ver = server.getConfig().getPingData().getVersion();
|
||||
String desc = server.getConfig().getPingData().getDescription();
|
||||
String json = getResponseJson(ver, version.getProtocolNumber(),
|
||||
String json = getResponseJson(ver, protocol,
|
||||
server.getConfig().getMaxPlayers(), server.getConnections().getCount(), desc);
|
||||
|
||||
msg.writeString(json);
|
||||
|
@ -27,7 +27,8 @@ public final class Connections {
|
||||
|
||||
public void addConnection(ClientConnection connection) {
|
||||
connections.put(connection.getUuid(), connection);
|
||||
Logger.info("Player %s connected (%s)", connection.getUsername(), connection.getAddress());
|
||||
Logger.info("Player %s connected (%s) [%s]", connection.getUsername(),
|
||||
connection.getAddress(), connection.getClientVersion());
|
||||
}
|
||||
|
||||
public void removeConnection(ClientConnection connection) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user