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

fix: auto detect if the player has permission to query nbt fromserver to prevent sending invalid packets #2

Conversation

zly2006
Copy link

@zly2006 zly2006 commented Jun 20, 2024

Hello there,

Here the client first sends an nbt query packet, if the server responds then the player has permission, so we allow sending more packets.

This auto detecting requires TWEAK_SERVER_ENTITY_DATA_SYNCER to be true (so I set its default value to true), looks a bit weird because the other options are all false by default. Maybe we should either remove this option, or change it to something like TWEAK_DISABLE_SERVER_DATA_SYNC?

I also changed your logger level from warn to debug.

@sakura-ryoko
Copy link
Owner

I also changed your logger level from warn to debug.

Yes, I was in the middle of debugging, but had to go to bed

@sakura-ryoko sakura-ryoko merged commit 19ce5d2 into sakura-ryoko:pre-rewrite/fabric/1.21 Jun 20, 2024
2 checks passed
@sakura-ryoko
Copy link
Owner

sakura-ryoko commented Jun 20, 2024

Also, TWEAK_SERVER_ENTITY_DATA_SYNCER was because when I asked masa, he said to put it behind a setting to stop the sending of the packets if not wanted; like enabling / disabling the feature entirely is the goal.

@zly2006
Copy link
Author

zly2006 commented Jun 20, 2024

Also, TWEAK_SERVER_ENTITY_DATA_SYNCER was because when I asked masa, he said to put it behind a setting to stop the sending of the packets if not wanted; like enabling / disabling the feature entirely is the goal.

Thanks, should it be changed into TWEAK_DISABLE_SERVER_DATA_SYNC so it could be false by default?

Yes, I was in the middle of debugging, but had to go to bed

Sorry for not testing it in vanilla servers. #1 (comment) . I will fix it together with the issue above.

@sakura-ryoko
Copy link
Owner

You can rename the setting, thats fine

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

Successfully merging this pull request may close these issues.

2 participants