mojang

package
v0.0.0-...-e969f47 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinServer

func JoinServer(profile Profile, serverHash ...[]byte) error

JoinServer tries to mark the server has joined on mojang's session servers using the passed profile and bytes (as the server hash). The hash is normally the serverID + secret key + public key.

Types

type Error

type Error struct {
	Message string `json:"errorMessage"`
	Type    string `json:"error"`
}

func (Error) Error

func (m Error) Error() string

type Profile

type Profile struct {
	Username    string
	ID          string
	AccessToken string
}

Profile contains information about the player required to connect to a server

func Login

func Login(username, password, token string) (Profile, error)

Login tries to login using the passed username (or email) and password and returns the complete profile. error is non-nil if the login fails.

func Refresh

func Refresh(profile Profile, token string) (Profile, error)

Refresh attempts to refresh the passed profile's accessToken for futher use. The passed token should be the same as the one passed to Login.

func (Profile) IsComplete

func (p Profile) IsComplete() bool

IsComplete returns whether the profile is enough to connect with.

Jump to

Keyboard shortcuts

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