teampathfinders / mirai

Robust dedicated server software for Minecraft: Bedrock Edition
https://teampathfinders.github.io/mirai/
Apache License 2.0
13 stars 1 forks source link

Identity data does not exist when it should #236

Closed RadiatedMonkey closed 7 months ago

RadiatedMonkey commented 8 months ago

Sometimes connecting fails with the following error:

thread '[5]' panicked at core\src\network\user.rs:304:29:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

This only seems to happen when the client for some reason fails to connect the first time and then you try to connect again. I assume this might be caused by Minecraft trying to continue where it left off previously (in this case it didn't manage to send the login packet) instead of fully reconnecting. So Minecraft would have already sent a disconnect packet causing the server to fully destroy all client data, but then on the second connection attempt, Minecraft immediately sends a login packet instead of first initiating the RakNet connection.

This seems more like a bug in the game than in the server and should probably be explicitly handled by the server by simply disconnecting the client and forcing them to fully reconnect.

RadiatedMonkey commented 7 months ago

Implemented a packet expectation system that fixes this issue by kicking the client for unexpected packets