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

Remove resending blocks for obstructedPos #807

Closed
wants to merge 18 commits into from

Conversation

Flonja
Copy link
Contributor

@Flonja Flonja commented Aug 4, 2023

It's kinda a hack I know, but go no other clue.

This is meant to remove block lag for high ping players.

@Flonja
Copy link
Contributor Author

Flonja commented Aug 20, 2023

bump

server/player/player.go Outdated Show resolved Hide resolved
@Flonja
Copy link
Contributor Author

Flonja commented Apr 9, 2024

bump

@didntpot
Copy link
Contributor

merge plz

// The function returns true if there is an entity in the way that could prevent the block from being placed.
func (p *Player) obstructedPos(pos cube.Pos, b world.Block) bool {
// The first bool indicates if there is an entity in the way that could prevent the block from being placed.
// The second bool is used to check if the block should be updated.
Copy link
Member

Choose a reason for hiding this comment

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

Could you expand this documentation to explain why it should not be updated?

Comment on lines +1772 to +1774
if e == p {
resend = false
}
Copy link
Member

Choose a reason for hiding this comment

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

This section isn't entirely clear to me. If any of the entities in this 7x7x7 bounding box is the player itself, it will not resend. This doesn't quite sound right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If there is enough latency the client position might be in the block that the client wants to be placed.
You can easily try this out by having >=150ms and stacking blocks under you

Copy link
Member

Choose a reason for hiding this comment

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

If anything I would first move this block inside of the if cube.AnyIntersections {} block, because the player might not even be intersecting in the first place. But then I'm still not sure if it would work as expected. Imagine there was another player that this intersected with, in addition to the player itself, should it be resent or not?

@Sandertv Sandertv added the improvement Improvement of an existing part of the codebase label Jan 5, 2025
@Sandertv Sandertv added this to the v0.10.0 milestone Jan 5, 2025
@Sandertv Sandertv closed this in 8004a6f Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Improvement of an existing part of the codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants