interfaces

package
v0.0.0-...-c047542 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateWaitingForFirstServer = State(iota)
	StateWaitingForNewServer
	StateConnected
	StateDisconnected
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialer

type Dialer interface {
	minecraft.Dialer
	EntityId() int64
	UniqueId() int64
	Player() InternalPlayer
	SetLeaving(bool)
}

Dialer is a connection to a remote server.

type InternalPlayer

type InternalPlayer interface {
	minecraft.Player
	Send(ip string, port int) error
	Config() *config.Player
	SetConfig(config *config.Player)
	Dialer() Dialer
	SetDialer(dialer Dialer)
	State() State
	SetState(state State)
	Kick(...string)
	Message(string) error
	KickOrFallback(string)
	ChunkRadius() int32
}

InternalPlayer represents the internal version of a player connected to the proxy.

type Player

type Player interface {
	// Identity returns the IdentityData of the player.
	Identity() login.IdentityData

	// Client returns the Client of the player
	Client() login.ClientData

	// Send transfers the player to a server.
	Send(ip string, port int) error

	// Message sends a chat message to a player.
	Message(message string) error

	// Kick kicks a player from the proxy, if no reason is provided a default reason is used.
	Kick(reason ...string)

	// WritePacket writes a packet directly to the player.
	WritePacket(packet packet.Packet) error

	// State returns the state of the player.
	State() State
}

Player is a player connected to the proxy.

type State

type State int

State represents the state of a player.

type VastleX

type VastleX interface {
	Motd() string
	SetMotd(string)
	Players() *sync.Map
	GetPlayer(string) (Player, bool)
	Count() int
}

VastleX is as the name implies, the VastleX instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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