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

fixed ServerSpoof #4599

Merged
merged 3 commits into from
May 24, 2024
Merged

Conversation

19MisterX98
Copy link
Contributor

Type of change

  • Bug fix
  • New feature

Description

In 1.20.5 the c2s custom payload packet that contains the brand changed to a record.
Changing the internals is no longer possible because of that.
My previous fix changed the behavior of PacketEvent.Send and accidentally broke criticals
This new fix cancels the packet and while sending a new modified one.
The modified packet doesn't trigger PacketEvent.Send which would cause an infinite loop.

Related issues

#4597

How Has This Been Tested?

Joining singleplayer doesn't break and the brand is changed in multiplayer environments.
Confirmed by joining eu.loyisa.cn which prints the client brand on join.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

@Wide-Cat Wide-Cat assigned Wide-Cat and unassigned Wide-Cat May 24, 2024
Copy link
Collaborator

@Wide-Cat Wide-Cat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of grabbing the ClientConnection from the connection screen, it would probably be better to post it with the event, as happens with PacketEvent.Recieve.


} else if (MeteorClient.EVENT_BUS.post(PacketEvent.Receive.get(packet, (ClientConnection) (Object) this)).isCancelled()) ci.cancel();

@Wide-Cat Wide-Cat merged commit 2b68dd4 into MeteorDevelopment:master May 24, 2024
1 check passed
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