minecraft

package
v0.0.0-...-82a22e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2023 License: GPL-3.0 Imports: 11 Imported by: 5

Documentation

Index

Constants

View Source
const (
	PACKET_CLIENT_PLAYER_INFO_UPDATE_ACTION_ADD_PLAYER int = iota
	PACKET_CLIENT_PLAYER_INFO_UPDATE_ACTION_INITIALIZE_CHAT
	PACKET_CLIENT_PLAYER_INFO_UPDATE_ACTION_UPDATE_GAMEMODE
	PACKET_CLIENT_PLAYER_INFO_UPDATE_ACTION_UPDATE_LISTED
	PACKET_CLIENT_PLAYER_INFO_UPDATE_ACTION_UPDATE_LATENCY
	PACKET_CLIENT_PLAYER_INFO_UPDATE_ACTION_UPDATE_DISPLAY_NAME
)
View Source
const (
	PACKET_CLIENT_PLAYER_LIST_ACTION_ADD                 = 0
	PACKET_CLIENT_PLAYER_LIST_ACTION_UPDATE_GAMEMODE     = 1
	PACKET_CLIENT_PLAYER_LIST_ACTION_UPDATE_LATENCY      = 2
	PACKET_CLIENT_PLAYER_LIST_ACTION_UPDATE_DISPLAY_NAME = 3
	PACKET_CLIENT_PLAYER_LIST_ACTION_REMOVE              = 4
)
View Source
const (
	PACKET_CLIENT_SCOREBOARD_OBJECTIVE_ACTION_ADD    = int8(0)
	PACKET_CLIENT_SCOREBOARD_OBJECTIVE_ACTION_REMOVE = int8(1)
	PACKET_CLIENT_SCOREBOARD_OBJECTIVE_ACTION_UPDATE = int8(2)
)
View Source
const (
	PACKET_CLIENT_TEAMS_ACTION_ADD            = int8(0)
	PACKET_CLIENT_TEAMS_ACTION_REMOVE         = int8(1)
	PACKET_CLIENT_TEAMS_ACTION_INFO_UPDATE    = int8(2)
	PACKET_CLIENT_TEAMS_ACTION_PLAYERS_ADD    = int8(3)
	PACKET_CLIENT_TEAMS_ACTION_PLAYERS_REMOVE = int8(4)
)
View Source
const (
	MAGIC = string("§")

	PACKET_SERVER_HANDSHAKE = 0x00

	PACKET_CLIENT_STATUS_RESPONSE = 0x00
	PACKET_CLIENT_STATUS_PING     = 0x01
	PACKET_SERVER_STATUS_REQUEST  = 0x00
	PACKET_SERVER_STATUS_PING     = 0x01
)
View Source
const (
	PacketGenericSwappersClientSpawnObjectNoUUID int = iota
	PacketGenericSwappersClientSpawnObjectUUID
	PacketGenericSwappersClientSpawnObjectUUIDTypeVar
)
View Source
const (
	PacketGenericSwappersClientEntityDestroyVar int = iota
	PacketGenericSwappersClientEntityDestroyInt32
)

Variables

View Source
var HandshakePacketClientCodec = HandshakePacketServerCodec.Flip()
View Source
var StatusPacketClientCodec = StatusPacketServerCodec.Flip()

Functions

func Colorize

func Colorize(in string) (out string)

func NewPacketGenericCodec

func NewPacketGenericCodec(id int, swappers *PacketGenericSwappers) (this *packetGenericCodec)

func WriteGameProfileProperties

func WriteGameProfileProperties(writer io.Writer, val []GameProfileProperty) (err error)

func WriteProfilePublicKey

func WriteProfilePublicKey(writer io.Writer, val *ProfilePublicKey) (err error)

Types

type CodecClientStatusPing

type CodecClientStatusPing struct {
}

func (*CodecClientStatusPing) Decode

func (this *CodecClientStatusPing) Decode(reader io.Reader) (decode packet.Packet, err error)

func (*CodecClientStatusPing) Encode

func (this *CodecClientStatusPing) Encode(writer io.Writer, encode packet.Packet) (err error)

