event

package
v0.0.0-...-07cd40f Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Fired on the initial connection request (handshake with next state 0x02)
	HandshakeEvent = &Handshake{
		BaseEvent:   *aurora.NewBaseEvent(true),
		KickMessage: chat.BuildMessage("Unknown reason"),
	}
)
View Source
var (
	JoinEvent = &Join{
		BaseEvent: *aurora.NewBaseEvent(true),
	}
)
View Source
var (
	// Fired before the sending the login success packet
	LoginEvent = &Login{
		BaseEvent:   *aurora.NewBaseEvent(true),
		KickMessage: chat.BuildMessage("Unknown reason"),
	}
)
View Source
var (
	PingEvent = &Ping{
		BaseEvent: *aurora.NewBaseEvent(true),
	}
)
View Source
var (
	// Fired when login starts after the initial handshake
	PreLoginEvent = &PreLogin{
		BaseEvent:   *aurora.NewBaseEvent(true),
		KickMessage: chat.BuildMessage("Unknown reason"),
	}
)

Functions

This section is empty.

Types

type Handshake

type Handshake struct {
	Protocol   int32
	RemoteAddr net.Addr

	KickMessage chat.Message

	aurora.BaseEvent
}

Fired on the initial connection request (handshake with next state 0x02)

func (*Handshake) Disallow

func (e *Handshake) Disallow(reason chat.Message)

Whether to allow the user to connect or not.

func (*Handshake) Fire

func (e *Handshake) Fire() bool

Executes all the registered handle functions and returns if the event was cancelled

type Join

type Join struct {
	Protocol   int32
	RemoteAddr net.Addr

	aurora.BaseEvent
	// contains filtered or unexported fields
}

func (*Join) Fire

func (e *Join) Fire() bool

Executes all the registered handle functions and returns if the event was cancelled

func (*Join) JoinMessage

func (e *Join) JoinMessage() *chat.Message

Get's the current join message

func (*Join) SetJoinMessage

func (e *Join) SetJoinMessage(message *chat.Message)

Set's the join message if nil, no join message will be sent

type Login

type Login struct {
	Name       string
	UUID       [16]byte
	Protocol   int32
	RemoteAddr net.Addr

	KickMessage chat.Message

	aurora.BaseEvent
}

Fired before the sending the login success packet

func (*Login) Disallow

func (e *Login) Disallow(reason chat.Message)

Whether to allow the user to connect or not.

func (*Login) Fire

func (e *Login) Fire() bool

Executes all the registered handle functions and returns if the event was cancelled

type Ping

type Ping struct {
	Status     *status.StatusResponse // The current status response
	RemoteAddr net.Addr

	aurora.BaseEvent
}

func (*Ping) Fire

func (e *Ping) Fire() bool

Executes all the registered handle functions and returns if the event was cancelled

type PreLogin

type PreLogin struct {
	Name       string
	UUID       [16]byte
	Protocol   int32
	RemoteAddr net.Addr

	KickMessage chat.Message

	aurora.BaseEvent
}

Fired when login starts after the initial handshake

func (*PreLogin) Disallow

func (e *PreLogin) Disallow(reason chat.Message)

Whether to allow the user to connect or not.

func (*PreLogin) Fire

func (e *PreLogin) Fire() bool

Executes all the registered handle functions and returns if the event was cancelled

Jump to

Keyboard shortcuts

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