server

package
v0.0.0-...-54241fc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: AGPL-3.0 Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "1.20.1"

Variables

View Source
var OldState *term.State

Functions

func WritePlayerList

func WritePlayerList(path string, user []user) error

Types

type Server

type Server struct {
	Config *config.Config
	Logger *logger.Logger

	Lang *lang.Lang

	PlaceholderContext *placeholder.PlaceholderContext

	WhitelistedPlayers,
	Operators,
	BannedPlayers,
	BannedIPs []user

	Players  *controller.Controller[uuid.UUID, *player.Player]
	Entities *controller.Controller[int32, entity.Entity]

	World *world.World
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config, address string, logger *logger.Logger, commandGraph *commands.Graph) (*Server, error)

func (*Server) AddToWhitelist

func (srv *Server) AddToWhitelist(name, uuid string)

func (*Server) Ban

func (srv *Server) Ban(name, uuid string, reason string)

func (*Server) Close

func (srv *Server) Close()

func (*Server) ConsoleCommand

func (srv *Server) ConsoleCommand(txt string)

func (*Server) FindEntity

func (srv *Server) FindEntity(id int32) interface{}

func (*Server) FindEntityByUUID

func (srv *Server) FindEntityByUUID(id [16]byte) interface{}

func (*Server) FindPlayer

func (srv *Server) FindPlayer(username string) *player.Player

func (*Server) FindPlayerByID

func (srv *Server) FindPlayerByID(id int32) *player.Player

func (*Server) GetCommandGraph

func (srv *Server) GetCommandGraph() *commands.Graph

func (*Server) GlobalMessage

func (srv *Server) GlobalMessage(message chat.Message)

func (*Server) IsIPBanned

func (srv *Server) IsIPBanned(ip string) bool

func (*Server) IsOperator

func (srv *Server) IsOperator(uuid [16]byte) bool

func (*Server) IsPlayerBanned

func (srv *Server) IsPlayerBanned(u [16]byte) bool

func (*Server) IsWhitelisted

func (srv *Server) IsWhitelisted(u [16]byte) bool

func (*Server) MakeNotOperator

func (srv *Server) MakeNotOperator(p *player.Player)

func (*Server) MakeOperator

func (srv *Server) MakeOperator(p *player.Player)

func (*Server) NewID

func (srv *Server) NewID() int32

func (*Server) OperatorMessage

func (srv *Server) OperatorMessage(message chat.Message)

func (*Server) Reload

func (srv *Server) Reload() error

func (*Server) RemoveFromWhitelist

func (srv *Server) RemoveFromWhitelist(uuid string)

func (*Server) SetBlock

func (srv *Server) SetBlock(d *world.Dimension, x, y, z int64, b chunk.Block, typ world.SetBlockHandling)

func (*Server) SetEntityPosition

func (srv *Server) SetEntityPosition(id int32, x, y, z float64)

func (*Server) SpawnEntity

func (srv *Server) SpawnEntity(typ string, x, y, z float64)

func (*Server) Start

func (srv *Server) Start() error

func (*Server) TeleportEntity

func (srv *Server) TeleportEntity(id int32, x, y, z float64)

func (*Server) Unban

func (srv *Server) Unban(name string)

func (*Server) ValidateConn

func (srv *Server) ValidateConn(conn *minecraft.Conn) bool

ValidateConn checks if the connection is allowed to join the Server, if not the connection is kicked with the appropriate message. returns true if the connection was disconnected, false otherwise.

Jump to

Keyboard shortcuts

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