type CodecClientStatusResponse

type CodecClientStatusResponse struct {
}

func (*CodecClientStatusResponse) Decode

func (this *CodecClientStatusResponse) Decode(reader io.Reader) (decode packet.Packet, err error)

func (*CodecClientStatusResponse) Encode

func (this *CodecClientStatusResponse) Encode(writer io.Writer, encode packet.Packet) (err error)

type CodecServerHandshake

type CodecServerHandshake struct {
}

func (*CodecServerHandshake) Decode

func (this *CodecServerHandshake) Decode(reader io.Reader) (decode packet.Packet, err error)

func (*CodecServerHandshake) Encode

func (this *CodecServerHandshake) Encode(writer io.Writer, encode packet.Packet) (err error)

type CodecServerStatusPing

type CodecServerStatusPing struct {
}

func (*CodecServerStatusPing) Decode

func (this *CodecServerStatusPing) Decode(reader io.Reader) (decode packet.Packet, err error)

func (*CodecServerStatusPing) Encode

func (this *CodecServerStatusPing) Encode(writer io.Writer, encode packet.Packet) (err error)

type CodecServerStatusRequest

type CodecServerStatusRequest struct {
}

func (*CodecServerStatusRequest) Decode

func (this *CodecServerStatusRequest) Decode(reader io.Reader) (decode packet.Packet, err error)

func (*CodecServerStatusRequest) Encode

func (this *CodecServerStatusRequest) Encode(writer io.Writer, encode packet.Packet) (err error)

type GameProfile

type GameProfile struct {
	Id         string                `json:"id"`
	Name       string                `json:"name"`
	Properties []GameProfileProperty `json:"properties"`
}

type GameProfileProperty

type GameProfileProperty struct {
	Name      string `json:"name"`
	Value     string `json:"value"`
	Signature string `json:"signature"`
}

func ReadGameProfileProperties

func ReadGameProfileProperties(reader io.Reader) (val []GameProfileProperty, err error)

type IdMap

