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

Proper respawn packets on dimension travel #3351

Merged
merged 1 commit into from Aug 29, 2016

Conversation

Projects
None yet
2 participants
@SafwatHalaby
Member

SafwatHalaby commented Aug 27, 2016

Closes #2547
Closes #2405
Closes #3352
Replaces #3350
Replaces #3114
Completes the "Stable world travel" milestone :)

Minecraft clients do not like respawning to the same dimension, unless the player dies. This PR takes this into account when teleporting between dimensions. If one is teleporting from a world of dimension A to a world of dimension A, a dummy respawn packet of some dimension B is sent first, and the real respawn packet of dimension A is sent afterwards.

Also, the cEntity teleportation code used to falsely assume that a linked world's dimension always has correspondance to the portal type and the current world. For instance, it assumed that when stepping into a Nether portal from the Overworld, one always ends up in a Nether. This caused the wrong respawn packets to be sent. The PR fixes this as well.

@SafwatHalaby

This comment has been minimized.

Show comment
Hide comment
@SafwatHalaby

SafwatHalaby Aug 28, 2016

Member

This has been tested ingame with all possible teleport permutations (nether>nether, nether>overworld, etc.), I teleported both via nether portals and the Essentials /portal command (total: 9 * 2 tests). All packets were sent as expected, (end portals weren't tested).

Member

SafwatHalaby commented Aug 28, 2016

This has been tested ingame with all possible teleport permutations (nether>nether, nether>overworld, etc.), I teleported both via nether portals and the Essentials /portal command (total: 9 * 2 tests). All packets were sent as expected, (end portals weren't tested).

Show outdated Hide outdated src/ClientHandle.cpp
@madmaxoft

This comment has been minimized.

Show comment
Hide comment
@madmaxoft

madmaxoft Aug 29, 2016

Member

I'm considering whether the check for the same dimension should be implemented in cClientHandle, as you've done it, or in cProtocol descendants. After all, it is a thing of the protocol; if the client ever fixes the "bug" with travelling to the same dimension, we will no longer need the check for that version of the protocol. On the other hand, it means copying the code over to each new cProtocol.

Member

madmaxoft commented Aug 29, 2016

I'm considering whether the check for the same dimension should be implemented in cClientHandle, as you've done it, or in cProtocol descendants. After all, it is a thing of the protocol; if the client ever fixes the "bug" with travelling to the same dimension, we will no longer need the check for that version of the protocol. On the other hand, it means copying the code over to each new cProtocol.

@SafwatHalaby

This comment has been minimized.

Show comment
Hide comment
@SafwatHalaby

SafwatHalaby Aug 29, 2016

Member

As of now, all protocol versions have this bug. We can trivially move this to cProtocol and duplicate it if ever needed.

Member

SafwatHalaby commented Aug 29, 2016

As of now, all protocol versions have this bug. We can trivially move this to cProtocol and duplicate it if ever needed.

@madmaxoft madmaxoft merged commit c6c2c5a into cuberite:master Aug 29, 2016

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@SafwatHalaby SafwatHalaby deleted the SafwatHalaby:spawnPackets branch Aug 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment