binary

package
v0.0.0-...-e525491 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuilder

func NewBuilder(id CommandID, length int, order binary.ByteOrder) *builder

NewBuilder creates a new builder capable of constructing a binary Command.

Types

type Command

type Command interface {
	ID() CommandID
	Name() string
	ExpectedLength() int
	IsVariableLength() bool
	IsEncrypted() bool
}

Command is a avatar.Command implemented as a binary form.

type CommandID

type CommandID byte

CommandID uniquely identifies a binary Command.

type ConnectToGameServer

type ConnectToGameServer struct {
	IP     net.IP
	Port   int
	NewKey uint32
}

func (ConnectToGameServer) ExpectedLength

func (cmd ConnectToGameServer) ExpectedLength() int

func (ConnectToGameServer) ID

func (cmd ConnectToGameServer) ID() CommandID

func (ConnectToGameServer) IsEncrypted

func (cmd ConnectToGameServer) IsEncrypted() bool

func (ConnectToGameServer) IsVariableLength

func (cmd ConnectToGameServer) IsVariableLength() bool

func (ConnectToGameServer) MarshalBinary

func (cmd ConnectToGameServer) MarshalBinary(order binary.ByteOrder) ([]byte, error)

func (ConnectToGameServer) Name

func (cmd ConnectToGameServer) Name() string

type GameServerList

type GameServerList struct {
	SystemInfoFlag SystemInfoFlag
	// contains filtered or unexported fields
}

func (*GameServerList) AddItem

func (cmd *GameServerList) AddItem(entry *GameServerListItem)

func (GameServerList) ExpectedLength

func (cmd GameServerList) ExpectedLength() int

func (GameServerList) ID

func (cmd GameServerList) ID() CommandID

func (GameServerList) IsEncrypted

func (cmd GameServerList) IsEncrypted() bool

func (GameServerList) IsVariableLength

func (cmd GameServerList) IsVariableLength() bool

func (GameServerList) MarshalBinary

func (cmd GameServerList) MarshalBinary(order binary.ByteOrder) ([]byte, error)

func (GameServerList) Name

func (cmd GameServerList) Name() string

type GameServerListItem

type GameServerListItem struct {
	Index       int
	Name        string
	PercentFull int
	TimeZone    *time.Location
	IP          net.IP
}

type LoginDenied

type LoginDenied struct {
	Reason LoginDeniedReason
}

func (LoginDenied) ExpectedLength

func (cmd LoginDenied) ExpectedLength() int

func (LoginDenied) ID

func (cmd LoginDenied) ID() CommandID

func (LoginDenied) IsEncrypted

func (cmd LoginDenied) IsEncrypted() bool

func (LoginDenied) IsVariableLength

func (cmd LoginDenied) IsVariableLength() bool

func (LoginDenied) MarshalBinary

func (cmd LoginDenied) MarshalBinary(order binary.ByteOrder) ([]byte, error)

func (LoginDenied) Name

func (cmd LoginDenied) Name() string

type LoginDeniedReason

type LoginDeniedReason byte

LoginDeniedReason captures the reason the login server has denied a client's attempt to log in.

const (
	LoginDeniedReasonUnableToAuthenticate LoginDeniedReason = iota
	LoginDeniedReasonAccountInUse
	LoginDeniedReasonAccountBlocked
	LoginDeniedReasonInvalidCredentials
	LoginDeniedReasonCommunicationProblem
	LoginDeniedReasonConcurrencyLimitMet
	LoginDeniedReasonTimeLimitMet
	LoginDeniedReasonGeneralAuthenticationFailure
	LoginDeniedReasonCouldNotAttachToGameServer
	LoginDeniedReasonCharacterTransferInProgress
)

type LoginRequest

type LoginRequest struct {
	AccountName  string
	Password     string
	NextLoginKey int
}

func (LoginRequest) ExpectedLength

func (cmd LoginRequest) ExpectedLength() int

func (LoginRequest) ID

func (cmd LoginRequest) ID() CommandID

func (LoginRequest) IsEncrypted

func (cmd LoginRequest) IsEncrypted() bool

func (LoginRequest) IsVariableLength

func (cmd LoginRequest) IsVariableLength() bool

func (LoginRequest) Name

func (cmd LoginRequest) Name() string

func (*LoginRequest) UnmarshalBinary

func (cmd *LoginRequest) UnmarshalBinary(order binary.ByteOrder, data []byte) error

type LoginSeed

type LoginSeed struct {
	Seed    avatar.Seed
	Version avatar.Version
}

func (LoginSeed) ExpectedLength

func (cmd LoginSeed) ExpectedLength() int

func (LoginSeed) ID

func (cmd LoginSeed) ID() CommandID

func (LoginSeed) IsEncrypted

func (cmd LoginSeed) IsEncrypted() bool

func (LoginSeed) IsVariableLength

func (cmd LoginSeed) IsVariableLength() bool

func (LoginSeed) Name

func (cmd LoginSeed) Name() string

func (*LoginSeed) UnmarshalBinary

func (cmd *LoginSeed) UnmarshalBinary(order binary.ByteOrder, data []byte) error

type Marshaler

type Marshaler interface {
	MarshalBinary(order binary.ByteOrder) ([]byte, error)
}

Marshaler is the interface implemented by types that can marshal themselves into a binary form.

type ReceivableCommand

type ReceivableCommand interface {
	Command
	Unmarshaler
}

type SelectServer

type SelectServer struct {
	Index int
}

func (SelectServer) ExpectedLength

func (cmd SelectServer) ExpectedLength() int

func (SelectServer) ID

func (cmd SelectServer) ID() CommandID

func (SelectServer) IsEncrypted

func (cmd SelectServer) IsEncrypted() bool

func (SelectServer) IsVariableLength

func (cmd SelectServer) IsVariableLength() bool

func (SelectServer) Name

func (cmd SelectServer) Name() string

func (*SelectServer) UnmarshalBinary

func (cmd *SelectServer) UnmarshalBinary(order binary.ByteOrder, data []byte) error

type SendableCommand

type SendableCommand interface {
	Command
	Marshaler
}

type SendableReceivableCommand

type SendableReceivableCommand interface {
	SendableCommand
	ReceivableCommand
}

type SystemInfoFlag

type SystemInfoFlag byte

SystemInfoFlag indicates which data, if any, the client should send in response to the GameServerList command.

const (
	SystemInfoFlagSendVideoCardInfo      SystemInfoFlag = 0x64
	SystemInfoFlagDoNotSendVideoCardInfo SystemInfoFlag = 0xCC
	SystemInfoFlagUnknown                SystemInfoFlag = 0x5D
	SystemInfoFlagAll                    SystemInfoFlag = 0xFF
)

System info flags.

type Unmarshaler

type Unmarshaler interface {
	UnmarshalBinary(order binary.ByteOrder, data []byte) error
}

Unmarshaler is the interface implemented by types that can unmarshal a binary description of themselves.

Jump to

Keyboard shortcuts

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