type IdMap struct {
	PacketClientKeepalive                 int
	PacketClientJoinGame                  int
	PacketClientChat                      int
	PacketClientTimeUpdate                int
	PacketClientEntityEquipment           int
	PacketClientSpawnPosition             int
	PacketClientUpdateHealth              int
	PacketClientRespawn                   int
	PacketClientPlayerPositionandLook     int
	PacketClientUpdateViewDistance        int
	PacketClientHeldItemChange            int
	PacketClientUseBed                    int
	PacketClientAnimation                 int
	PacketClientSpawnPlayer               int
	PacketClientCollectItem               int
	PacketClientSpawnObject               int
	PacketClientSpawnMob                  int
	PacketClientSpawnPainting             int
	PacketClientSpawnExperienceOrb        int
	PacketClientEntityVelocity            int
	PacketClientDestroyEntities           int
	PacketClientEntity                    int
	PacketClientEntityRelativeMove        int
	PacketClientEntityLook                int
	PacketClientEntityLookandRelativeMove int
	PacketClientEntityTeleport            int
	PacketClientEntityHeadLook            int
	PacketClientEntityStatus              int
	PacketClientAttachEntity              int
	PacketClientEntityMetadata            int
	PacketClientEntityEffect              int
	PacketClientRemoveEntityEffect        int
	PacketClientSetExperience             int
	PacketClientEntityProperties          int
	PacketClientChunkData                 int
	PacketClientMultiBlockChange          int
	PacketClientBlockChange               int
	PacketClientBlockAction               int
	PacketClientBlockBreakAnimation       int
	PacketClientMapChunkBulk              int
	PacketClientExplosion                 int
	PacketClientEffect                    int
	PacketClientNamedSoundEffect          int
	PacketClientParticle                  int
	PacketClientChangeGameState           int
	PacketClientSpawnGlobalEntity         int
	PacketClientOpenWindow                int
	PacketClientCloseWindow               int
	PacketClientSetSlot                   int
	PacketClientWindowItems               int
	PacketClientWindowProperty            int
	PacketClientConfirmTransaction        int
	PacketClientUpdateSign                int
	PacketClientMaps                      int
	PacketClientUpdateBlockEntity         int
	PacketClientSignEditorOpen            int
	PacketClientStatistics                int
	PacketClientPlayerList                int
	PacketClientPlayerAbilities           int
	PacketClientTabComplete               int
	PacketClientScoreboardObjective       int
	PacketClientUpdateScore               int
	PacketClientDisplayScoreboard         int
	PacketClientTeams                     int
	PacketClientPluginMessage             int
	PacketClientDisconnect                int
	PacketClientDifficulty                int
	PacketClientCombatEvent               int
	PacketClientCamera                    int
	PacketClientWorldBorder               int
	PacketClientTitle                     int
	PacketClientSetCompression            int
	PacketClientPlayerListHeadFoot        int
	PacketClientResourcePack              int
	PacketClientUpdateEntityNbt           int
	PacketClientEntitySoundEffect         int
	PacketServerKeepalive                 int
	PacketServerChat                      int
	PacketServerUseEntity                 int
	PacketServerPlayer                    int
	PacketServerPlayerPosition            int
	PacketServerPlayerLook                int
	PacketServerPlayerLookandPosition     int
	PacketServerPlayerDigging             int
	PacketServerPlayerBlockPlacement      int
	PacketServerHeldItemChange            int
	PacketServerAnimation                 int
	PacketServerEntityAction              int
	PacketServerSteerVehicle              int
	PacketServerCloseWindow               int
	PacketServerClickWindow               int
	PacketServerConfirmTransaction        int
	PacketServerCreativeInventoryAction   int
	PacketServerEnchantItem               int
	PacketServerUpdateSign                int
	PacketServerPlayerAbilities           int
	PacketServerTabComplete               int
	PacketServerClientSettings            int
	PacketServerClientStatus              int
	PacketServerPluginMessage             int
	PacketServerSpectate                  int
	PacketServerResourcePackStatus        int

	PacketClientLoginDisconnect      int
	PacketClientLoginEncryptRequest  int
	PacketClientLoginSuccess         int
	PacketClientLoginSetCompression  int
	PacketServerLoginStart           int
	PacketServerLoginEncryptResponse int

	// 1.9
	PacketClientBossBar         int
	PacketClientSetCooldown     int
	PacketClientUnloadChunk     int
	PacketClientVehicleMove     int
	PacketClientSetPassengers   int
	PacketServerTeleportConfirm int
	PacketServerVehicleMove     int
	PacketServerSteerBoat       int
	PacketServerUseItem         int

	// 1.12
	PlayClientUnlockRecipes       int
	PlayClientAdvancementProgress int
	PlayClientAdvancements        int
	PlayServerPrepareCraftingGrid int
	PlayServerCraftingBookData    int
	PlayServerAdvancementTab      int

	// 1.13
	PacketClientStopSound int

	// 1.18
	PacketClientUpdateSimulationDistance int

	// 1.19
	PacketClientChatPreview           int
	PacketClientPlayerChatMessage     int
	PacketClientSystemChatMessage     int
	PacketClientSetDisplayChatPreview int
	PacketClientServerData            int
	PacketServerChatCommand           int
	PacketServerChatMessage           int
	PacketServerChatPreview           int
	PacketServerSetDisplayedRecipe    int
	PacketServerSetBeaconEffect       int

	// 1.19.1
	PacketClientCustomChatCompletions int
	PacketClientDeleteChatMessage     int
	PacketClientPlayerChatHeader      int
	PacketServerChatAck               int

	// 1.19.3
	PacketClientDisguisedChat         int
	PacketClientPlayerInfoRemove      int
	PacketClientPlayerInfoUpdate      int
	PacketClientUpdateEnabledFeatures int
	PacketServerChatSessionUpdate     int

	// Entities
	EntityArrow         int
	EntityFishingBobber int
	EntitySpectralArrow int
}

type IdMapPacket

type IdMapPacket struct {
	// contains filtered or unexported fields
}

func (*IdMapPacket) Id

func (this *IdMapPacket) Id() int

func (*IdMapPacket) IdFrom

