connect

package
v0.0.0-...-82a22e8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2023 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoAuthenticate

func AutoAuthenticate(connectClient Connect, user *string, pass *string)

func AutoConnect

func AutoConnect(connectClient Connect, addr *string, done chan bool)

func NewCodecRegistry

func NewCodecRegistry(connectClient Connect) (codec *packet.PacketCodecRegistry)

func PasswordAndSaltHash

func PasswordAndSaltHash(password string, passwordSalt string) (val string)

func Sha1Hex

func Sha1Hex(str string) (val string)

Types

type Connect

type Connect interface {
	Connect(addr string) (err error)
	Disconnect()
	Connected() bool

	Request(request connect.Request) (statusCode uint8, result connect.Result, err error)
	RequestLater(request connect.Request, callback RequestCallback) (err error)
	DispatchResult(sequenceId int32, statusCode uint8, result connect.Result) (err error)
	RequestIdBySequenceId(sequenceId int32) int

	RegisterEvent(name string, eventHandler EventHandler)
	DispatchEvent(name string, event Event)
}

type ConnectImpl

type ConnectImpl struct {
	EventDispatcher
	// contains filtered or unexported fields
}

func NewConnectImpl

func NewConnectImpl() (this *ConnectImpl)

func (*ConnectImpl) Connect

func (this *ConnectImpl) Connect(addr string) (err error)

func (*ConnectImpl) Connected

func (this *ConnectImpl) Connected() (val bool)

func (*ConnectImpl) Disconnect

func (this *ConnectImpl) Disconnect()

func (*ConnectImpl) DispatchResult

func (this *ConnectImpl) DispatchResult(sequenceId int32, statusCode uint8, result connect.Result) (err error)

func (*ConnectImpl) ErrorCaught

func (this *ConnectImpl) ErrorCaught(err error)

func (*ConnectImpl) HandlePacket

func (this *ConnectImpl) HandlePacket(packet packet.Packet) (err error)

func (*ConnectImpl) Request

func (this *ConnectImpl) Request(request connect.Request) (statusCode uint8, result connect.Result, err error)

func (*ConnectImpl) RequestIdBySequenceId

func (this *ConnectImpl) RequestIdBySequenceId(sequenceId int32) (requestId int)

func (*ConnectImpl) RequestLater

func (this *ConnectImpl) RequestLater(request connect.Request, callback RequestCallback) (err error)

func (*ConnectImpl) Write

func (this *ConnectImpl) Write(packet packet.Packet) (err error)

type Event

type Event interface {
}

type EventDispatcher

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

func (*EventDispatcher) DispatchEvent

func (this *EventDispatcher) DispatchEvent(name string, event Event)

func (*EventDispatcher) RegisterEvent

func (this *EventDispatcher) RegisterEvent(name string, eventHandler EventHandler)

type EventHandler

type EventHandler func(event Event)

type EventMessage

type EventMessage struct {
	Sender  string
	Channel string
	Payload []byte
}

func WrapEventMessage

func WrapEventMessage(packet *connect.PacketMessageEvent) (this *EventMessage)

type EventRedirect

type EventRedirect struct {
	Server string
	Player string
}

func WrapEventRedirect

func WrapEventRedirect(packet *connect.PacketRedirectEvent) (this *EventRedirect)

type EventServer

type EventServer struct {
	Add         bool
	Server      string
	SecurityKey string
	Address     string
	Port        uint16
}

func WrapEventServer

func WrapEventServer(packet *connect.PacketServerEvent) (this *EventServer)

type RequestCallback

type RequestCallback func(statusCode uint8, result connect.Result)

type RequestRecord

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

func NewRequestRecord

func NewRequestRecord(request connect.Request, callback RequestCallback) (this *RequestRecord)

Jump to

Keyboard shortcuts

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