Versions in this module Expand all Collapse all v1 v1.0.0 Aug 31, 2023 Changes in this version + var DefaultProtocol = proto + func RegisterNetwork(id string, n Network) + type Conn struct + func Dial(network, address string) (*Conn, error) + func DialContext(ctx context.Context, network, address string) (*Conn, error) + func DialTimeout(network, address string, timeout time.Duration) (*Conn, error) + func (conn *Conn) Authenticated() bool + func (conn *Conn) ChunkRadius() int + func (conn *Conn) ClientCacheEnabled() bool + func (conn *Conn) ClientData() login.ClientData + func (conn *Conn) Close() error + func (conn *Conn) DoSpawn() error + func (conn *Conn) DoSpawnContext(ctx context.Context) error + func (conn *Conn) DoSpawnTimeout(timeout time.Duration) error + func (conn *Conn) Flush() error + func (conn *Conn) GameData() GameData + func (conn *Conn) IdentityData() login.IdentityData + func (conn *Conn) Latency() time.Duration + func (conn *Conn) LocalAddr() net.Addr + func (conn *Conn) Read(b []byte) (n int, err error) + func (conn *Conn) ReadPacket() (pk packet.Packet, err error) + func (conn *Conn) RemoteAddr() net.Addr + func (conn *Conn) ResourcePacks() []*resource.Pack + func (conn *Conn) SetDeadline(t time.Time) error + func (conn *Conn) SetReadDeadline(t time.Time) error + func (conn *Conn) SetWriteDeadline(time.Time) error + func (conn *Conn) StartGame(data GameData) error + func (conn *Conn) StartGameContext(ctx context.Context, data GameData) error + func (conn *Conn) StartGameTimeout(data GameData, timeout time.Duration) error + func (conn *Conn) Write(b []byte) (n int, err error) + func (conn *Conn) WritePacket(pk packet.Packet) error + type Dialer struct + ClientData login.ClientData + DisconnectOnInvalidPackets bool + DisconnectOnUnknownPackets bool + DownloadResourcePack func(id uuid.UUID, version string, current, total int) bool + EnableClientCache bool + ErrorLog *log.Logger + FlushRate time.Duration + IdentityData login.IdentityData + KeepXBLIdentityData bool + PacketFunc func(header packet.Header, payload []byte, src, dst net.Addr) + Protocol Protocol + TokenSource oauth2.TokenSource + func (d Dialer) Dial(network, address string) (*Conn, error) + func (d Dialer) DialContext(ctx context.Context, network, address string) (conn *Conn, err error) + func (d Dialer) DialTimeout(network, address string, timeout time.Duration) (*Conn, error) + type DisconnectError string + func (d DisconnectError) Error() string + type ForeignStatusProvider struct + func NewForeignStatusProvider(addr string) (*ForeignStatusProvider, error) + func (f *ForeignStatusProvider) Close() error + func (f *ForeignStatusProvider) ServerStatus(int, int) ServerStatus + type GameData struct + BaseGameVersion string + ChatRestrictionLevel uint8 + ChunkRadius int32 + ClientSideGeneration bool + CreatedInEditor bool + CustomBlocks []protocol.BlockEntry + CustomSkinsDisabled bool + Difficulty int32 + Dimension int32 + DisablePlayerInteractions bool + EditorWorld bool + EntityRuntimeID uint64 + EntityUniqueID int64 + Experiments []protocol.ExperimentData + ExportedFromEditor bool + GameRules []protocol.GameRule + Items []protocol.ItemEntry + PersonaDisabled bool + Pitch float32 + PlayerGameMode int32 + PlayerMovementSettings protocol.PlayerMovementSettings + PlayerPermissions int32 + PlayerPosition mgl32.Vec3 + ServerAuthoritativeInventory bool + ServerBlockStateChecksum uint64 + Time int64 + UseBlockNetworkIDHashes bool + WorldGameMode int32 + WorldName string + WorldSeed int64 + WorldSpawn protocol.BlockPos + Yaw float32 + type ListenConfig struct + AcceptedProtocols []Protocol + AllowInvalidPackets bool + AllowUnknownPackets bool + AuthenticationDisabled bool + Biomes map[string]any + Compression packet.Compression + ErrorLog *log.Logger + FlushRate time.Duration + MaximumPlayers int + PacketFunc func(header packet.Header, payload []byte, src, dst net.Addr) + ResourcePacks []*resource.Pack + StatusProvider ServerStatusProvider + TexturePacksRequired bool + func (cfg ListenConfig) Listen(network string, address string) (*Listener, error) + type Listener struct + func Listen(network, address string) (*Listener, error) + func (listener *Listener) Accept() (net.Conn, error) + func (listener *Listener) Addr() net.Addr + func (listener *Listener) Close() error + func (listener *Listener) Disconnect(conn *Conn, message string) error + type ListenerStatusProvider struct + func NewStatusProvider(serverName string) ListenerStatusProvider + func (l ListenerStatusProvider) ServerStatus(playerCount, maxPlayers int) ServerStatus + type Network interface + DialContext func(ctx context.Context, address string) (net.Conn, error) + Listen func(address string) (NetworkListener, error) + PingContext func(ctx context.Context, address string) (response []byte, err error) + type NetworkListener interface + ID func() int64 + PongData func(data []byte) + type Protocol interface + ConvertFromLatest func(pk packet.Packet, conn *Conn) []packet.Packet + ConvertToLatest func(pk packet.Packet, conn *Conn) []packet.Packet + ID func() int32 + NewReader func(r reader, shieldID int32, enableLimits bool) protocol.IO + NewWriter func(w writer, shieldID int32) protocol.IO + Packets func(listener bool) packet.Pool + Ver func() string + type RakNet struct + func (r RakNet) DialContext(ctx context.Context, address string) (net.Conn, error) + func (r RakNet) Listen(address string) (NetworkListener, error) + func (r RakNet) PingContext(ctx context.Context, address string) (response []byte, err error) + type ServerStatus struct + MaxPlayers int + PlayerCount int + ServerName string + type ServerStatusProvider interface + ServerStatus func(playerCount, maxPlayers int) ServerStatus