func (this *IdMapPacket) IdFrom(idMap *IdMap)

func (*IdMapPacket) IdSet

func (this *IdMapPacket) IdSet(id int)

type Location

type Location struct {
	Dimension string
	Position  int64
}

type PacketClientDisconnect

type PacketClientDisconnect struct {
	IdMapPacket
	Json string
}

func NewPacketClientDisconnect

func NewPacketClientDisconnect(idMap *IdMap, json string) (this *PacketClientDisconnect)

func (*PacketClientDisconnect) IdFrom

func (this *PacketClientDisconnect) IdFrom(idMap *IdMap)

type PacketClientJoinGame

type PacketClientJoinGame struct {
	IdMapPacket
	EntityId            int32
	Hardcore            bool // 1.16.2+
	Gamemode            int8
	PreviousGamemode    int8     // 1.16+
	WorldNames          []string // 1.16+
	DimensionCodec      nbt.Nbt  // 1.16+
	DimensionNBT        nbt.Nbt  // 1.16.2+ // removed in 1.19+
	Dimension           int8     // removed in 1.16+
	DimensionName       string   // 1.16+ // removed in 1.16.2+ // added back in 1.19+
	WorldName           string   // 1.16+
	HashedSeed          int64
	Difficulty          int8
	MaxPlayers          int
	LevelType           string // removed in 1.16+
	ViewDistance        int
	ReducedDebugInfo    bool
	EnableRespawnScreen bool
	IsDebug             bool      // 1.16+
	IsFlat              bool      // 1.16+
	SimulationDistance  int       // 1.18+
	DeathLocation       *Location // 1.19+
}

func (*PacketClientJoinGame) IdFrom

func (this *PacketClientJoinGame) IdFrom(idMap *IdMap)

type PacketClientLoginDisconnect

type PacketClientLoginDisconnect struct {
	IdMapPacket
	Json string
}

func NewPacketClientLoginDisconnect

func NewPacketClientLoginDisconnect(idMap *IdMap, json string) (this *PacketClientLoginDisconnect)

func (*PacketClientLoginDisconnect) IdFrom

func (this *PacketClientLoginDisconnect) IdFrom(idMap *IdMap)

type PacketClientLoginEncryptRequest

type PacketClientLoginEncryptRequest struct {
	IdMapPacket
	ServerId    string
	PublicKey   []byte
	VerifyToken []byte
}

func NewPacketClientLoginEncryptRequest

func NewPacketClientLoginEncryptRequest(idMap *IdMap, serverId string, publicKey []byte, verifyToken []byte) (this *PacketClientLoginEncryptRequest)

func (*PacketClientLoginEncryptRequest) IdFrom

func (this *PacketClientLoginEncryptRequest) IdFrom(idMap *IdMap)

type PacketClientLoginSetCompression

type PacketClientLoginSetCompression struct {
	IdMapPacket
	Threshold int
}

func NewPacketClientLoginSetCompression

func NewPacketClientLoginSetCompression(idMap *IdMap, threshold int) (this *PacketClientLoginSetCompression)

func (*PacketClientLoginSetCompression) IdFrom

func (this *PacketClientLoginSetCompression) IdFrom(idMap *IdMap)

type PacketClientLoginSuccess

type PacketClientLoginSuccess struct {
	IdMapPacket
	UUID       string
	Name       string
	Properties []GameProfileProperty // 1.19+
}

func NewPacketClientLoginSuccess

func NewPacketClientLoginSuccess(idMap *IdMap, uuid string, name string, properties []GameProfileProperty) (this *PacketClientLoginSuccess)

func (*PacketClientLoginSuccess) IdFrom

func (this *PacketClientLoginSuccess) IdFrom(idMap *IdMap)

type PacketClientPlayerInfoRemove

type PacketClientPlayerInfoRemove struct {
	IdMapPacket
	UUIDs []uuid.UUID
}

func NewPacketClientPlayerInfoRemove

func NewPacketClientPlayerInfoRemove(idMap *IdMap, uuids []uuid.UUID) (this *PacketClientPlayerInfoRemove)

