Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physics change between geyser 2.4.4-SNAPSHOT 2.5.0-SNAPSHOT causing anti-cheat issues #5129

Open
SergioK29 opened this issue Nov 6, 2024 · 18 comments

Comments

@SergioK29
Copy link

SergioK29 commented Nov 6, 2024

Describe the bug

As we all know, despite mojang removing the obfuscation maps, there do still exist cheats for bedrock edition,
therefore as java server owners we must check bedrock players for movement cheats.

I have my own anticheat which checks the physics of bedrock players and it has worked mostly without flaw since 2022 but a recent change in geyser has changed the physics of bedrock players, making it farther from java movement.

I know geyser is the cause as on either bedrock version (1.21.43 / 1.21.44), it works perfectly fine on 2.4.4-SNAPSHOT but flags on 2.5.0-SNAPSHOT, a pattern I have noticed is the difference primarily happens when sprint jumping on slabs or right after sprint-jumping up a block.

To Reproduce

Measure physics differences for the same bedrock client between geyser versions 2.4.4-SNAPSHOT and 2.5.0-SNAPSHOT, often happens while sprint jumping on slabs or sprint jumping up blocks

Expected behaviour

Physics should not have changed, physics of bedrock itself hasn't since at-least 2022.

Screenshots / Videos

No response

Server Version and Plugins

latest paper 1.21.1

This server is running Paper version 1.21.1-DEV-master@d348cb8 (2024-10-30T15:37:43Z) (Implementing API version 1.21.1-R0.1-SNAPSHOT)
You are 138 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: 1.21.1-DEV-14a48cd (MC: 1.21.1)

Geyser Dump

https://pastebin.com/2tPsW21u (issue occurs on both test environment and production, 2 very different machines, so likely not an issue caused by plugins/architecture)

Geyser Version

2.5.0-SNAPSHOT 6983095/g

Minecraft: Bedrock Edition Device/Version

Issue with versions 1.21.43 and 1.21.44

Additional Context

I need help finding version 2.4.4-SNAPSHOT in order to drill down which exact commit hash changed physics, I have a jar of it but on the geyser github the version jumps from 2.4.3-SNAPSHOT to 2.5.0-SNAPSHOT

@SergioK29 SergioK29 changed the title physics change between geyser 2.4.4-SNAPSHOT 2.5.0-SNAPSHOT when Physics change between geyser 2.4.4-SNAPSHOT 2.5.0-SNAPSHOT causing anti-cheat issues Nov 6, 2024
@onebeastchris
Copy link
Member

onebeastchris commented Nov 6, 2024

This is likely due to the switch in Geyser from Bedrock's client-auth to server-auth movement. This was forced upon us as Bedrock is due to remove client auth movement this fall.
The Java client performs a lot of movement checks client-side, which Geyser currently doesn't perfectly (if at all) replicate, hence somewhat relying on the Bedrock client. Implementing exact movement is technically possible - with e.g. server auth with rewind even more seo - but is very time-intensive and not currently a priority.

That said, if there are specific examples around "different physics" that you would like to share, we'd consider looking into them. However, the things mentioned were relatively vague - we'd need a bit more (replication steps, mainly; and a better description than just "different physics").

@SergioK29
Copy link
Author

its confirmed working on d61ad7b, but when I try to branch from the commit after that, d61ad7b disappears from the git history, wtf? 😕

@Tim203
Copy link
Member

Tim203 commented Nov 6, 2024

It got, most likely, merged with the 1.21.2/3 branch after that.

@SergioK29
Copy link
Author

It got, most likely, merged with the 1.21.2/3 branch after that.

how can I roll git back to 4d15c7f without d61ad7b (the commit right before it) disappearing? I tried branch from commit but it disappears, so weird.

@SergioK29
Copy link
Author

anywhere I can just browse the jars for each commit hash? would make life alot easier.

@onebeastchris
Copy link
Member

This is the latest 2.4.2 build - https://download.geysermc.org/v2/projects/geyser/versions/2.4.4/builds/705/downloads/spigot
That's the one without any of the 1.21.2/3 changes, which introduced server auth movement.

@SergioK29
Copy link
Author

SergioK29 commented Nov 6, 2024

This is the latest 2.4.2 build - https://download.geysermc.org/v2/projects/geyser/versions/2.4.4/builds/705/downloads/spigot That's the one without any of the 1.21.2/3 changes, which introduced server auth movement.

Can confirm that this build has no issues whatsoever. This build will work in the short term but leaves me in kind of a tricky spot as I will need to update eventually. is there any way to disable server auth movement or make it so the movement is more accurate?

@Camotoy
Copy link
Member

Camotoy commented Nov 6, 2024

Even if we had that option - and it would be very difficult, as the code required for client versus server movement is radically different - Bedrock will be removing the client option soon, so we don't have a choice but to move.

However, PRs are most certainly open, as this would be something we're interested in fixing on our end. Here is where our movement code is triggered: https://github.com/GeyserMC/Geyser/blob/master/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/input/BedrockMovePlayer.java
If it's something you would wish to explore, don't hesitate to reach out; you can find us in #dev-general on our Discord server.

@SergioK29
Copy link
Author

SergioK29 commented Nov 7, 2024

More testing of what exactly has changed from a server-side perspective.

Before geyser server auth movement (2.4.2):
https://streamable.com/a55egl

After geyser server auth movement (broken) (latest 881b8e9):
https://streamable.com/uup699

2 immediately noticeable problems,
onGround: true lags behind by a tick whenever the player lands on the ground as compared to previous geyser
onGround is always false when on slabs, when on previous geyser it was correctly set to true

@Kasi07
Copy link

Kasi07 commented Nov 7, 2024

I am not 100% sure but I thing this could also cause this bug: #5127

@SergioK29
Copy link
Author

I am not 100% sure but I thing this could also cause this bug: #5127

I am almost certain that is the cause, fall damage accumulates for as many ticks as onGround=false

@Camotoy
Copy link
Member

Camotoy commented Nov 7, 2024

Please try with the next build once it builds.

@SergioK29
Copy link
Author

Please try with the next build once it builds.

Very awesome, this seems to fix the ground behaviour and also my anti-cheat issues

@SergioK29
Copy link
Author

SergioK29 commented Nov 11, 2024

It seems the physics is still broken for certain versions of bedrock (Version: 1.21.0.26 for example), is there some kind of version check somewhere?

@SergioK29 SergioK29 reopened this Nov 11, 2024
@Camotoy
Copy link
Member

Camotoy commented Nov 11, 2024

Yes: 1b4d257#diff-eced209b21f9d6d71ffc4a3f5ee74fecf92301875c5719b411ac6dba78d7b3a5R92-R94

I don't intend to fix the issue, since the versions will be dropped entirely eventually.

@onebeastchris
Copy link
Member

For now, you could use this extension - https://github.com/onebeastchris/BlockVersion - to block any version older than 1.21.4x from joining :p Most Bedrock platforms automatically update anyways

@SergioK29
Copy link
Author

Yes: 1b4d257#diff-eced209b21f9d6d71ffc4a3f5ee74fecf92301875c5719b411ac6dba78d7b3a5R92-R94

I don't intend to fix the issue, since the versions will be dropped entirely eventually.

How many months is the version supported for?

@Camotoy
Copy link
Member

Camotoy commented Nov 16, 2024

Support will be dropped for everything before 1.21.40 when the winter drop update is official - we don't want to map all those old blocks to older versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants