From fb69fd93ec825c4b235839189c3b4426681e6486 Mon Sep 17 00:00:00 2001 From: Admin Else <74665496+admin-else@users.noreply.github.com> Date: Fri, 3 Apr 2026 19:01:33 +0200 Subject: [PATCH] my code broke after i changed this last time and this fixed it --- proto/connection.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proto/connection.go b/proto/connection.go index 6e6a92f..ee00ffb 100644 --- a/proto/connection.go +++ b/proto/connection.go @@ -119,6 +119,8 @@ func (c *Conn) SetProtocolVersion(version int32) (err error) { // ActivateReceiveRoutine activates the receive-routine. // It ensures that the receive-routine is only started once and creates a buffered channel for packet handling. func (c *Conn) ActivateReceiveRoutine() (chSending <-chan any) { + // This expects you to start a new routine when switching into play state + spamLoginTick := c.State() != proto_base.Play ch := make(chan any, BufferNPackets) go func() { ctx := c.Ctx // this prevents c.Ctx being reassigned @@ -127,7 +129,7 @@ func (c *Conn) ActivateReceiveRoutine() (chSending <-chan any) { case <-ctx.Done(): return default: - if c.State() != proto_base.Play { + if spamLoginTick { ch <- LoginTick{} } else { packet, err := c.Receive()