minekube / gate

High-Performance, Low-Memory, Lightweight, Extensible Minecraft Reverse Proxy with Excellent Multi-Protocol Version Support - Velocity/Bungee Replacement - Ready for dev and large deploy!
https://gate.minekube.com
Apache License 2.0
629 stars 54 forks source link

Context does not cancel when player disconnects during PreLoginEvent #358

Closed winecraft-dev closed 3 months ago

winecraft-dev commented 3 months ago

I'm writing a program that does some waiting during the PreLoginEvent. To narrow down what happens to the Context, I am using this code:

func (p *MyProxy) HandlePreLogin(e *proxy.PreLoginEvent) {
    fmt.Println("Beginning wait...")
    <-e.Conn().Context().Done()
    fmt.Println("Wait is over!")
}

When I run this handler and start my connection I get this printed out:

Beginning wait

And even if the user disconnects, this context is not cancelled so only the first line is printed. On the latest version of Gate v0.38.0.

robinbraemer commented 3 months ago

Is it still relevant, or was it resolved in Discord?