player

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Handles = map[uint32]func(player *Player, pk packet.Packet){
	packet.IDRequestChunkRadius: func(player *Player, pk packet.Packet) {
		player.chunkradius = pk.(*packet.RequestChunkRadius).ChunkRadius
	},
}

Handles contains handlers for certain packets.

Functions

func New

New initializes a interfaces.InternalPlayer for the provided minecraft.Player.

Types

type Player

type Player struct {
	minecraft.Player
	// contains filtered or unexported fields
}

...

func (*Player) ChunkRadius

func (player *Player) ChunkRadius() int32

ChunkRadius returns the current chunk radius for the player.

func (*Player) Config

func (player *Player) Config() *config.Player

Config returns the configuration for the player.

func (*Player) Dialer

func (player *Player) Dialer() interfaces.Dialer

Dialer returns the interfaces.Dialer the player is currently connected to.

func (*Player) Kick

func (player *Player) Kick(reason ...string)

Kick kicks the player from the server using the provided message.

func (*Player) KickOrFallback

func (player *Player) KickOrFallback(msg string)

KickOrFallback attempts to connect the player to the fallback server (If enabled), if it is unable to connect it kicks the player using the provided message.

func (*Player) Message

func (player *Player) Message(msg string) error

Message sends a chat message to the player.

func (*Player) Send

func (player *Player) Send(ip string, port int) error

Send connects the player to the provided server.

func (*Player) SetConfig

func (player *Player) SetConfig(config *config.Player)

SetConfig sets the configuration for the player.

func (*Player) SetDialer

func (player *Player) SetDialer(dialer interfaces.Dialer)

SetDialer sets the interfaces.Dialer for the player.

func (*Player) SetState

func (player *Player) SetState(state interfaces.State)

SetState updates the interfaces.State of the player.

func (*Player) State

func (player *Player) State() interfaces.State

State returns the current interfaces.State of the player.

Jump to

Keyboard shortcuts

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