mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-11-22 23:08:30 +01:00
Remove IPv6 scope if present
This commit is contained in:
parent
f682cf1326
commit
5ce2c113ae
1 changed files with 8 additions and 1 deletions
|
@ -796,6 +796,13 @@ public class GeyserSession implements GeyserConnection, CommandSender {
|
||||||
FloodgateSkinUploader skinUploader = geyser.getSkinUploader();
|
FloodgateSkinUploader skinUploader = geyser.getSkinUploader();
|
||||||
FloodgateCipher cipher = geyser.getCipher();
|
FloodgateCipher cipher = geyser.getCipher();
|
||||||
|
|
||||||
|
String bedrockAddress = upstream.getAddress().getAddress().getHostAddress();
|
||||||
|
// both BungeeCord and Velocity remove the IPv6 scope (if there is one) for Spigot
|
||||||
|
int ipv6ScopeIndex = bedrockAddress.indexOf('%');
|
||||||
|
if (ipv6ScopeIndex != -1) {
|
||||||
|
bedrockAddress = bedrockAddress.substring(0, ipv6ScopeIndex);
|
||||||
|
}
|
||||||
|
|
||||||
encryptedData = cipher.encryptFromString(BedrockData.of(
|
encryptedData = cipher.encryptFromString(BedrockData.of(
|
||||||
clientData.getGameVersion(),
|
clientData.getGameVersion(),
|
||||||
authData.name(),
|
authData.name(),
|
||||||
|
@ -804,7 +811,7 @@ public class GeyserSession implements GeyserConnection, CommandSender {
|
||||||
clientData.getLanguageCode(),
|
clientData.getLanguageCode(),
|
||||||
clientData.getUiProfile().ordinal(),
|
clientData.getUiProfile().ordinal(),
|
||||||
clientData.getCurrentInputMode().ordinal(),
|
clientData.getCurrentInputMode().ordinal(),
|
||||||
upstream.getAddress().getAddress().getHostAddress(),
|
bedrockAddress,
|
||||||
skinUploader.getId(),
|
skinUploader.getId(),
|
||||||
skinUploader.getVerifyCode()
|
skinUploader.getVerifyCode()
|
||||||
).toString());
|
).toString());
|
||||||
|
|
Loading…
Reference in a new issue