func (*PacketClientPlayerInfoRemove) IdFrom

func (this *PacketClientPlayerInfoRemove) IdFrom(idMap *IdMap)

type PacketClientPlayerInfoUpdate

type PacketClientPlayerInfoUpdate struct {
	IdMapPacket
	Actions []int
	Items   []PacketClientPlayerInfoUpdateItem
}

func (*PacketClientPlayerInfoUpdate) IdFrom

func (this *PacketClientPlayerInfoUpdate) IdFrom(idMap *IdMap)

type PacketClientPlayerInfoUpdateItem

type PacketClientPlayerInfoUpdateItem struct {
	UUID uuid.UUID

	// ADD_PLAYER
	Name       string
	Properties []GameProfileProperty

	// INITIALIZE_CHAT
	ChatSessionId *uuid.UUID
	PublicKey     *ProfilePublicKey

	// UPDATE_GAMEMODE
	Gamemode int

	// UPDATE_LISTED
	Listed bool

	// UPDATE_LATENCY
	Latency int

	// UPDATE_DISPLAY_NAME
	DisplayName string
}

type PacketClientPlayerList

type PacketClientPlayerList struct {
	IdMapPacket
	Action int
	Items  []PacketClientPlayerListItem
}

func NewPacketClientPlayerList

func NewPacketClientPlayerList(idMap *IdMap, action int, items []PacketClientPlayerListItem) (this *PacketClientPlayerList)

func (*PacketClientPlayerList) IdFrom

func (this *PacketClientPlayerList) IdFrom(idMap *IdMap)

type PacketClientPlayerListAddPlayer

type PacketClientPlayerListAddPlayer struct {
	Name        string
	Properties  []GameProfileProperty
	Gamemode    int
	Latency     int
	DisplayName string
	PublicKey   *ProfilePublicKey // 1.19+
}

type PacketClientPlayerListItem

type PacketClientPlayerListItem struct {
	UUID uuid.UUID
	Info interface{}
}

type PacketClientPlayerListUpdateDisplayName

type PacketClientPlayerListUpdateDisplayName struct {
	DisplayName string
}

type PacketClientPlayerListUpdateGamemode

type PacketClientPlayerListUpdateGamemode struct {
	Gamemode int
}

type PacketClientPlayerListUpdateLatency

type PacketClientPlayerListUpdateLatency struct {
	Latency int
}

type PacketClientRespawn

type PacketClientRespawn struct {
	IdMapPacket
	Dimension        int32   // removed in 1.16+
	DimensionName    string  // 1.16+ // removed in 1.16.2+ // added back in 1.19+
	DimensionNBT     nbt.Nbt // 1.16.2+ // removed in 1.19+
	WorldName        string  // 1.16+
	HashedSeed       int64
	Difficulty       int8
	Gamemode         int8
	PreviousGamemode int8      // 1.16+
	LevelType        string    // removed in 1.16+
	IsDebug          bool      // 1.16+
	IsFlat           bool      // 1.16+
	DeathLocation    *Location // 1.19+
	CopyMetadata     bool      // 1.16+
}

func NewPacketClientRespawnFrom

func NewPacketClientRespawnFrom(idMap *IdMap, joinGame *PacketClientJoinGame) (this *PacketClientRespawn)

func (*PacketClientRespawn) IdFrom

func (this *PacketClientRespawn) IdFrom(idMap *IdMap)

type PacketClientScoreboardObjective

type PacketClientScoreboardObjective struct {
	IdMapPacket
	Name   string
	Action int8
	Value  string
	Type   string
}

func NewPacketClientScoreboardObjectiveAdd

func NewPacketClientScoreboardObjectiveAdd(idMap *IdMap, name string, value string, stype string) (this *PacketClientScoreboardObjective)

func NewPacketClientScoreboardObjectiveRemove

func NewPacketClientScoreboardObjectiveRemove(idMap *IdMap, name string) (this *PacketClientScoreboardObjective)

func NewPacketClientScoreboardObjectiveUpdate

func NewPacketClientScoreboardObjectiveUpdate(idMap *IdMap, name string, value string, stype string) (this *PacketClientScoreboardObjective)

