Documentation ¶
Index ¶
- Variables
- func DecodePacket(header packet.Header, payload []byte, shieldID int32) (pk packet.Packet, ok bool)
- func NewPacketLogger(verbose, clientSide bool) (*packetLogger, error)
- type Blobcache
- func (b *Blobcache) Close() error
- func (b *Blobcache) HandleClientCacheBlobStatus(pk *packet.ClientCacheBlobStatus) error
- func (b *Blobcache) HandleClientCacheMissResponse(pk *packet.ClientCacheMissResponse, timeReceived time.Time, preLogin bool) error
- func (b *Blobcache) HandleLevelChunk(pk *packet.LevelChunk, timeReceived time.Time, preLogin bool) (pkForward packet.Packet, err error)
- func (b *Blobcache) HandleSubChunk(pk *packet.SubChunk, timeReceived time.Time, preLogin bool) (pkForward packet.Packet, err error)
- type Context
- type Handler
- type Handlers
- func (h *Handlers) FilterResourcePack(id string) bool
- func (h *Handlers) GameDataModifier(gameData *minecraft.GameData)
- func (h *Handlers) OnConnect() (cancel bool)
- func (h *Handlers) OnFinishedPack(pack resource.Pack) error
- func (h *Handlers) OnProxyEnd()
- func (h *Handlers) OnServerConnect() (cancel bool, err error)
- func (h *Handlers) OnSessionEnd()
- func (h *Handlers) PacketCallback(pk packet.Packet, toServer bool, timeReceived time.Time, preLogin bool) (packet.Packet, error)
- func (h *Handlers) PacketRaw(header packet.Header, payload []byte, src, dst net.Addr, ...)
- func (h *Handlers) SessionStart(s *Session, serverName string) error
- 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(ids ...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
- type Session
- func (s *Session) AddCommand(exec func([]string) bool, cmd protocol.Command)
- func (s *Session) ClientWritePacket(pk packet.Packet) error
- func (s *Session) Disconnect()
- func (s *Session) DisconnectClient()
- func (s *Session) DisconnectServer()
- func (s *Session) IsClient(addr net.Addr) bool
- func (s *Session) Run(ctx context.Context, connect *utils.ConnectInfo) error
- func (s *Session) SendMessage(text string)
- func (s *Session) SendPopup(text string)
Constants ¶
This section is empty.
Variables ¶
View Source
var NewPacketCapturer func() (*Handler, func([]protocol.CacheBlob))
Functions ¶
func DecodePacket ¶
func NewPacketLogger ¶ added in v1.40.0
Types ¶
type Blobcache ¶ added in v1.40.0
type Blobcache struct { OnHitBlobs func(blobs []protocol.CacheBlob) // contains filtered or unexported fields }
func NewBlobCache ¶ added in v1.40.0
func (*Blobcache) HandleClientCacheBlobStatus ¶ added in v1.40.0
func (b *Blobcache) HandleClientCacheBlobStatus(pk *packet.ClientCacheBlobStatus) error
func (*Blobcache) HandleClientCacheMissResponse ¶ added in v1.40.0
func (*Blobcache) HandleLevelChunk ¶ added in v1.40.0
type Context ¶
type Context struct { ExtraDebug bool PlayerMoveCB []func() ListenAddress string // contains filtered or unexported fields }
func (*Context) AddHandler ¶
AddHandler adds a handler to the proxy
type Handler ¶
type Handler struct { Name string SessionStart func(s *Session, serverName string) error GameDataModifier func(gameData *minecraft.GameData) FilterResourcePack func(id string) bool OnFinishedPack func(pack resource.Pack) error PacketRaw func(header packet.Header, payload []byte, src, dst net.Addr, timeReceived time.Time) PacketCallback func(pk packet.Packet, toServer bool, timeReceived time.Time, preLogin bool) (packet.Packet, error) OnServerConnect func() (cancel bool, err error) OnConnect func() (cancel bool) OnSessionEnd func() OnProxyEnd func() }
type Handlers ¶ added in v1.39.1
type Handlers []*Handler
func (*Handlers) FilterResourcePack ¶ added in v1.39.1
func (*Handlers) GameDataModifier ¶ added in v1.39.1
func (*Handlers) OnFinishedPack ¶ added in v1.39.1
func (*Handlers) OnProxyEnd ¶ added in v1.39.1
func (h *Handlers) OnProxyEnd()
func (*Handlers) OnServerConnect ¶ added in v1.39.1
func (*Handlers) OnSessionEnd ¶ added in v1.39.1
func (h *Handlers) OnSessionEnd()
func (*Handlers) PacketCallback ¶ added in v1.39.1
type PacketFunc ¶
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, resourcePackHandler *rpHandler) (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(ids ...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
type Session ¶ added in v1.39.1
type Session struct { Server minecraft.IConn Client minecraft.IConn Player Player OnHitBlobs func(hitBlobs []protocol.CacheBlob) // contains filtered or unexported fields }
func NewSession ¶ added in v1.39.1
func NewSession() *Session
func (*Session) AddCommand ¶ added in v1.39.1
AddCommand adds a command to the command handler
func (*Session) ClientWritePacket ¶ added in v1.39.1
ClientWritePacket sends a packet to the client, nop if no client connected
func (*Session) Disconnect ¶ added in v1.39.1
func (s *Session) Disconnect()
Disconnect disconnects both the client and server
func (*Session) DisconnectClient ¶ added in v1.39.1
func (s *Session) DisconnectClient()
Disconnect disconnects the client
func (*Session) DisconnectServer ¶ added in v1.39.1
func (s *Session) DisconnectServer()
Disconnect disconnects from the server
func (*Session) SendMessage ¶ added in v1.39.1
SendMessage sends a chat message to the client
Click to show internal directories.
Click to hide internal directories.