packet

package
v0.0.0-...-157ca18 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolRequest byte = iota
	ProtocolResponse
	ServerDisconnect
	ConnectSuccess
	ConnectFailure
	HandshakeChallenge
	ChatReceive
	UniverseTimeUpdate
	CelestialResponse
	WarpResult
	PlanetType
	Pause
	ClientDisconnectRequest
	ClientConnect
	HandshakeResponse
	PlayerWarp
	FlyShip
	ChatSend
	CelestialRequest
	ClientContextUpdate
	WorldStart
	WorldStop
	WorldLayoutUpdate
	WorldParametersUpdate
	CentralStructureUpdate
	TileArrayUpdate
	TileUpdate
	TileLiquidUpdate
	TileDamageUpdate
	TileModificationFailure
	GiveItem
	EnvironmentUpdate
	UpdateTileProtection
	SetDungeonGravity
	SetDungeonBreathable
	SetPlayerStart
	FindUniqueEntityResponse
	ModifyTileList
	DamageTileGroup
	CollectLiquid
	RequestDrop
	SpawnEntity
	ConnectWire
	DisconnectAllWires
	WolrdClientStateUpdate
	FindUniqueEntity
	WorldStartAcknowledge
	EntityCreate
	EntityUpdateSet
	EntityDestroy
	EntityInteract
	EntityInteractResult
	HitResult
	DamageRequest
	DamageNotification
	EntityMessage
	EntityMessageResponse
	UpdateWorldProperties
	StepUpdate
	SystemWorldStart
	SystemWorldUpdate
	SystemObjectCreate
	SystemObjectDestroy
	SystemShipCreate
	SystemShipDestroy
	SystemObjectSpawn
)

Variables

This section is empty.

Functions

func WritePacket

func WritePacket(wt io.Writer, end byteorder.ByteOrder, pkt *BasePacket) error

Types

type BasePacket

type BasePacket struct {
	Type byte
	Buf  []byte
}

func ReadPacket

func ReadPacket(rd io.Reader, end byteorder.ByteOrder) (*BasePacket, error)

func (BasePacket) Parse

func (this BasePacket) Parse(end byteorder.ByteOrder) (Packet, error)

type ConnectFailurePacket

type ConnectFailurePacket struct {
	Execuse String
}

func (*ConnectFailurePacket) Pack

func (*ConnectFailurePacket) Unpack

func (r *ConnectFailurePacket) Unpack(e byteorder.ByteOrder, buf []byte) (err error)

type Packet

type Packet interface {
	Unpack(byteorder.ByteOrder, []byte) error
	Pack(byteorder.ByteOrder) (*BasePacket, error)
}

type ProtocolRequestPacket

type ProtocolRequestPacket struct {
	Version uint32
}

func (*ProtocolRequestPacket) Pack

func (*ProtocolRequestPacket) Unpack

func (r *ProtocolRequestPacket) Unpack(e byteorder.ByteOrder, buf []byte) error

type ProtocolResponsePacket

type ProtocolResponsePacket struct {
	Available bool
}

func (*ProtocolResponsePacket) Pack

func (*ProtocolResponsePacket) Unpack

func (r *ProtocolResponsePacket) Unpack(e byteorder.ByteOrder, buf []byte) error

Jump to

Keyboard shortcuts

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