kite

package module
v0.0.0-...-756ea48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

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

A Conn represents a connection to a Minecraft server or client. It wraps the underlying net.Conn and provides utilities for processing and writing packets.

func NewConn

func NewConn(direction packet.Direction, conn net.Conn, handler func(pb PacketBuffer) error) *Conn

func (*Conn) Close

func (c *Conn) Close()

func (*Conn) EnableEncryption

func (c *Conn) EnableEncryption(sharedSecret []byte) error

func (*Conn) ForwardPacket

func (c *Conn) ForwardPacket(pb PacketBuffer) (err error)

func (*Conn) GetNonce

func (c *Conn) GetNonce() []byte

func (*Conn) GetState

func (c *Conn) GetState() packet.State

func (*Conn) ReadLoop

func (c *Conn) ReadLoop()

func (*Conn) RemoteAddr

func (c *Conn) RemoteAddr() net.Addr

func (*Conn) SendPacket

func (c *Conn) SendPacket(pkt packet.Packet) (err error)

func (*Conn) SetState

func (c *Conn) SetState(state packet.State)

type PacketBuffer

type PacketBuffer struct {
	Id int // The protocol ID of the packet
	// contains filtered or unexported fields
}

PacketBuffer represents a buffer containing a single packet. Does not hold the connection state, the state can be inferred from the connection which created the buffer.

Packet buffers must be fully consumed. If not reading the content, the Consume method should be called. Forwarding a packet buffer to another connection does count as consumption.

func (PacketBuffer) Consume

func (p PacketBuffer) Consume()

Consume marks the packet as read without using the data

func (PacketBuffer) Read

func (p PacketBuffer) Read(t packet.Packet) error

Directories

Path Synopsis
examples
basic2 command
internal
pkg
mojang
Package mojang implements callers for Mojang API requests relevant to Kite proxies.
Package mojang implements callers for Mojang API requests relevant to Kite proxies.

Jump to

Keyboard shortcuts

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