packet

package
v0.0.0-...-27fe9b7 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IDRayTransfer = iota + 0xFA
	IDRayText
)

* The RakNet connection or rather mcpe packet ids

View Source
const (
	IDPlanetAuth = iota
	IDPlanetDisconnect
	IDPlanetTransfer
	IDPlanetTransferResponse
	IDPlanetText
	IDPlanetTextResponse
	//Is sent back if the given request is correct.
	IDPlanetUserInfo
	//used to send back errors
	IDPlanetUserInfoResponse
)

* The TCP api packet ids.

View Source
const (
	TextResponseSuccess = iota
	TextResponseBadRequest
	TextResponseTargetsNotFound
)
View Source
const (
	TransferResponseSuccess = iota
	TransferResponseBadRequest
	TransferResponseRemoteNotFound
	TransferResponseRemoteRejection
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PlanetAuth

type PlanetAuth struct {
	Key string
}

func (*PlanetAuth) ID

func (p *PlanetAuth) ID() uint32

func (*PlanetAuth) Marshal

func (p *PlanetAuth) Marshal(w *protocol.Writer)

func (*PlanetAuth) Unmarshal

func (p *PlanetAuth) Unmarshal(r *protocol.Reader)

type PlanetDisconnect

type PlanetDisconnect struct {
	Message string
}

func (*PlanetDisconnect) ID

func (p *PlanetDisconnect) ID() uint32

func (*PlanetDisconnect) Marshal

func (p *PlanetDisconnect) Marshal(w *protocol.Writer)

func (*PlanetDisconnect) Unmarshal

func (p *PlanetDisconnect) Unmarshal(r *protocol.Reader)

type PlanetTransfer

type PlanetTransfer struct {
	// Address is the address of the new server, which might be either a hostname or an actual IP address.
	Address string
	// Port is the UDP port of the new server.
	Port uint16
	//User is the uuid of the given player to transfer
	User string
}

func (*PlanetTransfer) ID

func (pk *PlanetTransfer) ID() uint32

func (*PlanetTransfer) Marshal

func (pk *PlanetTransfer) Marshal(w *protocol.Writer)

func (*PlanetTransfer) Unmarshal

func (pk *PlanetTransfer) Unmarshal(r *protocol.Reader)

type Text

type Text struct {
	/*
		Servers is an array of strings that contains the servers IP addresses the text message should be broadcast to
	*/
	Servers []string

	/*
		The text message
	*/
	Message string
}

Text is sent by the server to send a message to all the connected players on the proxy.

func (*Text) ID

func (pk *Text) ID() uint32

func (*Text) Marshal

func (pk *Text) Marshal(w *protocol.Writer)

func (*Text) Unmarshal

func (pk *Text) Unmarshal(r *protocol.Reader)

type TextResponse

type TextResponse struct {
	/*
		Type is const shown above that represents the status of the request.
	*/
	Type byte

	/*
		Message is a accompanied message to the status can be anything basically.
	*/
	Message string
}

TextResponse is sent in response to a tcp api call to the Text packet.

func (TextResponse) ID

func (t TextResponse) ID() uint32

func (TextResponse) Marshal

func (t TextResponse) Marshal(w *protocol.Writer)

func (TextResponse) Unmarshal

func (t TextResponse) Unmarshal(r *protocol.Reader)

type Transfer

type Transfer struct {
	// Address is the address of the new server, which might be either a hostname or an actual IP address.
	Address string
	// Port is the UDP port of the new server.
	Port uint16
}

Transfer is sent by the server to change a Players remote connection otherwise known as the fast transfer packet

func (*Transfer) ID

func (pk *Transfer) ID() uint32

func (*Transfer) Marshal

func (pk *Transfer) Marshal(w *protocol.Writer)

func (*Transfer) Unmarshal

func (pk *Transfer) Unmarshal(r *protocol.Reader)

type TransferResponse

type TransferResponse struct {
	//Type is the said given type of response that we return
	Type byte
	//Message is a given message sent back with the response
	Message string
}

func (*TransferResponse) ID

func (t *TransferResponse) ID() uint32

func (*TransferResponse) Marshal

func (t *TransferResponse) Marshal(w *protocol.Writer)

func (*TransferResponse) Unmarshal

func (t *TransferResponse) Unmarshal(r *protocol.Reader)

type UserInfo

type UserInfo struct {
	Uuid   string
	Xuid   string
	IpAddr string
}

func (UserInfo) ID

func (u UserInfo) ID() uint32

func (UserInfo) Marshal

func (u UserInfo) Marshal(w *protocol.Writer)

func (UserInfo) Unmarshal

func (u UserInfo) Unmarshal(r *protocol.Reader)

Jump to

Keyboard shortcuts

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