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

Race condition: unintentional successive World Drops can occur #4

Open
Nerodon opened this issue Jun 9, 2018 · 3 comments
Open

Race condition: unintentional successive World Drops can occur #4

Nerodon opened this issue Jun 9, 2018 · 3 comments

Comments

@Nerodon
Copy link
Contributor

Nerodon commented Jun 9, 2018

Assume a drop like this:

DIM 0 --> DIM 10 --> DIM 100
Imagine overworld --> the beneath --> the deep dark
you keep digging lower and reach another dim...

If the Y requirement for a drop is the same or within the boundaries of the next drop in the sequence... you will double drop DIM 0 --> DIM 100

I believe there is a race condition where Y of the player has still yet to be updated after the dimension teleport of the first drop... causing successive drops to occur...
Likely when two successful drop checks are true before the player position is updated but the dimension ID in fact already did. IE, a few ticks after the dimension change. Not exactly sure how that is handled by minecraft.

The issue is that there is no buffer after a teleport, and there is a risk of multiple successive dimension change. There should be some safety timer to make sure the player has finished moving to the new DIM before checking new drop/climb checks.

I've been able to use a workaround for now. I set the successive drops to not successively be true for the target DIM's Y pos.

Example:

/wdrop set 0 10 8 240 false
/wdrop set 10 100 5 240 false

When I drop from 0 to 10 at Y=8, the race condition will not TP me to DIM100 as I am still above 5 for that next drop. There is some jitter, where falling or moving as spectator/flying may cause the Y to dip below the drop before DIM TP occurs, where the issue is still there.

@Nerodon
Copy link
Contributor Author

Nerodon commented Jun 9, 2018

Also, you sometimes get several flickers after teleporting, likely to repeated teleporting within the same dimension after the drop.

This may be due to the same race condition, a buffer time should help mitigate this too!

@Domochevsky
Copy link
Owner

Hm... yeah, a delay until another drop is attempted. per player, seems like a sensible thing to do. Not particularly difficult to implement either.

The question is... who's gonna implement it? I'm not working on this mod anymore. (That's why I made it open source.) Do you want to do it and then merge it in? >_>

@Nerodon
Copy link
Contributor Author

Nerodon commented Jun 9, 2018

Yeah, My buddy and I are looking at the code now, I really like this mod and it will do it some good.
Also the repeated teleport causes players to suffer tons of damage for some reason when landing into the new dimension. I think a little delay will fix most of these issues.

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

2 participants