Added the player his IP to the transferable data

This commit is contained in:
Tim203 2019-12-17 23:27:29 +01:00
parent 9527709c59
commit 64b04330c3
3 changed files with 18 additions and 8 deletions

View file

@ -221,7 +221,8 @@ public class GeyserSession implements Player {
authenticationData.getXboxUUID(),
clientData.getDeviceOS().ordinal(),
clientData.getLanguageCode(),
clientData.getCurrentInputMode().ordinal()
clientData.getCurrentInputMode().ordinal(),
upstream.getSession().getAddress().getAddress().getHostAddress()
));
} catch (Exception e) {
connector.getLogger().error("Failed to encrypt message", e);
@ -230,7 +231,7 @@ public class GeyserSession implements Player {
HandshakePacket handshakePacket = event.getPacket();
event.setPacket(new HandshakePacket(
handshakePacket.getProtocolVersion(),
handshakePacket.getHostname() + '\0' + "Geyser-Floodgate" + '\0' + encrypted,
handshakePacket.getHostname() + '\0' + BedrockData.FLOODGATE_IDENTIFIER + '\0' + encrypted,
handshakePacket.getPort(),
handshakePacket.getIntent()
));

View file

@ -92,7 +92,7 @@ public class BlockStorage {
}
private int legacyIdFor(int index) {
int runtimeId = this.palette.get(index);
int runtimeId = this.palette.getInt(index);
return GlobalBlockPalette.getLegacyId(runtimeId);
}