message

package
v0.0.0-...-298beda Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Unlicense Imports: 1 Imported by: 0

README

Message

A selection of common sendables and receivable data that many/all game will use

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

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

File

func NewFile

func NewFile(filepath string, data []byte) *File

NewFile creates a new file message

func (*File) Connectionless

func (msg *File) Connectionless() bool

Connectionless is this message a connectionless message?

func (*File) Data

func (msg *File) Data() []byte

Data Get packet data

type Generic

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

Generic is a unknown message type. It should still contain the same header structure as known packet types, but the payload is unknown

func NewGeneric

func NewGeneric(data []byte) *Generic

NewGeneric returns a new generic packet

func (*Generic) Connectionless

func (msg *Generic) Connectionless() bool

Connectionless is this message a connectionless message?

func (*Generic) Data

func (msg *Generic) Data() []byte

Data gets packet data

func (*Generic) WithError

func (msg *Generic) WithError(err error) *Generic

WithError associate an error with this message. Errors would tend to be related to malformed data.

type MsgConnectionlessK

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

MsgConnectionlessK is the authentication challenge response

func ConnectionlessK

func ConnectionlessK(clientChallenge int32, serverChallenge int32, playerName string, password string, gameVersion string, steamId uint64, steamKey []byte) *MsgConnectionlessK

ConnectionlessK provides the initial authentication packet

func (*MsgConnectionlessK) Connectionless

func (msg *MsgConnectionlessK) Connectionless() bool

Connectionless is this message a connectionless message?

func (*MsgConnectionlessK) Data

func (msg *MsgConnectionlessK) Data() []byte

Data Get packet data

type MsgConnectionlessQ

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

MsgConnectionlessQ is the first contact with a server packet

func ConnectionlessQ

func ConnectionlessQ(clientChallenge int32) *MsgConnectionlessQ

ConnectionlessQ returns a new packet

func (*MsgConnectionlessQ) Connectionless

func (msg *MsgConnectionlessQ) Connectionless() bool

Connectionless is this message a connectionless message?

func (*MsgConnectionlessQ) Data

func (msg *MsgConnectionlessQ) Data() []byte

Data Get packet data

type MsgDisconnect

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

func Disconnect

func Disconnect(msg string) *MsgDisconnect

Disconnect returns new disconnect packet data

func (*MsgDisconnect) Connectionless

func (msg *MsgDisconnect) Connectionless() bool

Connectionless: is this message a connectionless message?

func (*MsgDisconnect) Data

func (msg *MsgDisconnect) Data() []byte

Data Get packet data

type MsgQueryServerInfo

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

MsgQueryServerInfo is a connectionless request to a server to obtain basic information about its current status

func QueryServerInfo

func QueryServerInfo() *MsgQueryServerInfo

QueryServerInfo returns a packet to request server information

func (*MsgQueryServerInfo) Connectionless

func (msg *MsgQueryServerInfo) Connectionless() bool

Connectionless is this message a connectionless message?

func (*MsgQueryServerInfo) Data

func (msg *MsgQueryServerInfo) Data() []byte

Data Gets packet data

Jump to

Keyboard shortcuts

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