func (*PacketClientScoreboardObjective) IdFrom

func (this *PacketClientScoreboardObjective) IdFrom(idMap *IdMap)

type PacketClientSetCompression

type PacketClientSetCompression struct {
	IdMapPacket
	Threshold int
}

func NewPacketClientSetCompression

func NewPacketClientSetCompression(idMap *IdMap, threshold int) (this *PacketClientSetCompression)

func (*PacketClientSetCompression) IdFrom

func (this *PacketClientSetCompression) IdFrom(idMap *IdMap)

type PacketClientStatusPing

type PacketClientStatusPing struct {
	Time int64
}

func NewPacketClientStatusPing

func NewPacketClientStatusPing(time int64) (this *PacketClientStatusPing)

func (*PacketClientStatusPing) Id

func (this *PacketClientStatusPing) Id() int

type PacketClientStatusResponse

type PacketClientStatusResponse struct {
	Json string
}

func NewPacketClientStatusResponse

func NewPacketClientStatusResponse(json string) (this *PacketClientStatusResponse)

func (*PacketClientStatusResponse) Id

func (this *PacketClientStatusResponse) Id() int

type PacketClientTeams

type PacketClientTeams struct {
	IdMapPacket
	Name              string
	Action            int8
	DisplayName       string
	Prefix            string
	Suffix            string
	FriendlyFire      int8
	NameTagVisibility string
	CollisionRule     string
	Color             int
	Players           []string
}

func NewPacketClientTeamsAdd

func NewPacketClientTeamsAdd(idMap *IdMap, name string, displayName string, prefix string, suffix string, friendlyFire int8, nameTagVisibility string, color int, players []string) (this *PacketClientTeams)

func NewPacketClientTeamsInfoUpdate

func NewPacketClientTeamsInfoUpdate(idMap *IdMap, name string, displayName string, prefix string, suffix string, friendlyFire int8, nameTagVisibility string, collisionRule string, color int) (this *PacketClientTeams)

func NewPacketClientTeamsPlayersAdd

func NewPacketClientTeamsPlayersAdd(idMap *IdMap, name string, players []string) (this *PacketClientTeams)

func NewPacketClientTeamsPlayersRemove

func NewPacketClientTeamsPlayersRemove(idMap *IdMap, name string, players []string) (this *PacketClientTeams)

func NewPacketClientTeamsRemove

func NewPacketClientTeamsRemove(idMap *IdMap, name string) (this *PacketClientTeams)

func (*PacketClientTeams) IdFrom

func (this *PacketClientTeams) IdFrom(idMap *IdMap)

type PacketClientViewDistance

type PacketClientViewDistance struct {
	IdMapPacket
	ViewDistance int
}

func NewPacketClientViewDistance

func NewPacketClientViewDistance(idMap *IdMap, viewDistance int) (this *PacketClientViewDistance)

func (*PacketClientViewDistance) IdFrom

func (this *PacketClientViewDistance) IdFrom(idMap *IdMap)

type PacketGeneric

type PacketGeneric struct {
	Bytes []byte
	// contains filtered or unexported fields
}

func NewPacketGeneric

func NewPacketGeneric(id int, bytes []byte, compressed bool, swappers *PacketGenericSwappers) (this *PacketGeneric)

func (*PacketGeneric) Decompress

func (this *PacketGeneric) Decompress() (err error)

func (*PacketGeneric) Id

func (this *PacketGeneric) Id() int

func (*PacketGeneric) Raw

func (this *PacketGeneric) Raw() bool

func (*PacketGeneric) SwapEntities

func (this *PacketGeneric) SwapEntities(a int32, b int32, isClientBound bool)

type PacketGenericSwappers

type PacketGenericSwappers struct {
	ClientInt           [][]int
	ClientVarInt        []bool
	ClientSpawnObject   int
	ClientEntityDestroy int
	ServerInt           [][]int
	ServerVarInt        []bool
	IdMap               *IdMap
}

type PacketServerClientSettings

