GeyserMC / Geyser

A bridge/proxy allowing you to connect to Minecraft: Java Edition servers with Minecraft: Bedrock Edition.
https://geysermc.org
MIT License
4.74k stars 682 forks source link

Can't connect from W10M #520

Closed DjArt closed 4 years ago

DjArt commented 4 years ago

Describe the bug Can't connect to server due deserialization issues. Log:

[07:30:03 ERROR]: [com.nukkitx.network.raknet.RakNetServer] An exception occurred in RakNet
java.lang.RuntimeException: Unable to complete login
        at org.geysermc.connector.utils.LoginEncryptionUtils.encryptConnectionWithCert(LoginEncryptionUtils.java:138) ~[?:?]
        at org.geysermc.connector.utils.LoginEncryptionUtils.encryptPlayerConnection(LoginEncryptionUtils.java:100) ~[?:?]
        at org.geysermc.connector.network.UpstreamPacketHandler.handle(UpstreamPacketHandler.java:57) ~[?:?]
        at com.nukkitx.protocol.bedrock.packet.LoginPacket.handle(LoginPacket.java:16) ~[?:?]
        at com.nukkitx.protocol.bedrock.handler.DefaultBatchHandler.handle(DefaultBatchHandler.java:22) ~[?:?]
        at com.nukkitx.protocol.bedrock.BedrockSession.onWrappedPacket(BedrockSession.java:272) ~[?:?]
        at com.nukkitx.protocol.bedrock.BedrockRakNetSessionListener.onEncapsulated(BedrockRakNetSessionListener.java:28) ~[?:?]
        at com.nukkitx.network.raknet.RakNetSession.onEncapsulatedInternal(RakNetSession.java:307) ~[?:?]
        at com.nukkitx.network.raknet.RakNetSession.onOrderedReceived(RakNetSession.java:434) ~[?:?]
        at com.nukkitx.network.raknet.RakNetSession.checkForOrdered(RakNetSession.java:412) ~[?:?]
        at com.nukkitx.network.raknet.RakNetSession.onRakNetDatagram(RakNetSession.java:400) ~[?:?]
        at com.nukkitx.network.raknet.RakNetSession.onDatagram(RakNetSession.java:279) ~[?:?]
        at com.nukkitx.network.raknet.RakNetServer$ServerDatagramHandler.channelRead(RakNetServer.java:288) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:93) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:635) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:552) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050) ~[?:?]
        at org.geysermc.platform.bukkit.shaded.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[?:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
Caused by: java.lang.IllegalArgumentException: Cannot deserialize value of type `org.geysermc.floodgate.util.DeviceOS` from number 14: index value outside legal index range [0..13]
 at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: org.geysermc.connector.network.session.auth.BedrockClientData["DeviceOS"])
        at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:3750) ~[?:?]
        at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:3668) ~[?:?]
        at org.geysermc.connector.utils.LoginEncryptionUtils.encryptConnectionWithCert(LoginEncryptionUtils.java:131) ~[?:?]
        ... 27 more
Caused by: com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type `org.geysermc.floodgate.util.DeviceOS` from number 14: index value outside legal index range [0..13]
 at [Source: UNKNOWN; line: -1, column: -1] (through reference chain: org.geysermc.connector.network.session.auth.BedrockClientData["DeviceOS"])
        at com.fasterxml.jackson.databind.exc.InvalidFormatException.from(InvalidFormatException.java:67) ~[?:?]
        at com.fasterxml.jackson.databind.DeserializationContext.weirdNumberException(DeserializationContext.java:1564) ~[?:?]
        at com.fasterxml.jackson.databind.DeserializationContext.handleWeirdNumberValue(DeserializationContext.java:954) ~[?:?]
        at com.fasterxml.jackson.databind.deser.std.EnumDeserializer.deserialize(EnumDeserializer.java:200) ~[?:?]
        at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:136) ~[?:?]
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288) ~[?:?]
        at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) ~[?:?]
        at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:3745) ~[?:?]
        at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:3668) ~[?:?]
        at org.geysermc.connector.utils.LoginEncryptionUtils.encryptConnectionWithCert(LoginEncryptionUtils.java:131) ~[?:?]
        ... 27 more

To Reproduce Just try connect to server from Windows 10 Mobile.

Server Version PaperMC 264

Geyser Version V1.0-snapshot Bukkit #129

Minecraft: Bedrock Edition Version Windows 10 1.14.60 (Not mobile, usual desktop version installed on W10M)

Additional content I think just MC Bedrock Windows 10 Edition sends family of OS, like HoloLens or Desktop or Mobile, and deserialization breaks on unknown string. Also, I think, that issue can be reproduced on Windows IoT Core.

cona12312412412 commented 4 years ago

I still have that problem.