Documentation ¶
Index ¶
- Variables
- func CreateReplayConnector(ctx context.Context, filename string, packetFunc PacketFunc, ...) (r *replayConnector, err error)
- func DecodePacket(header packet.Header, payload []byte) (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) CommandHandlerPacketCB(pk packet.Packet, toServer bool, _ time.Time, _ bool) (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, serverAddress, name string) (err error)
- func (p *Context) SendMessage(text string)
- func (p *Context) SendPopup(text string)
- type CustomClientData
- type Handler
- type PacketFunc
- type Player
Constants ¶
This section is empty.
Variables ¶
View Source
var NewPacketCapturer func() *Handler
Functions ¶
func CreateReplayConnector ¶
Types ¶
type Context ¶
type Context struct { Server minecraft.IConn Client minecraft.IConn Player Player // 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) CommandHandlerPacketCB ¶
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 CustomClientData ¶
type Handler ¶
type Handler struct { Name string ProxyRef func(pc *Context) // AddressAndName func(address, hostname string) error // called to change game data ToClientGameDataModifier func(gd *minecraft.GameData) // Called with raw packet data PacketRaw func(header packet.Header, payload []byte, src, dst net.Addr) // called on every packet after login PacketCB func(pk packet.Packet, toServer bool, timeReceived time.Time, preLogin bool) (packet.Packet, error) // called after client connected OnClientConnect func(conn minecraft.IConn) // called after server connected & downloaded resource packs OnServerConnect func() (cancel bool, err error) // called after game started ConnectCB func() bool // called when the proxy session stops or is reconnected OnEnd func() // called when the proxy ends Deferred func() }
func NewDebugLogger ¶
Click to show internal directories.
Click to hide internal directories.