mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-10-03 16:09:55 -04:00
Merge pull request #566 from plexigras/session-emit-fix
added session data to session even
This commit is contained in:
commit
62d595937b
@ -66,6 +66,7 @@ Called when a client connects, but before any login has happened. Takes a
|
|||||||
|
|
||||||
Called when a client is logged in against server. Takes a `Client` parameter.
|
Called when a client is logged in against server. Takes a `Client` parameter.
|
||||||
|
|
||||||
|
|
||||||
## mc.createClient(options)
|
## mc.createClient(options)
|
||||||
|
|
||||||
Returns a `Client` instance and perform login.
|
Returns a `Client` instance and perform login.
|
||||||
@ -146,6 +147,10 @@ and the packet metadata (name, state)
|
|||||||
Called when the protocol changes state. Takes the new state and old state as
|
Called when the protocol changes state. Takes the new state and old state as
|
||||||
parameters.
|
parameters.
|
||||||
|
|
||||||
|
### `session` event
|
||||||
|
|
||||||
|
Called when user authentication is resolved. Takes session data as parameter.
|
||||||
|
|
||||||
### per-packet events
|
### per-packet events
|
||||||
|
|
||||||
Check out the [minecraft-data docs](https://prismarinejs.github.io/minecraft-data/?v=1.8&d=protocol) to know the event names and data field names.
|
Check out the [minecraft-data docs](https://prismarinejs.github.io/minecraft-data/?v=1.8&d=protocol) to know the event names and data field names.
|
||||||
|
@ -15,7 +15,7 @@ module.exports = function (client, options) {
|
|||||||
client.session = session
|
client.session = session
|
||||||
client.username = session.selectedProfile.name
|
client.username = session.selectedProfile.name
|
||||||
options.accessToken = session.accessToken
|
options.accessToken = session.accessToken
|
||||||
client.emit('session')
|
client.emit('session', session)
|
||||||
options.connect(client)
|
options.connect(client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user