MCProtocolLib icon indicating copy to clipboard operation
MCProtocolLib copied to clipboard

Auto state switch questions

Open NekoEpisode opened this issue 8 months ago • 4 comments

(My English is not good, so if you can't understand me, im sorry. I use bing translator and AI)

MCProtocolLib automatically transitions clients to the PLAY state after login. For a BungeeCord-like proxy, how can I intercept this automatic state transition after login completion to manually bridge the connection to a backend server?

NekoEpisode avatar Jun 07 '25 11:06 NekoEpisode

I don't know about the server but I'm 99.9999999999999999% sure it's the same thing as the client (bot). The bot would have a SessionAdapter and so should the server override packetSending and cancel the packets.

BytelyPlay avatar Jun 08 '25 14:06 BytelyPlay

Will this cause packets that are normally forwarded to be intercepted?

NekoEpisode avatar Jun 08 '25 15:06 NekoEpisode

If by normally forwarded you mean manually forwarded then you'll have to track that like mark all packets you manually sent and allow those and cancel the rest.

BytelyPlay avatar Jun 08 '25 19:06 BytelyPlay

So i need a queue or list to solve this?

NekoEpisode avatar Jun 09 '25 14:06 NekoEpisode