Files
mc/server/session/handler.go
T

14 lines
530 B
Go
Raw Permalink Normal View History

2026-07-09 08:33:57 +08:00
package session
import (
"github.com/df-mc/dragonfly/server/world"
"github.com/sandertv/gophertunnel/minecraft/protocol/packet"
)
// packetHandler represents a type that is able to handle a specific type of incoming packets from the client.
type packetHandler interface {
// Handle handles an incoming packet from the client. The session of the client is passed to the packetHandler.
// Handle returns an error if the packet was in any way invalid.
Handle(p packet.Packet, s *Session, tx *world.Tx, c Controllable) error
}