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

Digging snow doesn't produce snowballs #852

Closed
KiuIras opened this issue Feb 17, 2018 · 5 comments
Closed

Digging snow doesn't produce snowballs #852

KiuIras opened this issue Feb 17, 2018 · 5 comments

Comments

@KiuIras
Copy link
Contributor

@KiuIras KiuIras commented Feb 17, 2018

Digging snow with a stone (or better) shovel doesn't produce snowballs as expected. It only works with a wooden showel.

When I use a shovel of stone or better, it needs only "one ticks" to break the snow. The only message received from the "handle" method in DiggingHandler class says:
DiggingMessage(state=0, x=-114, y=70, z=94, face=1)

where state=0 stays for "START_DIGGING".
When I use the wooden shovel it takes two ticks and I get both state 0 and state 2 (FINISH_DIGGING) message.

I suppose that messages are sent by clients to the server, maybe the problem is with the managment of message queue?

@KiuIras
Copy link
Contributor Author

@KiuIras KiuIras commented Feb 18, 2018

I think that digging needs more investigation.
The problem isn't limited to snow digging but affects all the digging actions that is "instantaneous"
(e.g. digging sand or dirt with a efficiency V diamond shovel).
We trust client message "FINISH_DIGGING" but it seems to be unreliable (wiki says that client sends the finish message when it thinks digging is finished).
Maybe we should move the responsibility to the server to avoid errors (and malicious clients).

A side note: when client breaks item and Glowstone doesn't see it a inconsistency is created (player chokes if walks where blocks are destroyed by clients but aren't by server)

Edit: I don't know if name of this issue should change to describe a more generic problem, feel free to change it!

@aramperes
Copy link
Member

@aramperes aramperes commented Feb 18, 2018

So from what I understand, the client never sends a FINISH_DIGGING state for instantaneous block digging?

@KiuIras
Copy link
Contributor Author

@KiuIras KiuIras commented Feb 18, 2018

Exactly.

@Pr0methean
Copy link
Contributor

@Pr0methean Pr0methean commented Feb 24, 2018

What's the purpose of the FINISH_DIGGING message, given that we can calculate on the server side when digging finishes? Given that our plan for this bug amounts to just ignoring it, it'd be good to know.

@KiuIras
Copy link
Contributor Author

@KiuIras KiuIras commented Feb 27, 2018

I can suppose that is useful for let us know the state of the client and restore it in case of inconsistency.
(client sends a FINISH_DIGGING but the block is not really broken -> restore the block on the client)

@Pr0methean Pr0methean assigned Pr0methean and unassigned Pr0methean Mar 3, 2018
@Pr0methean Pr0methean self-assigned this Apr 29, 2018
Pr0methean added a commit to Pr0methean/Glowstone that referenced this issue Apr 30, 2018
Block breaking now finishes when the correct number of ticks have elapsed, not when we receive a FINISH_DIGGING message. The response to a premature FINISH_DIGGING is now to re-send the affected block.
@ghost ghost added Status: in progress and removed help wanted labels Apr 30, 2018
@ghost ghost removed the Status: in progress label May 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.