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

Send player to a different plot on crash #40

Merged
merged 1 commit into from
May 13, 2021

Conversation

tyler569
Copy link
Contributor

Don't kick them! :D

The behavior I went with here was to send them to 0,0 always (since
that's likely to be spawn) unless it was 0,0 itself that crashed, in
which case they go to 1,0.

This uses the same mechanism as a normal teleport - set the player's
location and send PlayerLeavePlot to the server process.

I do still save the player's data in Plot::drop as it was before, for
the case where something goes wrong with the transfer and they loose
connection anyway.

It seems to work quite consistently in my testing, both unintentional
crashes, and I was testing by adding a "/crash" command that just calls
panic!().

Don't kick them! :D

The behavior I went with here was to send them to 0,0 always (since
that's likely to be spawn) unless it was 0,0 itself that crashed, in
which case they go to 1,0.

This uses the same mechanism as a normal teleport - set the player's
location and send PlayerLeavePlot to the server process.

I do still save the player's data in Plot::drop as it was before, for
the case where something goes wrong with the transfer and they loose
connection anyway.

It seems to work quite consistently in my testing, both unintentional
crashes, and I was testing by adding a "/crash" command that just calls
panic!().
@StackDoubleFlow StackDoubleFlow merged commit 05b079c into MCHPR:master May 13, 2021
tyler569 added a commit to tyler569/MCHPRS that referenced this pull request May 20, 2021
@tyler569 tyler569 mentioned this pull request May 20, 2021
StackDoubleFlow pushed a commit that referenced this pull request Jun 4, 2021
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