SessionAccount

A premium account represented by nothing but a Minecraft access token.

The token cannot be refreshed - it is used as-is until it expires, at which point the account has to be re-added.

Constructors

Link copied to clipboard
constructor(session: String)
constructor()

Used for JSON deserialize.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var profile: GameProfile?
Link copied to clipboard
Link copied to clipboard

Known as soon as the account exists, unlike profile, which is only resolved once refresh has succeeded at least once.

Functions

Link copied to clipboard
fun isBanned(serverName: String): Boolean
Link copied to clipboard
Link copied to clipboard
fun login(): Pair<SessionWithService, YggdrasilAuthenticationService>

Authenticates the account and returns the session to hand to the game, along with the authentication service that resolves other players' profiles while it is active.

Link copied to clipboard
open override fun refresh()
Link copied to clipboard
fun toJson(): JsonObject
Link copied to clipboard
fun trackBan(ban: Ban)

Tracking bans is up to the caller - this only stores and expires them.

Link copied to clipboard
fun untrackBan(serverName: String)