type PacketServerClientSettings struct {
	IdMapPacket
	Locale               string
	ViewDistance         byte
	ChatFlags            byte
	ChatColours          bool
	Difficulty           byte
	SkinParts            byte
	MainHand             int
	DisableTextFiltering bool
	AllowServerListings  bool // 1.18+
}

func NewPacketServerClientSettings

func NewPacketServerClientSettings(idMap *IdMap, locale string, viewDistance byte, chatFlags byte, chatColours bool, skinParts byte, mainHand int) (this *PacketServerClientSettings)

func (*PacketServerClientSettings) IdFrom

func (this *PacketServerClientSettings) IdFrom(idMap *IdMap)

type PacketServerHandshake

type PacketServerHandshake struct {
	ProtocolVersion int
	ServerAddress   string
	ServerPort      uint16
	State           int
}

func NewPacketServerHandshake

func NewPacketServerHandshake(protocolVersion int, serverAddress string, serverPort uint16, state int) (this *PacketServerHandshake)

func (*PacketServerHandshake) Id

func (this *PacketServerHandshake) Id() int

type PacketServerLoginEncryptResponse

type PacketServerLoginEncryptResponse struct {
	IdMapPacket
	SharedSecret []byte
	VerifyToken  []byte
	Salt         int64  // 1.19+
	Signature    []byte // 1.19+
}

func (*PacketServerLoginEncryptResponse) IdFrom

func (this *PacketServerLoginEncryptResponse) IdFrom(idMap *IdMap)

type PacketServerLoginStart

type PacketServerLoginStart struct {
	IdMapPacket
	Name      string
	PublicKey *ProfilePublicKey
	UUID      *uuid.UUID // 1.19.1+
}

func NewPacketServerLoginStart

func NewPacketServerLoginStart(idMap *IdMap, name string, uuid *uuid.UUID) (this *PacketServerLoginStart)

func (*PacketServerLoginStart) IdFrom

func (this *PacketServerLoginStart) IdFrom(idMap *IdMap)

type PacketServerPluginMessage

type PacketServerPluginMessage struct {
	IdMapPacket
	Channel string
	Data    []byte
}

func NewPacketServerPluginMessage

func NewPacketServerPluginMessage(idMap *IdMap, channel string, data []byte) (this *PacketServerPluginMessage)

func (*PacketServerPluginMessage) IdFrom

func (this *PacketServerPluginMessage) IdFrom(idMap *IdMap)

type PacketServerStatusPing

type PacketServerStatusPing struct {
	Time int64
}

func NewPacketServerStatusPing

func NewPacketServerStatusPing(time int64) (this *PacketServerStatusPing)

func (*PacketServerStatusPing) Id

func (this *PacketServerStatusPing) Id() int

type PacketServerStatusRequest

type PacketServerStatusRequest struct {
}

func NewPacketServerStatusRequest

func NewPacketServerStatusRequest() (this *PacketServerStatusRequest)

func (*PacketServerStatusRequest) Id

func (this *PacketServerStatusRequest) Id() int

type ProfilePublicKey

type ProfilePublicKey struct {
	Expiry    int64
	Key       []byte
	Signature []byte
}

func ReadProfilePublicKey

func ReadProfilePublicKey(reader io.Reader) (val *ProfilePublicKey, err error)

type Version

type Version struct {
	Name             string
	NameLatest       string
	LoginClientCodec packet.PacketPipelineChild
	LoginServerCodec packet.PacketPipelineChild
	PlayClientCodec  packet.PacketPipelineChild
	PlayServerCodec  packet.PacketPipelineChild
	IdMap            *IdMap
	Id               []int
	IdLatest         int
}

type VersionTable

type VersionTable struct {
	// contains filtered or unexported fields
}

func NewVersionTable

func NewVersionTable() (this *VersionTable)

func NewVersionTableFrom

func NewVersionTableFrom(versions ...*Version) (this *VersionTable)

func (*VersionTable) ById

func (this *VersionTable) ById(id int) *Version

func (*VersionTable) Latest

func (this *VersionTable) Latest() *Version

func (*VersionTable) Register

func (this *VersionTable) Register(register *Version)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL