Documentation ¶
Index ¶
- Constants
- Variables
- type AvailableCommands
- type BundleDelimiter
- type ChatCompletionAction
- type ClientSettings
- type CustomReportDetails
- type DeathPosition
- type DimensionInfo
- type Disconnect
- type EncryptionRequest
- type EncryptionResponse
- type Handshake
- type HandshakeIntent
- type HeaderAndFooter
- type JoinGame
- type KeepAlive
- type LoginAcknowledged
- type LoginPluginMessage
- type LoginPluginResponse
- type PingIdentify
- type PlayerChatCompletion
- type RemoveResourcePack
- type ResourcePackRequest
- type ResourcePackResponse
- type Respawn
- type ResponseStatus
- type ServerData
- type ServerLink
- type ServerLinks
- type ServerLogin
- type ServerLoginSuccess
- type SetCompression
- type StatusPing
- type StatusRequest
- type StatusResponse
- type TabCompleteOffer
- type TabCompleteRequest
- type TabCompleteResponse
- type Transfer
- type WireNode
Constants ¶
View Source
const ( NodeTypeRoot byte = 0x00 NodeTypeLiteral byte = 0x01 NodeTypeArgument byte = 0x02 FlagNodeType byte = 0x03 FlagExecutable byte = 0x04 FlagIsRedirect byte = 0x08 FlagHasSuggestions byte = 0x10 )
View Source
const ( StatusHandshakeIntent = HandshakeIntent(states.StatusState) LoginHandshakeIntent = HandshakeIntent(states.LoginState) TransferHandshakeIntent = HandshakeIntent(3) )
View Source
const VanillaMaxTabCompleteLen = 2048
Variables ¶
View Source
var PlaceholderCommand = brigodier.CommandFunc(func(c *brigodier.CommandContext) error { return nil })
View Source
chat.FromComponent(new(component.Translation)), Footer: *chat.FromComponent(new(component.Translation)), }Header: *
Functions ¶
This section is empty.
Types ¶
type AvailableCommands ¶ added in v0.12.0
type AvailableCommands struct {
RootNode *brigodier.RootCommandNode
}
func (*AvailableCommands) Decode ¶ added in v0.12.0
func (a *AvailableCommands) Decode(c *proto.PacketContext, rd io.Reader) error
func (*AvailableCommands) Encode ¶ added in v0.12.0
func (a *AvailableCommands) Encode(c *proto.PacketContext, wr io.Writer) (err error)
type BundleDelimiter ¶ added in v0.37.0
type BundleDelimiter struct{}
func (*BundleDelimiter) Decode ¶ added in v0.37.0
func (b *BundleDelimiter) Decode(*proto.PacketContext, io.Reader) error
func (*BundleDelimiter) Encode ¶ added in v0.37.0
func (b *BundleDelimiter) Encode(*proto.PacketContext, io.Writer) error
type ChatCompletionAction ¶ added in v0.19.1
type ChatCompletionAction int
const ( AddChatCompletionAction ChatCompletionAction = iota RemoveChatCompletionAction SetChatCompletionAction )
type ClientSettings ¶
type ClientSettings struct { Locale string // may be empty ViewDistance byte ChatVisibility int ChatColors bool Difficulty byte // 1.7 Protocol SkinParts byte MainHand int ChatFilteringEnabled bool // 1.17+ ClientListingAllowed bool // 1.18+, overwrites server-list "anonymous" mode }
func (*ClientSettings) Decode ¶
func (s *ClientSettings) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*ClientSettings) Encode ¶
func (s *ClientSettings) Encode(c *proto.PacketContext, wr io.Writer) error
type CustomReportDetails ¶ added in v0.38.0
func (*CustomReportDetails) Decode ¶ added in v0.38.0
func (p *CustomReportDetails) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*CustomReportDetails) Encode ¶ added in v0.38.0
func (p *CustomReportDetails) Encode(c *proto.PacketContext, wr io.Writer) error
type DeathPosition ¶ added in v0.19.0
func (*DeathPosition) String ¶ added in v0.19.0
func (d *DeathPosition) String() string
type DimensionInfo ¶
type Disconnect ¶
type Disconnect struct { Reason *chat.ComponentHolder // nil-able // Not part of the packet data itself, // but used to determine the state of the client. State states.State }
func NewDisconnect ¶ added in v0.35.0
func NewDisconnect(reason component.Component, protocol proto.Protocol, stat states.State) *Disconnect
NewDisconnect creates a new Disconnect packet.
func (*Disconnect) Decode ¶
func (d *Disconnect) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*Disconnect) Encode ¶
func (d *Disconnect) Encode(c *proto.PacketContext, wr io.Writer) error
type EncryptionRequest ¶
type EncryptionRequest struct { ServerID string PublicKey []byte VerifyToken []byte DisableAuthenticate bool }
func (*EncryptionRequest) Decode ¶
func (e *EncryptionRequest) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*EncryptionRequest) Encode ¶
func (e *EncryptionRequest) Encode(c *proto.PacketContext, wr io.Writer) error
type EncryptionResponse ¶
func (*EncryptionResponse) Decode ¶
func (e *EncryptionResponse) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*EncryptionResponse) Encode ¶
func (e *EncryptionResponse) Encode(c *proto.PacketContext, wr io.Writer) error
type Handshake ¶
https://wiki.vg/Protocol#Handshaking
func (*Handshake) Intent ¶ added in v0.37.0
func (h *Handshake) Intent() HandshakeIntent
type HandshakeIntent ¶ added in v0.37.0
type HandshakeIntent int
HandshakeIntent represents the client intent in the Handshake state.
type HeaderAndFooter ¶
type HeaderAndFooter struct {}
func (*HeaderAndFooter) Decode ¶
func (h *HeaderAndFooter) Decode(c *proto.PacketContext, rd io.Reader) (err error)
we never read this packet
func (*HeaderAndFooter) Encode ¶
func (h *HeaderAndFooter) Encode(c *proto.PacketContext, wr io.Writer) error
type JoinGame ¶
type JoinGame struct { EntityID int Gamemode int16 Dimension int PartialHashedSeed int64 // 1.15+ Difficulty int16 Hardcore bool MaxPlayers int LevelType *string // nil-able: removed in 1.16+ ViewDistance int // 1.14+ ReducedDebugInfo bool ShowRespawnScreen bool DoLimitedCrafting bool // 1.20.2+ LevelNames []string // a set of strings, 1.16+ Registry util.CompoundBinaryTag // 1.16+ DimensionInfo *DimensionInfo // 1.16+ CurrentDimensionData util.CompoundBinaryTag // 1.16.2+ PreviousGamemode int16 // 1.16+ SimulationDistance int // 1.18+ LastDeathPosition *DeathPosition // 1.19+ PortalCooldown int // 1.20+ EnforcesSecureChat bool // 1.20.5+ }
type LoginAcknowledged ¶ added in v0.35.0
type LoginAcknowledged struct{}
func (*LoginAcknowledged) Decode ¶ added in v0.35.0
func (l *LoginAcknowledged) Decode(_ *proto.PacketContext, rd io.Reader) (err error)
func (*LoginAcknowledged) Encode ¶ added in v0.35.0
func (l *LoginAcknowledged) Encode(_ *proto.PacketContext, wr io.Writer) error
type LoginPluginMessage ¶
func (*LoginPluginMessage) Decode ¶
func (l *LoginPluginMessage) Decode(_ *proto.PacketContext, rd io.Reader) (err error)
func (*LoginPluginMessage) Encode ¶
func (l *LoginPluginMessage) Encode(_ *proto.PacketContext, wr io.Writer) error
type LoginPluginResponse ¶
func (*LoginPluginResponse) Decode ¶
func (l *LoginPluginResponse) Decode(_ *proto.PacketContext, rd io.Reader) (err error)
func (*LoginPluginResponse) Encode ¶
func (l *LoginPluginResponse) Encode(_ *proto.PacketContext, wr io.Writer) (err error)
type PingIdentify ¶ added in v0.35.0
type PingIdentify struct {
ID int
}
func (*PingIdentify) Decode ¶ added in v0.35.0
func (p *PingIdentify) Decode(c *proto.PacketContext, rd io.Reader) error
func (*PingIdentify) Encode ¶ added in v0.35.0
func (p *PingIdentify) Encode(c *proto.PacketContext, wr io.Writer) error
type PlayerChatCompletion ¶ added in v0.19.1
type PlayerChatCompletion struct { Completions []string Action ChatCompletionAction }
func (*PlayerChatCompletion) Decode ¶ added in v0.19.1
func (p *PlayerChatCompletion) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*PlayerChatCompletion) Encode ¶ added in v0.19.1
func (p *PlayerChatCompletion) Encode(c *proto.PacketContext, wr io.Writer) error
type RemoveResourcePack ¶ added in v0.35.0
func (*RemoveResourcePack) Decode ¶ added in v0.35.0
func (r *RemoveResourcePack) Decode(c *proto.PacketContext, rd io.Reader) error
func (*RemoveResourcePack) Encode ¶ added in v0.35.0
func (r *RemoveResourcePack) Encode(c *proto.PacketContext, wr io.Writer) error
type ResourcePackRequest ¶
type ResourcePackRequest struct { ID uuid.UUID // 1.20.3+ URL string Hash string Required bool // 1.17+ Prompt *chat.ComponentHolder // (nil-able) 1.17+ }
func (*ResourcePackRequest) Decode ¶
func (r *ResourcePackRequest) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*ResourcePackRequest) Encode ¶
func (r *ResourcePackRequest) Encode(c *proto.PacketContext, wr io.Writer) error
type ResourcePackResponse ¶ added in v0.19.0
type ResourcePackResponse struct { ID uuid.UUID // 1.20.3+ Hash string Status ResponseStatus }
func (*ResourcePackResponse) Decode ¶ added in v0.19.0
func (r *ResourcePackResponse) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*ResourcePackResponse) Encode ¶ added in v0.19.0
func (r *ResourcePackResponse) Encode(c *proto.PacketContext, wr io.Writer) error
type Respawn ¶
type Respawn struct { Dimension int PartialHashedSeed int64 Difficulty int16 Gamemode int16 LevelType string // empty by default DataToKeep byte // 1.16+ DimensionInfo *DimensionInfo // 1.16-1.16.1 PreviousGamemode int16 // 1.16+ CurrentDimensionData util.CompoundBinaryTag // 1.16.2+ LastDeathPosition *DeathPosition // 1.19+ PortalCooldown int // 1.20+ }
type ResponseStatus ¶ added in v0.37.0
type ResponseStatus int
const ( SuccessfulResourcePackResponseStatus ResponseStatus = iota DeclinedResourcePackResponseStatus FailedDownloadResourcePackResponseStatus AcceptedResourcePackResponseStatus DownloadedResourcePackResponseStatus InvalidURLResourcePackResponseStatus FailedToReloadResourcePackResponseStatus DiscardedResourcePackResponseStatus )
func (ResponseStatus) Intermediate ¶ added in v0.37.0
func (s ResponseStatus) Intermediate() bool
Intermediate returns true if the resource pack status is intermediate, indicating that the player has either accepted the resource pack and is currently downloading it or has successfully downloaded it.
type ServerData ¶ added in v0.19.0
type ServerData struct { Description *chat.ComponentHolder // nil-able Favicon favicon.Favicon // may be empty SecureChatEnforced bool // Added in 1.19.1 - Removed in 1.20.5 }
func (*ServerData) Decode ¶ added in v0.19.0
func (s *ServerData) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*ServerData) Encode ¶ added in v0.19.0
func (s *ServerData) Encode(c *proto.PacketContext, wr io.Writer) error
type ServerLink ¶ added in v0.38.0
type ServerLink struct { ID int DisplayName chat.ComponentHolder URL string }
func (*ServerLink) Decode ¶ added in v0.38.0
func (p *ServerLink) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*ServerLink) Encode ¶ added in v0.38.0
func (p *ServerLink) Encode(c *proto.PacketContext, wr io.Writer) error
type ServerLinks ¶ added in v0.38.0
type ServerLinks struct {
ServerLinks []*ServerLink
}
func (*ServerLinks) Decode ¶ added in v0.38.0
func (p *ServerLinks) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*ServerLinks) Encode ¶ added in v0.38.0
func (p *ServerLinks) Encode(c *proto.PacketContext, wr io.Writer) error
type ServerLogin ¶
type ServerLogin struct { Username string PlayerKey crypto.IdentifiedKey // 1.19.3 HolderID uuid.UUID // Used for key revision 2 }
func (*ServerLogin) Decode ¶
func (s *ServerLogin) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*ServerLogin) Encode ¶
func (s *ServerLogin) Encode(c *proto.PacketContext, wr io.Writer) error
type ServerLoginSuccess ¶
type ServerLoginSuccess struct { UUID uuid.UUID Username string Properties []profile.Property // 1.19+ }
func (*ServerLoginSuccess) Decode ¶
func (s *ServerLoginSuccess) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*ServerLoginSuccess) Encode ¶
func (s *ServerLoginSuccess) Encode(c *proto.PacketContext, wr io.Writer) (err error)
type SetCompression ¶
type SetCompression struct {
Threshold int
}
func (*SetCompression) Decode ¶
func (s *SetCompression) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*SetCompression) Encode ¶
func (s *SetCompression) Encode(c *proto.PacketContext, wr io.Writer) error
type StatusPing ¶
type StatusPing struct {
RandomID int64
}
func (*StatusPing) Decode ¶
func (s *StatusPing) Decode(_ *proto.PacketContext, rd io.Reader) (err error)
func (*StatusPing) Encode ¶
func (s *StatusPing) Encode(_ *proto.PacketContext, wr io.Writer) error
type StatusRequest ¶
type StatusRequest struct{}
func (StatusRequest) Decode ¶
func (StatusRequest) Decode(_ *proto.PacketContext, _ io.Reader) error
func (StatusRequest) Encode ¶
func (StatusRequest) Encode(_ *proto.PacketContext, _ io.Writer) error
type StatusResponse ¶
type StatusResponse struct {
Status string
}
func (*StatusResponse) Decode ¶
func (s *StatusResponse) Decode(_ *proto.PacketContext, rd io.Reader) (err error)
func (*StatusResponse) Encode ¶
func (s *StatusResponse) Encode(_ *proto.PacketContext, wr io.Writer) error
type TabCompleteOffer ¶ added in v0.12.0
type TabCompleteOffer struct { Text string Tooltip *chat.ComponentHolder // nil-able }
type TabCompleteRequest ¶ added in v0.12.0
type TabCompleteRequest struct { Command string TransactionID int AssumeCommand bool HasPosition bool Position int64 }
func (*TabCompleteRequest) Decode ¶ added in v0.12.0
func (t *TabCompleteRequest) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*TabCompleteRequest) Encode ¶ added in v0.12.0
func (t *TabCompleteRequest) Encode(c *proto.PacketContext, wr io.Writer) error
type TabCompleteResponse ¶ added in v0.12.0
type TabCompleteResponse struct { TransactionID int Start int Length int Offers []TabCompleteOffer }
func (*TabCompleteResponse) Decode ¶ added in v0.12.0
func (t *TabCompleteResponse) Decode(c *proto.PacketContext, rd io.Reader) (err error)
func (*TabCompleteResponse) Encode ¶ added in v0.12.0
func (t *TabCompleteResponse) Encode(c *proto.PacketContext, wr io.Writer) error
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
tablist
|
|
Package title contains title packets.
|
Package title contains title packets. |
Click to show internal directories.
Click to hide internal directories.