API reference / @jsprismarine/client / LoginSequence
Class: LoginSequence
Defined in: client/src/login/LoginSequence.ts:82
The join, from the first packet to standing in the world.
Written as one object with one promise rather than as handlers scattered across the client, because the sequence is genuinely a sequence: each step is only valid after the one before it, and every one of the four ways it can fail - refused, kicked, timed out, wrong version - has to end up at the same place. A caller gets await login() and either a spawned player or an error that says why.
The steps, and who speaks:
client RequestNetworkSettings uncompressed, and the last one that is
server NetworkSettings uncompressed; compression is on from here
client Login the JWT chain and the client data
server PlayStatus(LoginSuccess)
server ResourcePacksInfo
client ResourcePackResponse(HaveAllPacks)
server ResourcePackStack
client ResourcePackResponse(Completed)
server StartGame, and a great deal else
server PlayStatus(PlayerSpawn)
client SetLocalPlayerAsInitializedConstructors
Constructor
new LoginSequence(
session,auth,logger,options):LoginSequence
Defined in: client/src/login/LoginSequence.ts:91
Parameters
session
auth
logger
options
Returns
LoginSequence
Methods
getStage()
getStage():
LoginStage
Defined in: client/src/login/LoginSequence.ts:98
Returns
onTransportClosed()
onTransportClosed(
reason):void
Defined in: client/src/login/LoginSequence.ts:124
Called when the transport dies under us, so the promise does not hang until timeout.
Parameters
reason
string
Returns
void
run()
run():
Promise<LoginResult>
Defined in: client/src/login/LoginSequence.ts:103
Runs the sequence, resolving once the server has spawned us.
Returns
Promise<LoginResult>