ray

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	//Called when the ray recieves a packet.
	HandlePacketReceive(ctx *event.Context, pk packet.Packet, ray *Ray)
	//Called right before or when a ray tries to forward a packet.
	HandlePacketSend(ctx *event.Context, pk packet.Packet, ray *Ray)
}

type NopHandler

type NopHandler struct{}

func (NopHandler) HandlePacketReceive

func (n NopHandler) HandlePacketReceive(*event.Context, packet.Packet, *Ray)

func (NopHandler) HandlePacketSend

func (n NopHandler) HandlePacketSend(*event.Context, packet.Packet, *Ray)

type Ray

type Ray struct {
	Translations *TranslatorMappings

	TransferData struct {
		ScoreboardNames map[string]struct{}
	}
	// contains filtered or unexported fields
}

func New

func New(conn *minecraft.Conn) *Ray

func (*Ray) BufferConn

func (r *Ray) BufferConn() *remote.Remote

* BufferConn is the connection used to temp out new conns also named temp conn

func (*Ray) Conn

func (r *Ray) Conn() *minecraft.Conn

func (*Ray) Handle

func (r *Ray) Handle(handler Handler)

Changes the rays handler...

func (*Ray) HandleTransferDataSwap

func (r *Ray) HandleTransferDataSwap(bufferC *remote.Remote)

func (*Ray) Handler

func (r *Ray) Handler() Handler

Returns the current handler...

func (*Ray) InitTranslators

func (r *Ray) InitTranslators(data minecraft.GameData)

func (*Ray) Remote

func (r *Ray) Remote() *remote.Remote

Returns the Remote Connection the player has currently.

func (*Ray) SetBufferConn

func (r *Ray) SetBufferConn(rem *remote.Remote)

func (*Ray) SetRemote

func (r *Ray) SetRemote(rem *remote.Remote)

func (*Ray) SetTransferring

func (r *Ray) SetTransferring(transferring bool)

func (*Ray) Transferring

func (r *Ray) Transferring() bool

Returns a bool representing if a player is Transferring.

func (*Ray) TranslatePacket

func (r *Ray) TranslatePacket(pk packet.Packet)

type TranslatorMappings

type TranslatorMappings struct {
	OriginalEntityRuntimeID uint64
	OriginalEntityUniqueID  int64
	CurrentEntityRuntimeID  uint64
	CurrentEntityUniqueID   int64
}

Jump to

Keyboard shortcuts

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