gate icon indicating copy to clipboard operation
gate copied to clipboard

add player position and look packet

Open paralin opened this issue 3 years ago • 7 comments

The final packet sent when connecting:

see https://wiki.vg/Protocol#Player_Position_And_Look_.28clientbound.29

paralin avatar Oct 09 '21 09:10 paralin

Thanks for your contribution!

Could you explain why Gate needs to know about this packet and why it is useful for the proxy?

robinbraemer avatar Oct 09 '21 11:10 robinbraemer

It's the final packet in the join sequence. You can use this to create a "lightweight server" by sending the "set player position" packet just after the auth sequence. See this branch: https://github.com/paralin/minekube-gate/tree/paralin

paralin avatar Oct 09 '21 12:10 paralin

It looks great but maybe it makes the maintenance harder. Could this be a module that you can decide to use or not?

nuriofernandez avatar Jan 24 '22 19:01 nuriofernandez

I have not tested this and from what I understand you mean that if Gate would send this packet after auth then the player would have a shorter loading screen and see the world more quickly.

Should Gate send this packet only once or every time the player joins/switches the backend server? Does it not matter which coordinates we send in this packet since it gets sent by the backend server anyways?

I agree @xXNurioXx, this could be a feature that users can enable or disable in the config. If we add this packet, we also need to support the packet IDs starting from Minecraft 1.7 in the state package.

robinbraemer avatar Feb 03 '22 12:02 robinbraemer

I have not tested this and from what I understand you mean that if Gate would send this packet after auth then the player would have a shorter loading screen and see the world more quickly.

Should Gate send this packet only once or every time the player joins/switches the backend server? Does it not matter which coordinates we send in this packet since it gets sent by the backend server anyways?

I agree @xXNurioXx, this could be a feature that users can enable or disable in the config. If we add this packet, we also need to support the packet IDs starting from Minecraft 1.7 in the state package.

I agree with him, this would be great for high cracked network servers like most brazillian servers, because we could make some agree of requirement, authorization, checking or whatever we could do in a light-weight server. This specific case would be just pulled out only once in player joins.

luiz-otavio avatar Feb 03 '22 18:02 luiz-otavio

Should Gate send this packet only once or every time the player joins/switches the backend server?

It can be used to dismiss the loading screen, so possibly sending it when switching backend servers could be helpful, especially if you wanted to add a custom loading screen.

Does it not matter which coordinates we send in this packet since it gets sent by the backend server anyways?

Correct, there doesnt' seem to be any validation on the client end.

The main purpose of adding this packet is to make a 'lightweight server' where you have no backend server at all.

This is of course useful to make custom loading state views, while determining which backend server to connect to.

paralin avatar Feb 03 '22 19:02 paralin

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 04d5cd8
Status: ✅  Deploy successful!
Preview URL: https://bac13e5c.gate-minekube.pages.dev

View logs