valence-rs/valence

Allow NetworkCallbacks::login access to sending/receiving packets

natanalt opened this issue · 3 comments

Describe the problem related to your feature request.

It would be nice if NetworkCallbacks::login implementors could send/receive LoginQueryRequestS2c/LoginQueryResponseC2s packets to allow dealing with clientside mods and whatever else

What solution would you like?

The login callback could receive a reference to PacketIo as a parameter. The struct could also have a convenience function for both sending a query and awaiting a response from the client (according to wiki.vg at least it's always supposed to send one back)

What alternative(s) have you considered?

Outside of modifying/replacing default Valence crates, none

Additional context

-

dyc3 commented

Are there mods that actually do this? Do you have any use case examples? Just curious

wiki.vg's article on Packet Channels lists a few mod examples, but I don't know how up to date they are, or how many of them are supposed to be done during Login state. It's also used by Velocity, and that's where valence_network uses those packets itself. Otherwise I'm actually not really familiar with that

dyc3 commented

We already have support for velocity built in, but I suppose it would be better to make it extendable by users. Let's have this be low priority for now.