actions

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

View Source
const (
	IDInit = int16(iota)
	IDInfo
	IDLog
	IDSetDebug
	IDSetMotd
	IDEvent
	IDSend
	IDWritePacket
	IDKick
)

Variables

View Source
var Pool = map[int16]func() Action{
	IDInit:        func() Action { return &Init{InitAction: &protobuf.InitAction{}} },
	IDInfo:        func() Action { return &Info{InfoAction: &protobuf.InfoAction{}} },
	IDLog:         func() Action { return &Log{LogAction: &protobuf.LogAction{}} },
	IDSetDebug:    func() Action { return &SetDebug{SetDebugAction: &protobuf.SetDebugAction{}} },
	IDSetMotd:     func() Action { return &SetMotd{SetMotdAction: &protobuf.SetMotdAction{}} },
	IDEvent:       func() Action { return &Event{EventAction: &protobuf.EventAction{}} },
	IDSend:        func() Action { return &Send{SendAction: &protobuf.SendAction{}} },
	IDWritePacket: func() Action { return &WritePacket{WritePacketAction: &protobuf.WritePacketAction{}} },
	IDKick:        func() Action { return &Kick{KickAction: &protobuf.KickAction{}} },
}

Functions

This section is empty.

Types

type Action

type Action interface {
	proto.Message
	ID() int16
}

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

func NewDecoder

func NewDecoder(Io io.Reader) *Decoder

func (*Decoder) Read

func (decoder *Decoder) Read() (Action, error)

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder(Io io.Writer) *Encoder

func (*Encoder) Encode

func (encoder *Encoder) Encode(action Action) error

type Event

type Event struct {
	*protobuf.EventAction
}

func (*Event) Decode

func (i *Event) Decode() (internalevents.Event, bool)

func (*Event) Encode

func (i *Event) Encode(event internalevents.Event) *Event

func (*Event) ID

func (i *Event) ID() int16

func (Event) New

func (i Event) New() *Event

type Info

type Info struct {
	*protobuf.InfoAction
}

Info is sent by the proxy to inform the client of any changes in the proxy information.

func (*Info) DecodeConfig

func (i *Info) DecodeConfig() (config config.Structure)

func (*Info) EncodeConfig

func (i *Info) EncodeConfig(config config.Structure) *Info

func (*Info) ID

func (i *Info) ID() int16

type Init

type Init struct {
	*protobuf.InitAction
}

Init is sent from the plugin to server in order to initialize the plugin.

func (*Init) ID

func (i *Init) ID() int16

type Kick

type Kick struct {
	*protobuf.KickAction
}

func (*Kick) ID

func (i *Kick) ID() int16

type Log

type Log struct {
	*protobuf.LogAction
}

Log is sent from the plugin to log things to the console

func NewLogAction

func NewLogAction(t protobuf.LogAction_Type, message string, sources []string) *Log

func (*Log) ID

func (i *Log) ID() int16

type Send

type Send struct {
	*protobuf.SendAction
}

func (*Send) ID

func (i *Send) ID() int16

type SetDebug

type SetDebug struct {
	*protobuf.SetDebugAction
}

func (*SetDebug) ID

func (i *SetDebug) ID() int16

type SetMotd

type SetMotd struct {
	*protobuf.SetMotdAction
}

func (*SetMotd) ID

func (i *SetMotd) ID() int16

type WritePacket

type WritePacket struct {
	*protobuf.WritePacketAction
}

func (*WritePacket) Encode

func (i *WritePacket) Encode(packet packet.Packet) *WritePacket

func (*WritePacket) ID

func (i *WritePacket) ID() int16

func (WritePacket) New

func (i WritePacket) New(xuid string) *WritePacket

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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