Documentation ¶
Index ¶
- Constants
- Variables
- func Channels(p *Message) (channels []string)
- func IsRegister(p *Message) bool
- func IsUnregister(p *Message) bool
- func LegacyRegister(p *Message) bool
- func LegacyUnregister(p *Message) bool
- func McBrand(p *Message) bool
- func ReadBrandMessage(data []byte) string
- func TransformLegacyToModernChannel(name string) string
- type Message
Constants ¶
Variables ¶
var InvalidIdentifierRegex = regexp.MustCompile(`[^a-z0-9\\-_]*`)
Functions ¶
func IsRegister ¶ added in v0.15.0
IsRegister determines whether this plugin message is being used to register plugin channels.
func IsUnregister ¶ added in v0.15.0
IsUnregister determines whether this plugin message is being used to unregister plugin channels.
func LegacyRegister ¶
LegacyRegister determines whether this plugin message is a legacy (<1.13) registration plugin message.
func LegacyUnregister ¶
LegacyUnregister determines whether this plugin message is a legacy (<1.13) un-registration plugin message.
func McBrand ¶
McBrand determines whether this is a brand plugin message. This is shown on the client.
func ReadBrandMessage ¶ added in v0.35.0
ReadBrandMessage reads the brand message from the given packet data. The returned string will be empty if the data is invalid.
Some clients (mostly poorly-implemented bots) do not send validly-formed brand messages. In order to accommodate their broken behavior, we'll first try to read in the 1.8 format, and if that fails, treat it as a 1.7-format message (which has no prefixed length). (The message the proxy sends will be in the correct format depending on the protocol.)
func TransformLegacyToModernChannel ¶
TransformLegacyToModernChannel transforms a plugin message channel from a "legacy" (<1.13) form to a modern one.
Types ¶
type Message ¶
Message is a Minecraft plugin message packet.
func ConstructChannelsPacket ¶
ConstructChannelsPacket constructs a channel (un)register packet. channels must not be empty! Note that the Message's Retained field remains nil.
func RewriteMinecraftBrand ¶
RewriteMinecraftBrand rewrites the brand message to indicate the presence of the proxy.