bungeecord

package
v0.26.9 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Channel

func Channel(protocol proto.Protocol) string

Channel returns the BungeeCord plugin channel identifier for the given protocol.

Types

type MessageResponder

type MessageResponder interface {
	// Process processes the given plugin message.
	// Returns true if the message is a BungeeCord plugin message and was processed.
	Process(message *plugin.Message) bool
}

MessageResponder is a message responder for BungeeCord plugin channels.

var NopMessageResponder MessageResponder = &nopMessageResponder{}

NopMessageResponder is a MessageResponder that does not process messages.

func NewMessageResponder

func NewMessageResponder(
	player Player,
	providers Providers,
) MessageResponder

NewMessageResponder returns a new MessageResponder.

type Player

type Player interface {
	ID() uuid.UUID
	Username() string
	RemoteAddr() net.Addr
	Disconnect(reason component.Component)
}

Dependencies required by NewMessageResponder.

type PlayerProvider

type PlayerProvider interface {
	PlayerByName(username string) Player
	PlayerCount() int // Total number of players online
	Players() []Player
	BroadcastMessage(component.Component)
}

PlayerProvider provides a player by its name.

type Providers

Dependencies required by NewMessageResponder.

type Server

type Server interface {
	Name() string
	PlayerCount() int
	BroadcastPluginMessage(message.ChannelIdentifier, []byte)
	Connect(Player)
	Players() []Player
	BroadcastMessage(component.Component)
	Addr() net.Addr
}

Dependencies required by NewMessageResponder.

type ServerConnection

type ServerConnection interface {
	Name() string // Name of the server.
	Protocol() proto.Protocol
	proto.PacketWriter
}

ServerConnection represents a server connection for a player.

type ServerConnectionProvider

type ServerConnectionProvider interface {
	ConnectedServer() ServerConnection
}

ServerConnectionProvider provides the currently connected server connection for a player.

type ServerProvider

type ServerProvider interface {
	Server(name string) Server
	Servers() []Server
}

ServerProvider provides servers.

Jump to

Keyboard shortcuts

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