Documentation ¶
Index ¶
- Variables
- func DecodePacket(header packet.Header, payload []byte, shieldID int32) (pk packet.Packet, ok bool)
- type Context
- func (p *Context) AddCommand(exec func([]string) bool, cmd protocol.Command)
- func (p *Context) AddHandler(handler *Handler)
- func (p *Context) ClientWritePacket(pk packet.Packet) error
- func (p *Context) Disconnect()
- func (p *Context) DisconnectClient()
- func (p *Context) DisconnectServer()
- func (p *Context) IsClient(addr net.Addr) bool
- func (p *Context) Run(ctx context.Context, connectString string) (err error)
- func (p *Context) SendMessage(text string)
- func (p *Context) SendPopup(text string)
- type Handler
- type PacketFunc
- type Pcap2Reader
- type Player
- type ReplayConnector
- func (r *ReplayConnector) Authenticated() bool
- func (r *ReplayConnector) ChunkRadius() int
- func (r *ReplayConnector) ClientCacheEnabled() bool
- func (r *ReplayConnector) ClientData() login.ClientData
- func (r *ReplayConnector) Close() error
- func (r *ReplayConnector) DoSpawn() error
- func (r *ReplayConnector) DoSpawnContext(ctx context.Context) error
- func (r *ReplayConnector) DoSpawnTimeout(timeout time.Duration) error
- func (r *ReplayConnector) Expect(...uint32)
- func (r *ReplayConnector) Flush() error
- func (r *ReplayConnector) GameData() minecraft.GameData
- func (r *ReplayConnector) IdentityData() login.IdentityData
- func (r *ReplayConnector) Latency() time.Duration
- func (r *ReplayConnector) LocalAddr() net.Addr
- func (r *ReplayConnector) OnDisconnect() <-chan struct{}
- func (r *ReplayConnector) Read(b []byte) (n int, err error)
- func (r *ReplayConnector) ReadPacket() (pk packet.Packet, err error)
- func (r *ReplayConnector) ReadPacketWithTime() (pk packet.Packet, receivedAt time.Time, err error)
- func (r *ReplayConnector) ReadUntilLogin() error
- func (r *ReplayConnector) RemoteAddr() net.Addr
- func (r *ReplayConnector) ResourcePacks() []resource.Pack
- func (r *ReplayConnector) SetDeadline(t time.Time) error
- func (r *ReplayConnector) SetGameData(data minecraft.GameData)
- func (r *ReplayConnector) SetLoggedIn()
- func (r *ReplayConnector) SetReadDeadline(t time.Time) error
- func (r *ReplayConnector) SetWriteDeadline(time.Time) error
- func (r *ReplayConnector) ShieldID() int32
- func (r *ReplayConnector) StartGame(data minecraft.GameData) error
- func (r *ReplayConnector) StartGameContext(ctx context.Context, data minecraft.GameData) error
- func (r *ReplayConnector) StartGameTimeout(data minecraft.GameData, timeout time.Duration) error
- func (r *ReplayConnector) Write(b []byte) (n int, err error)
- func (r *ReplayConnector) WritePacket(pk packet.Packet) error
Constants ¶
This section is empty.
Variables ¶
View Source
var NewPacketCapturer func() *Handler
Functions ¶
Types ¶
type Context ¶
type Context struct { Server minecraft.IConn Client minecraft.IConn Player Player ExtraDebug bool PlayerMoveCB []func() ListenAddress string // contains filtered or unexported fields }
func (*Context) AddCommand ¶
AddCommand adds a command to the command handler
func (*Context) AddHandler ¶
AddHandler adds a handler to the proxy
func (*Context) ClientWritePacket ¶
ClientWritePacket sends a packet to the client, nop if no client connected
func (*Context) Disconnect ¶
func (p *Context) Disconnect()
Disconnect disconnects both the client and server
func (*Context) DisconnectClient ¶
func (p *Context) DisconnectClient()
Disconnect disconnects the client
func (*Context) DisconnectServer ¶
func (p *Context) DisconnectServer()
Disconnect disconnects from the server
func (*Context) SendMessage ¶
SendMessage sends a chat message to the client
type Handler ¶
type Handler struct { Name string ProxyReference func(c *Context) GameDataModifier func(gameData *minecraft.GameData) OnAddressAndName func(address, hostname string) error PacketRaw func(header packet.Header, payload []byte, src, dst net.Addr) PacketCallback func(pk packet.Packet, toServer bool, timeReceived time.Time, preLogin bool) (packet.Packet, error) OnClientConnect func() OnServerConnect func() (cancel bool, err error) OnConnect func() (cancel bool) OnSessionEnd func() OnProxyEnd func() }
func NewDebugLogger ¶
type Pcap2Reader ¶ added in v1.39.0
type Pcap2Reader struct { Version uint32 ResourcePacks *replayCache CurrentPacket int PacketFunc PacketFunc // contains filtered or unexported fields }
func NewPcap2Reader ¶ added in v1.39.0
func NewPcap2Reader(f *os.File) (*Pcap2Reader, error)
func (*Pcap2Reader) ReadPacket ¶ added in v1.39.0
func (*Pcap2Reader) Seek ¶ added in v1.39.0
func (r *Pcap2Reader) Seek(packet int) error
type ReplayConnector ¶ added in v1.39.0
type ReplayConnector struct {
// contains filtered or unexported fields
}
func CreateReplayConnector ¶
func CreateReplayConnector(ctx context.Context, filename string, packetFunc PacketFunc, onResourcePackInfo func(), OnFinishedPack func(resource.Pack)) (r *ReplayConnector, err error)
func (*ReplayConnector) Authenticated ¶ added in v1.39.0
func (r *ReplayConnector) Authenticated() bool
func (*ReplayConnector) ChunkRadius ¶ added in v1.39.0
func (r *ReplayConnector) ChunkRadius() int
func (*ReplayConnector) ClientCacheEnabled ¶ added in v1.39.0
func (r *ReplayConnector) ClientCacheEnabled() bool
func (*ReplayConnector) ClientData ¶ added in v1.39.0
func (r *ReplayConnector) ClientData() login.ClientData
func (*ReplayConnector) Close ¶ added in v1.39.0
func (r *ReplayConnector) Close() error
func (*ReplayConnector) DoSpawn ¶ added in v1.39.0
func (r *ReplayConnector) DoSpawn() error
func (*ReplayConnector) DoSpawnContext ¶ added in v1.39.0
func (r *ReplayConnector) DoSpawnContext(ctx context.Context) error
func (*ReplayConnector) DoSpawnTimeout ¶ added in v1.39.0
func (r *ReplayConnector) DoSpawnTimeout(timeout time.Duration) error
func (*ReplayConnector) Expect ¶ added in v1.39.0
func (r *ReplayConnector) Expect(...uint32)
func (*ReplayConnector) Flush ¶ added in v1.39.0
func (r *ReplayConnector) Flush() error
func (*ReplayConnector) GameData ¶ added in v1.39.0
func (r *ReplayConnector) GameData() minecraft.GameData
func (*ReplayConnector) IdentityData ¶ added in v1.39.0
func (r *ReplayConnector) IdentityData() login.IdentityData
func (*ReplayConnector) Latency ¶ added in v1.39.0
func (r *ReplayConnector) Latency() time.Duration
func (*ReplayConnector) LocalAddr ¶ added in v1.39.0
func (r *ReplayConnector) LocalAddr() net.Addr
func (*ReplayConnector) OnDisconnect ¶ added in v1.39.0
func (r *ReplayConnector) OnDisconnect() <-chan struct{}
func (*ReplayConnector) Read ¶ added in v1.39.0
func (r *ReplayConnector) Read(b []byte) (n int, err error)
func (*ReplayConnector) ReadPacket ¶ added in v1.39.0
func (r *ReplayConnector) ReadPacket() (pk packet.Packet, err error)
func (*ReplayConnector) ReadPacketWithTime ¶ added in v1.39.0
func (*ReplayConnector) ReadUntilLogin ¶ added in v1.39.0
func (r *ReplayConnector) ReadUntilLogin() error
func (*ReplayConnector) RemoteAddr ¶ added in v1.39.0
func (r *ReplayConnector) RemoteAddr() net.Addr
func (*ReplayConnector) ResourcePacks ¶ added in v1.39.0
func (r *ReplayConnector) ResourcePacks() []resource.Pack
func (*ReplayConnector) SetDeadline ¶ added in v1.39.0
func (r *ReplayConnector) SetDeadline(t time.Time) error
func (*ReplayConnector) SetGameData ¶ added in v1.39.0
func (r *ReplayConnector) SetGameData(data minecraft.GameData)
func (*ReplayConnector) SetLoggedIn ¶ added in v1.39.0
func (r *ReplayConnector) SetLoggedIn()
func (*ReplayConnector) SetReadDeadline ¶ added in v1.39.0
func (r *ReplayConnector) SetReadDeadline(t time.Time) error
func (*ReplayConnector) SetWriteDeadline ¶ added in v1.39.0
func (r *ReplayConnector) SetWriteDeadline(time.Time) error
func (*ReplayConnector) ShieldID ¶ added in v1.39.0
func (r *ReplayConnector) ShieldID() int32
func (*ReplayConnector) StartGame ¶ added in v1.39.0
func (r *ReplayConnector) StartGame(data minecraft.GameData) error
func (*ReplayConnector) StartGameContext ¶ added in v1.39.0
func (*ReplayConnector) StartGameTimeout ¶ added in v1.39.0
func (*ReplayConnector) Write ¶ added in v1.39.0
func (r *ReplayConnector) Write(b []byte) (n int, err error)
func (*ReplayConnector) WritePacket ¶ added in v1.39.0
func (r *ReplayConnector) WritePacket(pk packet.Packet) error
Click to show internal directories.
Click to hide internal directories.