server

package
v1.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2021 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

View Source
const ProtocolVersion = 756

Variables

This section is empty.

Functions

This section is empty.

Types

type GamePlay

type GamePlay interface {
	AcceptPlayer(name string, id uuid.UUID, protocol int32, conn *net.Conn)
}

type ListPingHandler

type ListPingHandler interface {
	Name() string
	Protocol() int
	MaxPlayer() int
	OnlinePlayer() int
	PlayerSamples() []PlayerSample
	Description() chat.Message
}

type LoginHandler

type LoginHandler interface {
	AcceptLogin(conn *net.Conn, protocol int32) (name string, id uuid.UUID, err error)
}

type MojangLoginHandler

type MojangLoginHandler struct {
	OnlineMode bool
	Threshold  int
}

func (*MojangLoginHandler) AcceptLogin

func (d *MojangLoginHandler) AcceptLogin(conn *net.Conn, protocol int32) (name string, id uuid.UUID, err error)

type PlayerSample

type PlayerSample struct {
	Name string    `json:"name"`
	ID   uuid.UUID `json:"id"`
}

type Server

type Server struct {
	ListPingHandler
	LoginHandler
	GamePlay
}

func (*Server) Listen

func (s *Server) Listen(addr string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL