CloudburstMC / Protocol

A protocol library for Minecraft Bedrock Edition
https://git.io/ProtocolLib
Apache License 2.0
310 stars 96 forks source link

Fix ForceExperimentalGameplay option #207

Closed lt-name closed 1 year ago

lt-name commented 1 year ago

I use nk testing, and it seems that there is no need to send an additional boolean value.

Alemiz112 commented 1 year ago

Hi, this is not correct. In this case, if the flag value is true, it writes two booleans (don't ask me why 😅). See decompiled game code: image

lt-name commented 1 year ago

ok, got it, thanks for your answer

CoolLoong commented 10 months ago

I think this is still an error, which is the result of using ida decompilation in Windows 1.20.30 version of bds. serialize<LevelSettings>::write image At the same time, I use the 594 version protocol library to set StartGamePacket. startGamePacket.setForceExperimentalGameplay(OptionalBoolean.of(true)); When the player enter the server image

lt-name commented 10 months ago

According to my test results on nk and modified version of wdpe, it does have problems After the current protocol library is enabled in experimental mode, the client will report an error.

Alemiz112 commented 10 months ago

Hi, I just checked the IDA analyzed code on 1.20.30 for this again. But I can not seems to find anything that would match what you can see there. I am looking at serialize<LevelSettings>::write(const LevelSettings_1 *val, BinaryStream *stream), which has following contents: image

I also checked serialize<LevelSettings>::read(Bedrock::Result<LevelSettings,std::error_code>_0 *retstr, ReadOnlyBinaryStream *stream) to see if there is something different, but it does basically the same - if optional is present, writeBool(true) then writeBool(true) again else writeBool(false) only once.

CoolLoong commented 10 months ago

I'm not sure what caused the difference in our decompiled code. Are you using the Linux version?

CoolLoong commented 10 months ago

But regardless of the decompiled code, you can test the 594 protocol and it will not be able to enter the server.