node-minecraft-protocol icon indicating copy to clipboard operation
node-minecraft-protocol copied to clipboard

Client not following the correct sequence

Open Robbilie opened this issue 4 years ago • 6 comments

[ x] The FAQ doesn't contain a resolution to my issue

Versions

  • minecraft-protocol: ^1.29.1
  • server: vanilla 1.18.1
  • node: v16.8.0

Detailed description of a problem

https://wiki.vg/Protocol_FAQ#What.27s_the_normal_login_sequence_for_a_client.3F

I am trying to debug an issue where when i connect to a proxied server i always initially spawn inside the floor, just to be "teleported" to the correct position microseconds afterwards.

In the flow of packets the client sends the settings -> custom_payload -> held_item_slot -> position_look commands. While the custom_payload and the settings are expected (although in different order) the other two are kind of unexpected and the position_look command seems to show the issue with the spawning inside the floor:

{ size: 34, name: 'position_look', state: 'play' } { x: 8.5, y: 65, z: 8.5, yaw: -180, pitch: 0, onGround: false }

It is always the same position it seems, at least around that area. The world spawn is nowhere near that position. I dont really understand why the client is apparently sending its position to the server without even having chunk data at hand.

Although this kind of seems like a client issue, maybe this is triggered by some issue with the packets in the sequence before? Or some missconfiguration on my end?

Robbilie avatar Jan 05 '22 03:01 Robbilie

Connecting to the proxied server (online-mode: false) doesnt show the issue, the client seems to immediately spawn in the correct position. Maybe its just not noticable though…

Robbilie avatar Jan 05 '22 03:01 Robbilie

https://www.cubecraft.net/threads/rejoin-command.295241/post-1377615

Someone apparently also noticed the "fallback"

Robbilie avatar Jan 05 '22 12:01 Robbilie

It seems holding back even the first clientbound position packet until after the world border was initialized helps

Robbilie avatar Jan 05 '22 12:01 Robbilie

okay now i found the second case where the events emitted are most certainly not in the correct order. is there a way to emit them in the actual received order, synchronize them somehow?

Robbilie avatar Jan 09 '22 19:01 Robbilie

I don't understand what you are saying

nmp is definitely sending packets in order and tcp is delevering them in order

rom1504 avatar Mar 13 '22 17:03 rom1504

I think the event emitter was emitting out if order, or at least it seemed to be that way. I don't quite remember if I am still facing this issue or wether i solved it somehow

Robbilie avatar Mar 13 '22 21:03 Robbilie