login

package
v1.0.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(request []byte) (IdentityData, ClientData, error)

Types

type ClientData

type ClientData struct {
	jwt.RegisteredClaims
	// ServerAddress is the exact address the player used to join the server with. This may be either an
	// actual address, or a hostname. ServerAddress also has the port in it, in the shape of
	// 'address:port`.
	ServerAddress string
}

ClientData is a container of client specific data of a Login packet. It holds data such as the skin of a player, but also its language code and device information.

type IdentityData

type IdentityData struct {
	// DisplayName is the username of the player, which may be changed by the user. It should for that reason
	// not be used as a key to store information.
	DisplayName string `json:"displayName"`
}

IdentityData contains identity data of the player logged in. It is found in one of the JWT claims signed by Mojang, and can thus be trusted.

Jump to

Keyboard shortcuts

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